]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraBothEventCuts.cxx
adding proper destructors and some small changes in analysis macro
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TestAOD / AliSpectraBothEventCuts.cxx
CommitLineData
239a080a 1
2/**************************************************************************
3 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16
17//-----------------------------------------------------------------
18// AliSpectraBothEventCuts class
19//-----------------------------------------------------------------
20
21#include "TChain.h"
22#include "TTree.h"
23#include "TLegend.h"
24#include "TH1F.h"
25#include "TH1I.h"
26#include "TH2F.h"
27#include "TCanvas.h"
28#include "AliAnalysisTask.h"
29#include "AliAnalysisManager.h"
30#include "AliAODTrack.h"
31#include "AliAODMCParticle.h"
32#include "AliAODEvent.h"
33#include "AliESDEvent.h"
34#include "AliAODInputHandler.h"
35#include "AliAnalysisTaskESDfilter.h"
36#include "AliAnalysisDataContainer.h"
37#include "AliSpectraBothEventCuts.h"
38#include "AliSpectraBothTrackCuts.h"
39//#include "AliSpectraBothHistoManager.h"
40#include <iostream>
41
42using namespace std;
43
44ClassImp(AliSpectraBothEventCuts)
45
b3ea73e1 46AliSpectraBothEventCuts::AliSpectraBothEventCuts(const char *name) : TNamed(name, "AOD Event Cuts"), fAOD(0),fAODEvent(AliSpectraBothTrackCuts::kAODobject), fTrackBits(0),fIsMC(0),fCentEstimator(""), fUseCentPatchAOD049(0), fUseSDDPatchforLHC11a(kDoNotCheckforSDD),fTriggerSettings(AliVEvent::kMB),fTrackCuts(0),
239a080a 47fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0),fMaxChi2perNDFforVertex(0),
48fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0)
8bb435b0 49,fHistoEP(0),fHistoVtxAftSelwithoutZvertexCut(0),fHistoVtxalltriggerEventswithMCz(0),fHistoVtxAftSelwithoutZvertexCutusingMCz(0)
239a080a 50{
8fda510f 51 // Constructori
52 Bool_t oldStatus = TH1::AddDirectoryStatus();
53 TH1::AddDirectory(kFALSE);
239a080a 54 fHistoCuts = new TH1I("fEventCuts", "Event Cuts", kNVtxCuts, -0.5, kNVtxCuts - 0.5);
547e52a0 55 fHistoVtxBefSel = new TH1F("fHistoVtxBefSel", "Vtx distr before event selection",300,-15,15);
56 fHistoVtxAftSel = new TH1F("fHistoVtxAftSel", "Vtx distr after event selection",300,-15,15);
8bb435b0 57 fHistoVtxAftSelwithoutZvertexCut=new TH1F("fHistoVtxAftSelwithoutZvertexcut", "Vtx distr after event selection without Z vertex cut",300,-15,15);
58 fHistoVtxalltriggerEventswithMCz=new TH1F("fHistoVtxalltriggerEventswithMCz", "generated z vertex position",300,-15,15);
59 fHistoVtxAftSelwithoutZvertexCutusingMCz=new TH1F("fHistoVtxAftSelwithoutZvertexCutusingMCz", "Vtx distr after event selection without Z vertex cut using MC z",300,-15,15);
239a080a 60 fHistoEtaBefSel = new TH1F("fHistoEtaBefSel", "Eta distr before event selection",500,-2,2);
61 fHistoEtaAftSel = new TH1F("fHistoEtaAftSel", "Eta distr after event selection",500,-2,2);
62 fHistoNChAftSel = new TH1F("fHistoNChAftSel", "NCh distr after event selection",2000,-0.5,1999.5);
63 //fHistoQVectorPos = new TH1F("fHistoQVectorPos", "QVectorPos distribution",100,0,10);
64 //fHistoQVectorNeg = new TH1F("fHistoQVectorNeg", "QVectorNeg distribution",100,0,10);
65 fHistoQVector = new TH1F("fHistoQVector", "QVector with VZERO distribution",100,0,10);
66 fHistoEP = new TH1F("fHistoEP", "EP with VZERO distribution",100,-10,10);
67 fCentralityCutMin = 0.0; // default value of centrality cut minimum, 0 ~ no cut
68 fCentralityCutMax = 10000.0; // default value of centrality cut maximum, ~ no cut
69 // fQVectorPosCutMin=0.0;
70 // fQVectorPosCutMax=10000.0;
71 // fQVectorNegCutMin=0.0;
72 // fQVectorNegCutMax=10000.0;
73 fQVectorCutMin=0.0;
74 fQVectorCutMax=10000.0;
75 fVertexCutMin=-10.0;
76 fVertexCutMax=10.0;
77 fMultiplicityCutMin=-1.0;
78 fMultiplicityCutMax=-1.0;
79 fTrackBits=1;
b3ea73e1 80 fCentEstimator="V0M";
239a080a 81 fMaxChi2perNDFforVertex=-1;
8fda510f 82 TH1::AddDirectory(oldStatus);
83}
84//______________________________________________________
85
86AliSpectraBothEventCuts::~AliSpectraBothEventCuts()
87{
88 if(fHistoCuts)
89 delete fHistoCuts;
90 if(fHistoVtxBefSel)
91 delete fHistoVtxBefSel;
92 if(fHistoVtxAftSel)
93 delete fHistoVtxAftSel;
94 if(fHistoVtxAftSelwithoutZvertexCut)
95 delete fHistoVtxAftSelwithoutZvertexCut;
96 if(fHistoVtxalltriggerEventswithMCz)
97 delete fHistoVtxalltriggerEventswithMCz;
98 if(fHistoVtxAftSelwithoutZvertexCutusingMCz)
99 delete fHistoVtxAftSelwithoutZvertexCutusingMCz;
100 if(fHistoEtaBefSel)
101 delete fHistoEtaBefSel;
102 if(fHistoEtaAftSel)
103 delete fHistoEtaAftSel ;
104 if(fHistoNChAftSel)
105 delete fHistoNChAftSel;
106 if(fHistoQVector)
107 delete fHistoQVector;
108 if(fHistoEP)
109 delete fHistoEP;
239a080a 110}
111
112//______________________________________________________
8bb435b0 113Bool_t AliSpectraBothEventCuts::IsSelected(AliVEvent * aod,AliSpectraBothTrackCuts* trackcuts,Bool_t isMC,Double_t mcZ)
239a080a 114{
115 // Returns true if Event Cuts are selected and applied
116 fAOD = aod;
117 fTrackCuts = trackcuts;
118 fHistoCuts->Fill(kProcessedEvents);
8bb435b0 119
1c23d41e 120 Bool_t IsPhysSel = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fTriggerSettings);//FIXME we can add the trigger mask here
239a080a 121 if(!IsPhysSel)return IsPhysSel;
8bb435b0 122
123 if(isMC)
124 fHistoVtxalltriggerEventswithMCz->Fill(mcZ);
125
239a080a 126 //loop on tracks, before event selection, filling QA histos
127 AliESDEvent* esdevent=0x0;
128 AliAODEvent* aodevent=0x0;
129 Bool_t isSDD=kFALSE;
130 TString nameoftrack(fAOD->ClassName());
131 if(!nameoftrack.CompareTo("AliESDEvent"))
132 {
133 fAODEvent=AliSpectraBothTrackCuts::kESDobject;
134
135 if(fUseSDDPatchforLHC11a!=kDoNotCheckforSDD)
136 {
137 esdevent=dynamic_cast<AliESDEvent*>(fAOD);
737ad8ac 138 if(!esdevent)
94a8ed71 139 return kFALSE;
239a080a 140 if(esdevent->GetFiredTriggerClasses().Contains("ALLNOTRD"))
141 isSDD=kTRUE;
142 }
143 }
144 else if(!nameoftrack.CompareTo("AliAODEvent"))
145 {
146 fAODEvent=AliSpectraBothTrackCuts::kAODobject;
147 if(fUseSDDPatchforLHC11a!=kDoNotCheckforSDD)
148 {
149 aodevent=dynamic_cast<AliAODEvent*>(fAOD);
737ad8ac 150 if(!aodevent)
94a8ed71 151 return kFALSE;
239a080a 152 if(aodevent->GetFiredTriggerClasses().Contains("ALLNOTRD"))
153 isSDD=kTRUE;
154 }
155 }
156 else
157 return false;
158 if(fUseSDDPatchforLHC11a==kwithSDD&&isSDD==kFALSE)
159 return false;
160 if(fUseSDDPatchforLHC11a==kwithoutSDD&&isSDD==kTRUE)
161 return false;
162
163
239a080a 164 fHistoCuts->Fill(kPhysSelEvents);
165
166
167
168
bca0c28e 169 const AliVVertex * vertex = fAOD->GetPrimaryVertex();//FIXME vertex is recreated
170
239a080a 171 if(vertex)fHistoVtxBefSel->Fill(vertex->GetZ());
172 fIsSelected =kFALSE;
547e52a0 173 if(CheckVtx() && CheckCentralityCut() && CheckMultiplicityCut() && CheckVtxChi2perNDF())
174 { //selection on vertex and Centrality
175
239a080a 176 fIsSelected=CheckQVectorCut(); // QVector is calculated only if the centrality and vertex are correct (performance)
177 }
8bb435b0 178 if(fIsSelected&&vertex)
547e52a0 179 {
8bb435b0 180 fHistoVtxAftSelwithoutZvertexCut->Fill(vertex->GetZ());
181 if(isMC)
182 fHistoVtxAftSelwithoutZvertexCutusingMCz->Fill(mcZ);
547e52a0 183 if (vertex->GetZ() > fVertexCutMin && vertex->GetZ() < fVertexCutMax)
184 {
185 fHistoCuts->Fill(kAcceptedEvents);
186 fIsSelected=kTRUE;
187 fHistoVtxAftSel->Fill(vertex->GetZ());
188 }
189 else
190 {
191 fIsSelected=kFALSE;
192 }
239a080a 193 }
194 Int_t Nch=0;
195 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
196 AliVTrack* track =dynamic_cast<AliVTrack*>(fAOD->GetTrack(iTracks));
197 /* if(fAODEvent==AliSpectraBothTrackCuts::kESDobject)
198 track=dynamic_cast<AliVTrack*>(esdevent->GetTrack(iTracks));
199 else if (fAODEvent==AliSpectraBothTrackCuts::kAODobject)
200 track=dynamic_cast<AliVTrack*>(aodevent->GetTrack(iTracks));
201 else return false;*/
202
203 if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
204 fHistoEtaBefSel->Fill(track->Eta());
205 if(fIsSelected){
206 fHistoEtaAftSel->Fill(track->Eta());
207 Nch++;
208 }
209 }
210 //Printf("NCHARGED_EvSel : %d",Nch);
211 if(fIsSelected)fHistoNChAftSel->Fill(Nch);
212 return fIsSelected;
213}
214
215//______________________________________________________
547e52a0 216Bool_t AliSpectraBothEventCuts::CheckVtx()
239a080a 217{
218 // reject events outside of range
219 const AliVVertex * vertex = fAOD->GetPrimaryVertex();
220 //when moving to 2011 wìone has to add a cut using SPD vertex.
221 //The point is that for events with |z|>20 the vertexer tracks is not working (only 2011!). One has to put a safety cut using SPD vertex large e.g. 15cm
222 if (!vertex)
223 {
224 fHistoCuts->Fill(kVtxNoEvent);
225 return kFALSE;
226 }
bca0c28e 227 if(vertex->GetNContributors()<1)
239a080a 228 {
bca0c28e 229
230 fHistoCuts->Fill(kZeroCont);
239a080a 231 return kFALSE;
232
233 }
bca0c28e 234
235 TString tmp(vertex->GetTitle());
236 if(tmp.Contains("NoConstraint"))
239a080a 237 {
bca0c28e 238 fHistoCuts->Fill(kTPCasPV);
239 return kFALSE;
240 }
241
242
547e52a0 243 // if (vertex->GetZ() > fVertexCutMin && vertex->GetZ() < fVertexCutMax)
244 // {
245 // return kTRUE;
246 // }
239a080a 247 fHistoCuts->Fill(kVtxRange);
547e52a0 248 //return kFALSE;
249 return kTRUE;
239a080a 250}
251
252//______________________________________________________
253Bool_t AliSpectraBothEventCuts::CheckCentralityCut()
254{
255 // Check centrality cut
256 if ( fCentralityCutMax<0.0 && fCentralityCutMin<0.0 ) return kTRUE;
257 Double_t cent=0;
b3ea73e1 258 if(!fUseCentPatchAOD049)cent=fAOD->GetCentrality()->GetCentralityPercentile(fCentEstimator.Data());
239a080a 259 else cent=ApplyCentralityPatchAOD049();
260
261 if ( (cent <= fCentralityCutMax) && (cent >= fCentralityCutMin) ) return kTRUE;
262 fHistoCuts->Fill(kVtxCentral);
263
264 return kFALSE;
265}
266
267//______________________________________________________
268Bool_t AliSpectraBothEventCuts::CheckMultiplicityCut()
269{
270 // Check multiplicity cut
271if(fMultiplicityCutMin<0.0 && fMultiplicityCutMax<0.0)
272 return kTRUE;
273 Int_t Ncharged=0;
274 for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++){
275 AliVTrack* track = dynamic_cast<AliVTrack*>(fAOD->GetTrack(iTracks));
276
277 if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
278
279 Ncharged++;
280 }
281 //Printf("NCHARGED_cut : %d",Ncharged);
282 if(Ncharged>fMultiplicityCutMin && Ncharged<fMultiplicityCutMax)return kTRUE;
283
284 return kFALSE;
285}
286
287//______________________________________________________
288Bool_t AliSpectraBothEventCuts::CheckQVectorCut()
289{
290 if(fQVectorCutMin<0.0 && fQVectorCutMax<0.0)return kTRUE;
291 // Check qvector cut
292 /// FIXME: Q vector
293 // //Selection on QVector, before ANY other selection on the event
294 // //Spectra MUST be normalized wrt events AFTER the selection on Qvector
295 // Double_t Qx2EtaPos = 0, Qy2EtaPos = 0;
296 // Double_t Qx2EtaNeg = 0, Qy2EtaNeg = 0;
297
298 // Int_t multPos = 0;
299 // Int_t multNeg = 0;
300 // for(Int_t iT = 0; iT < fAOD->GetNumberOfTracks(); iT++) {
301 // AliAODTrack* aodTrack = fAOD->GetTrack(iT);
302 // if (!aodTrack->TestFilterBit(fTrackBits)) continue;
303 // if (aodTrack->Eta() >= 0){
304 // multPos++;
305 // Qx2EtaPos += TMath::Cos(2*aodTrack->Phi());
306 // Qy2EtaPos += TMath::Sin(2*aodTrack->Phi());
307 // } else {
308 // multNeg++;
309 // Qx2EtaNeg += TMath::Cos(2*aodTrack->Phi());
310 // Qy2EtaNeg += TMath::Sin(2*aodTrack->Phi());
311 // }
312 // }
313 // Double_t qPos=-999;
314 // if(multPos!=0)qPos= TMath::Sqrt((Qx2EtaPos*Qx2EtaPos + Qy2EtaPos*Qy2EtaPos)/multPos);
315 // Double_t qNeg=-999;
316 // if(multNeg!=0)qNeg= TMath::Sqrt((Qx2EtaNeg*Qx2EtaNeg + Qy2EtaNeg*Qy2EtaNeg)/multNeg);
317 //if(qPos<fQVectorPosCutMin || qPos>fQVectorPosCutMax || qNeg<fQVectorNegCutMin || qNeg>fQVectorNegCutMax)return kFALSE;
318
319 Double_t qxEPVZERO = 0, qyEPVZERO = 0;
320 Double_t qVZERO = -999;
321 Double_t psi=fAOD->GetEventplane()->CalculateVZEROEventPlane(fAOD,10,2,qxEPVZERO,qyEPVZERO);
322
323 qVZERO= TMath::Sqrt(qxEPVZERO*qxEPVZERO + qyEPVZERO*qyEPVZERO);
324 if(qVZERO<fQVectorCutMin || qVZERO>fQVectorCutMax)return kFALSE;
325 fHistoQVector->Fill(qVZERO);
326 fHistoEP->Fill(psi);
327
328 fHistoCuts->Fill(kQVector);
329 // fHistoQVectorPos->Fill(qPos);
330 // fHistoQVectorNeg->Fill(qNeg);
331 return kTRUE;
332}
333//____________________________________________________________
334 Bool_t AliSpectraBothEventCuts::CheckVtxChi2perNDF()
335 {
336 if(fMaxChi2perNDFforVertex<0)
337 return kTRUE;
338 const AliVVertex * vertex = fAOD->GetPrimaryVertex();
339 if(TMath::Abs(vertex->GetChi2perNDF())>fMaxChi2perNDFforVertex)
340 return kFALSE;
341 return kTRUE;
342 }
343
344
345
346//______________________________________________________
347void AliSpectraBothEventCuts::PrintCuts()
348{
349 // print info about event cuts
350 cout << "Event Stats" << endl;
351 cout << " > Number of accepted events: " << fHistoCuts->GetBinContent(kAcceptedEvents + 1) << endl;
352 cout << " > Number of processed events: " << fHistoCuts->GetBinContent(kProcessedEvents + 1) << endl;
353 cout << " > Number of PhysSel events: " << fHistoCuts->GetBinContent(kPhysSelEvents + 1) << endl;
354 cout << " > Vertex out of range: " << fHistoCuts->GetBinContent(kVtxRange + 1) << endl;
355 cout << " > Events cut by centrality: " << fHistoCuts->GetBinContent(kVtxCentral + 1) << endl;
356 cout << " > Events without vertex: " << fHistoCuts->GetBinContent(kVtxNoEvent + 1) << endl;
357 cout << " > QVector cut: " << fHistoCuts->GetBinContent(kQVector + 1) << endl;
358 cout << " > Track type used for the QVector calculation: " << fTrackBits << endl;
359 // cout << " > QPosRange: [" << fQVectorPosCutMin <<"," <<fQVectorPosCutMax<<"]"<< endl;
360 // cout << " > QNegRange: [" << fQVectorNegCutMin <<"," <<fQVectorNegCutMax<<"]"<< endl;
361 cout << " > QRange: [" << fQVectorCutMin <<"," <<fQVectorCutMax<<"]"<< endl;
362 cout << " > Vertex: [" << fVertexCutMin <<"," <<fVertexCutMax<<"]"<< endl;
363 cout << " > Multiplicity: [" << fMultiplicityCutMin <<"," <<fMultiplicityCutMax<<"]"<< endl;
364 cout << " > Centrality: [" << fCentralityCutMin <<"," <<fCentralityCutMax<<"]"<< endl;
365}
366//______________________________________________________
367
368Double_t AliSpectraBothEventCuts::ApplyCentralityPatchAOD049()
369{
370 //
371 //Apply centrality patch for AOD049 outliers
372 //
373 // if (fCentralityType!="V0M") {
374 // AliWarning("Requested patch forAOD049 for wrong value (not centrality from V0).");
375 // return -999.0;
376 // }
377 AliCentrality *centrality = fAOD->GetCentrality();
378 if (!centrality) {
379 AliWarning("Cannot get centrality from AOD event.");
380 return -999.0;
381 }
382
383 Float_t cent = (Float_t)(centrality->GetCentralityPercentile("V0M"));
384 /*
385 Bool_t isSelRun = kFALSE;
386 Int_t selRun[5] = {138364, 138826, 138828, 138836, 138871};
387 if(cent<0){
388 Int_t quality = centrality->GetQuality();
389 if(quality<=1){
390 cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
391 } else {
392 Int_t runnum=aodEvent->GetRunNumber();
393 for(Int_t ir=0;ir<5;ir++){
394 if(runnum==selRun[ir]){
395 isSelRun=kTRUE;
396 break;
397 }
398 }
399 if((quality==8||quality==9)&&isSelRun) cent=(Float_t)centrality->GetCentralityPercentileUnchecked("V0M");
400 }
401 }
402 */
403 if(cent>=0.0) {
404 Float_t v0 = 0.0;
405 AliAODEvent *aodEvent = (AliAODEvent *)fAOD;
406 AliAODVZERO *aodV0 = (AliAODVZERO *) aodEvent->GetVZEROData();
407 v0+=aodV0->GetMTotV0A();
408 v0+=aodV0->GetMTotV0C();
409 if ( (cent==0) && (v0<19500) ) {
410 AliDebug(3, Form("Filtering issue in centrality -> cent = %5.2f",cent));
411 return -999.0;
412 }
413 Float_t tkl = (Float_t)(aodEvent->GetTracklets()->GetNumberOfTracklets());
414 Float_t val = 1.30552 + 0.147931 * v0;
415
416 Float_t tklSigma[101] = {176.644, 156.401, 153.789, 153.015, 142.476, 137.951, 136.127, 129.852, 127.436, 124.86,
417 120.788, 115.611, 113.172, 110.496, 109.127, 104.421, 102.479, 99.9766, 97.5152, 94.0654,
418 92.4602, 89.3364, 87.1342, 83.3497, 82.6216, 81.1084, 78.0793, 76.1234, 72.9434, 72.1334,
419 68.0056, 68.2755, 66.0376, 62.9666, 62.4274, 59.65, 58.3776, 56.6361, 54.5184, 53.4224,
420 51.932, 50.8922, 48.2848, 47.912, 46.5717, 43.4114, 43.2083, 41.3065, 40.1863, 38.5255,
421 37.2851, 37.5396, 34.4949, 33.8366, 31.8043, 31.7412, 30.8392, 30.0274, 28.8793, 27.6398,
422 26.6488, 25.0183, 25.1489, 24.4185, 22.9107, 21.2002, 21.6977, 20.1242, 20.4963, 19.0235,
423 19.298, 17.4103, 16.868, 15.2939, 15.2939, 16.0295, 14.186, 14.186, 15.2173, 12.9504, 12.9504,
424 12.9504, 15.264, 12.3674, 12.3674, 12.3674, 12.3674, 12.3674, 18.3811, 13.7544, 13.7544,
425 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544, 13.7544
426 };
427
428 if ( TMath::Abs(tkl-val) > 6.*tklSigma[(Int_t)cent] ) {
429 AliDebug(3, Form("Outlier event in centrality -> cent = %5.2f",cent));
430 return -999.0;
431 }
432 } else {
433 //force it to be -999. whatever the negative value was
434 cent = -999.;
435 }
436 return cent;
437}
438
439//______________________________________________________
440
441
442Long64_t AliSpectraBothEventCuts::Merge(TCollection* list)
443{
444 // Merge a list of AliSpectraBothEventCuts objects with this.
445 // Returns the number of merged objects (including this).
446
447 // AliInfo("Merging");
448
449 if (!list)
450 return 0;
451
452 if (list->IsEmpty())
453 return 1;
454
455 TIterator* iter = list->MakeIterator();
456 TObject* obj;
457
458 // collections of all histograms
459 TList collections;//FIXME we should use only 1 collection
460 TList collections_histoVtxBefSel;
461 TList collections_histoVtxAftSel;
462 TList collections_histoEtaBefSel;
463 TList collections_histoEtaAftSel;
464 TList collections_histoNChAftSel;
465 // TList collections_histoQVectorPos;
466 // TList collections_histoQVectorNeg;
467 TList collections_histoQVector;
468 TList collections_histoEP;
3a71f081 469 TList collections_histoVtxAftSelwithoutZvertexCut;
470 TList collections_histoVtxalltriggerEventswithMCz;
471 TList collections_histoVtxAftSelwithoutZvertexCutusingMCz;
239a080a 472
473 Int_t count = 0;
474
475 while ((obj = iter->Next())) {
476 AliSpectraBothEventCuts* entry = dynamic_cast<AliSpectraBothEventCuts*> (obj);
477 if (entry == 0)
478 continue;
479
480 TH1I * histo = entry->GetHistoCuts();
481 collections.Add(histo);
482 TH1F * histo_histoVtxBefSel = entry->GetHistoVtxBefSel();
483 collections_histoVtxBefSel.Add(histo_histoVtxBefSel);
484 TH1F * histo_histoVtxAftSel = entry->GetHistoVtxAftSel();
485 collections_histoVtxAftSel.Add(histo_histoVtxAftSel);
486 TH1F * histo_histoEtaBefSel = entry->GetHistoEtaBefSel();
487 collections_histoEtaBefSel.Add(histo_histoEtaBefSel);
488 TH1F * histo_histoEtaAftSel = entry->GetHistoEtaAftSel();
489 collections_histoEtaAftSel.Add(histo_histoEtaAftSel);
490 TH1F * histo_histoNChAftSel = entry->GetHistoNChAftSel();
491 collections_histoNChAftSel.Add(histo_histoNChAftSel);
492 // TH1F * histo_histoQVectorPos = entry->GetHistoQVectorPos();
493 // collections_histoQVectorPos.Add(histo_histoQVectorPos);
494 // TH1F * histo_histoQVectorNeg = entry->GetHistoQVectorNeg();
495 // collections_histoQVectorNeg.Add(histo_histoQVectorNeg);
496 TH1F * histo_histoQVector = entry->GetHistoQVector();
497 collections_histoQVector.Add(histo_histoQVector);
498 TH1F * histo_histoEP = entry->GetHistoEP();
499 collections_histoEP.Add(histo_histoEP);
3a71f081 500 TH1F* histo_histoVtxAftSelwithoutZvertexCut=entry->GetHistoVtxAftSelwithoutZvertexCut();
501 collections_histoVtxAftSelwithoutZvertexCut.Add(histo_histoVtxAftSelwithoutZvertexCut);
502 TH1F* histo_histoVtxalltriggerEventswithMCz=entry->GetHistoVtxGenerated();
503 collections_histoVtxalltriggerEventswithMCz.Add(histo_histoVtxalltriggerEventswithMCz);
504 TH1F* histo_histoVtxAftSelwithoutZvertexCutusingMCz=entry->GetHistoVtxAftSelwithoutZvertexCutusingMCz();
505 collections_histoVtxAftSelwithoutZvertexCutusingMCz.Add(histo_histoVtxAftSelwithoutZvertexCutusingMCz);
506
239a080a 507 count++;
508 }
509
510 fHistoCuts->Merge(&collections);
511 fHistoVtxBefSel->Merge(&collections_histoVtxBefSel);
512 fHistoVtxAftSel->Merge(&collections_histoVtxAftSel);
513 fHistoEtaBefSel->Merge(&collections_histoEtaBefSel);
514 fHistoEtaAftSel->Merge(&collections_histoEtaAftSel);
515 fHistoNChAftSel->Merge(&collections_histoNChAftSel);
516 // fHistoQVectorPos->Merge(&collections_histoQVectorPos);
517 // fHistoQVectorNeg->Merge(&collections_histoQVectorNeg);
518 fHistoQVector->Merge(&collections_histoQVector);
519 fHistoEP->Merge(&collections_histoEP);
3a71f081 520
521 fHistoVtxAftSelwithoutZvertexCut->Merge(&collections_histoVtxAftSelwithoutZvertexCut);
522 fHistoVtxalltriggerEventswithMCz->Merge(&collections_histoVtxalltriggerEventswithMCz);
523 fHistoVtxAftSelwithoutZvertexCutusingMCz->Merge(&collections_histoVtxAftSelwithoutZvertexCutusingMCz);
524
239a080a 525
526 delete iter;
527
528 return count+1;
529}
530