]>
Commit | Line | Data |
---|---|---|
c88234ad | 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 | // AliSpectraAODEventCuts class | |
19 | //----------------------------------------------------------------- | |
20 | ||
21 | #include "TChain.h" | |
22 | #include "TTree.h" | |
23 | #include "TLegend.h" | |
24 | #include "TH1F.h" | |
829b5a81 | 25 | #include "TH1I.h" |
c88234ad | 26 | #include "TH2F.h" |
27 | #include "TCanvas.h" | |
93db93de | 28 | #include "TProfile.h" |
c88234ad | 29 | #include "AliAnalysisTask.h" |
30 | #include "AliAnalysisManager.h" | |
31 | #include "AliAODTrack.h" | |
32 | #include "AliAODMCParticle.h" | |
33 | #include "AliAODEvent.h" | |
34 | #include "AliAODInputHandler.h" | |
35 | #include "AliAnalysisTaskESDfilter.h" | |
36 | #include "AliAnalysisDataContainer.h" | |
93db93de | 37 | #include "AliESDVZERO.h" |
38 | #include "AliAODVZERO.h" | |
c88234ad | 39 | #include "AliSpectraAODEventCuts.h" |
f6a38178 | 40 | #include "AliSpectraAODTrackCuts.h" |
c88234ad | 41 | #include <iostream> |
42 | ||
43 | using namespace std; | |
44 | ||
45 | ClassImp(AliSpectraAODEventCuts) | |
46 | ||
93db93de | 47 | AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : |
48 | TNamed(name, "AOD Event Cuts"), | |
49 | fAOD(0), | |
50 | fSelectBit(AliVEvent::kMB), | |
51 | fCentralityMethod("V0M"), | |
52 | fTrackBits(1), | |
53 | fIsMC(0), | |
48c4d28e | 54 | fIsLHC10h(1), |
93db93de | 55 | fTrackCuts(0), |
56 | fIsSelected(0), | |
57 | fCentralityCutMin(0.), | |
58 | fCentralityCutMax(999), | |
59 | fQVectorCutMin(-999.), | |
60 | fQVectorCutMax(999.), | |
a162b3e2 | 61 | fVertexCutMin(-10.), |
62 | fVertexCutMax(10.), | |
93db93de | 63 | fMultiplicityCutMin(-999.), |
64 | fMultiplicityCutMax(99999.), | |
48c4d28e | 65 | fqV0C(-999.), |
66 | fqV0A(-999.), | |
67 | fCent(-999.), | |
93db93de | 68 | fOutput(0), |
69 | fCalib(0), | |
70 | fRun(-1), | |
71 | fMultV0(0), | |
72 | fV0Cpol1(-1), | |
73 | fV0Cpol2(-1), | |
74 | fV0Cpol3(-1), | |
75 | fV0Cpol4(-1), | |
76 | fV0Apol1(-1), | |
77 | fV0Apol2(-1), | |
78 | fV0Apol3(-1), | |
79 | fV0Apol4(-1) | |
c88234ad | 80 | { |
f6a38178 | 81 | // Constructor |
93db93de | 82 | fOutput=new TList(); |
83 | fOutput->SetOwner(); | |
84 | fOutput->SetName("fOutput"); | |
85 | ||
86 | fCalib=new TList(); | |
87 | fCalib->SetOwner(); | |
88 | fCalib->SetName("fCalib"); | |
89 | ||
90 | TH1I *fHistoCuts = new TH1I("fHistoCuts", "Event Cuts", kNVtxCuts, -0.5, kNVtxCuts - 0.5); | |
23f51e78 | 91 | TH1F *fHistoVtxBefSel = new TH1F("fHistoVtxBefSel", "Vtx distr before event selection;z (cm)",500,-15,15); |
92 | TH1F *fHistoVtxAftSel = new TH1F("fHistoVtxAftSel", "Vtx distr after event selection;z (cm)",500,-15,15); | |
93 | TH1F *fHistoEtaBefSel = new TH1F("fHistoEtaBefSel", "Eta distr before event selection;eta",500,-2,2); | |
94 | TH1F *fHistoEtaAftSel = new TH1F("fHistoEtaAftSel", "Eta distr after event selection;eta",500,-2,2); | |
95 | TH1F *fHistoNChAftSel = new TH1F("fHistoNChAftSel", "NCh distr after event selection;Nch",2000,-0.5,1999.5); | |
96 | TH2F *fHistoQVector = new TH2F("fHistoQVector", "QVector with VZERO distribution;centrality;Q vector from EP task",20,0,100,100,0,10); | |
97 | TH2F *fHistoEP = new TH2F("fHistoEP", "EP with VZERO distribution;centrality;Psi_{EP} from EP task",20,0,100,100,-2,2); | |
98 | TH2F *fPsiACor = new TH2F("fPsiACor", "EP with VZERO A distribution;centrality;Psi_{EP} VZERO-A",20,0,100,100,-2,2); | |
99 | TH2F *fPsiCCor = new TH2F("fPsiCCor", "EP with VZERO C distribution;centrality;Psi_{EP} VZERO-C",20,0,100,100,-2,2); | |
100 | TH2F *fQVecACor = new TH2F("fQVecACor", "QVec VZERO A;centrality;Qvector VZERO-A",20,0,100,100,0,10); | |
101 | TH2F *fQVecCCor = new TH2F("fQVecCCor", "QVec VZERO C;centrality;Qvector VZERO-C",20,0,100,100,0,10); | |
102 | TH2F *fV0M = new TH2F("fV0M", "V0 Multiplicity, before correction;V0 sector",64,-.5,63.5,500,0,1000); | |
103 | TH2F *fV0MCor = new TH2F("fV0MCor", "V0 Multiplicity, after correction;V0 sector",64,-.5,63.5,500,0,1000); | |
93db93de | 104 | |
105 | fOutput->Add(fHistoCuts); | |
106 | fOutput->Add(fHistoVtxBefSel); | |
107 | fOutput->Add(fHistoVtxAftSel); | |
108 | fOutput->Add(fHistoEtaBefSel); | |
109 | fOutput->Add(fHistoEtaAftSel); | |
110 | fOutput->Add(fHistoNChAftSel); | |
111 | fOutput->Add(fHistoQVector); | |
112 | fOutput->Add(fHistoEP); | |
113 | fOutput->Add(fPsiACor); | |
114 | fOutput->Add(fPsiCCor); | |
115 | fOutput->Add(fQVecACor); | |
116 | fOutput->Add(fQVecCCor); | |
23f51e78 | 117 | fOutput->Add(fV0M); |
118 | fOutput->Add(fV0MCor); | |
93db93de | 119 | |
120 | for (Int_t i = 0; i<10; i++){ | |
121 | fMeanQxa2[i] = -1; | |
122 | fMeanQya2[i] = -1; | |
123 | fMeanQxc2[i] = -1; | |
124 | fMeanQyc2[i] = -1; | |
125 | } | |
c88234ad | 126 | } |
127 | ||
128 | //______________________________________________________ | |
f6a38178 | 129 | Bool_t AliSpectraAODEventCuts::IsSelected(AliAODEvent * aod,AliSpectraAODTrackCuts *trackcuts) |
c88234ad | 130 | { |
f6a38178 | 131 | // Returns true if Event Cuts are selected and applied |
132 | fAOD = aod; | |
133 | fTrackCuts = trackcuts; | |
93db93de | 134 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kProcessedEvents); |
135 | Bool_t IsPhysSel = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & fSelectBit); | |
decf69d9 | 136 | if(!IsPhysSel)return IsPhysSel; |
93db93de | 137 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kPhysSelEvents); |
f6a38178 | 138 | //loop on tracks, before event selection, filling QA histos |
139 | AliAODVertex * vertex = fAOD->GetPrimaryVertex();//FIXME vertex is recreated | |
93db93de | 140 | if(vertex)((TH1F*)fOutput->FindObject("fHistoVtxBefSel"))->Fill(vertex->GetZ()); |
decf69d9 | 141 | fIsSelected =kFALSE; |
10a8ccbe | 142 | if(CheckVtxRange() && CheckCentralityCut() && CheckMultiplicityCut()){ //selection on vertex and Centrality |
00493191 | 143 | fIsSelected=CheckQVectorCut(); // QVector is calculated only if the centrality and vertex are correct (performance) |
decf69d9 | 144 | } |
f6a38178 | 145 | if(fIsSelected){ |
93db93de | 146 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kAcceptedEvents); |
147 | if(vertex)((TH1F*)fOutput->FindObject("fHistoVtxAftSel"))->Fill(vertex->GetZ()); | |
f6a38178 | 148 | } |
ae0fdd7d | 149 | Int_t Nch=0; |
f6a38178 | 150 | for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) { |
151 | AliAODTrack* track = fAOD->GetTrack(iTracks); | |
decf69d9 | 152 | if (!fTrackCuts->IsSelected(track,kFALSE)) continue; |
93db93de | 153 | ((TH1F*)fOutput->FindObject("fHistoEtaBefSel"))->Fill(track->Eta()); |
ae0fdd7d | 154 | if(fIsSelected){ |
93db93de | 155 | ((TH1F*)fOutput->FindObject("fHistoEtaAftSel"))->Fill(track->Eta()); |
ae0fdd7d | 156 | Nch++; |
157 | } | |
f6a38178 | 158 | } |
93db93de | 159 | if(fIsSelected)((TH1F*)fOutput->FindObject("fHistoNChAftSel"))->Fill(Nch); |
f6a38178 | 160 | return fIsSelected; |
c88234ad | 161 | } |
162 | ||
163 | //______________________________________________________ | |
164 | Bool_t AliSpectraAODEventCuts::CheckVtxRange() | |
165 | { | |
166 | // reject events outside of range | |
f6a38178 | 167 | AliAODVertex * vertex = fAOD->GetPrimaryVertex(); |
264de30e | 168 | //when moving to 2011 wìone has to add a cut using SPD vertex. |
169 | //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 | |
f6a38178 | 170 | if (!vertex) |
171 | { | |
93db93de | 172 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kVtxNoEvent); |
c88234ad | 173 | return kFALSE; |
f6a38178 | 174 | } |
10a8ccbe | 175 | if (vertex->GetZ() > fVertexCutMin && vertex->GetZ() < fVertexCutMax) |
f6a38178 | 176 | { |
c88234ad | 177 | return kTRUE; |
f6a38178 | 178 | } |
93db93de | 179 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kVtxRange); |
f6a38178 | 180 | return kFALSE; |
c88234ad | 181 | } |
182 | ||
183 | //______________________________________________________ | |
184 | Bool_t AliSpectraAODEventCuts::CheckCentralityCut() | |
185 | { | |
f6a38178 | 186 | // Check centrality cut |
48c4d28e | 187 | fCent=-999.; |
188 | fCent=fAOD->GetCentrality()->GetCentralityPercentile(fCentralityMethod.Data()); | |
189 | if ( (fCent <= fCentralityCutMax) && (fCent >= fCentralityCutMin) ) return kTRUE; | |
93db93de | 190 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kVtxCentral); |
f6a38178 | 191 | return kFALSE; |
c88234ad | 192 | } |
193 | ||
10a8ccbe | 194 | //______________________________________________________ |
195 | Bool_t AliSpectraAODEventCuts::CheckMultiplicityCut() | |
196 | { | |
197 | // Check multiplicity cut | |
198 | Int_t Ncharged=0; | |
199 | for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++){ | |
200 | AliAODTrack* track = fAOD->GetTrack(iTracks); | |
201 | if (!fTrackCuts->IsSelected(track,kFALSE)) continue; | |
202 | Ncharged++; | |
203 | } | |
10a8ccbe | 204 | if(Ncharged>fMultiplicityCutMin && Ncharged<fMultiplicityCutMax)return kTRUE; |
205 | ||
206 | return kFALSE; | |
207 | } | |
208 | ||
decf69d9 | 209 | //______________________________________________________ |
210 | Bool_t AliSpectraAODEventCuts::CheckQVectorCut() | |
23f51e78 | 211 | { |
48c4d28e | 212 | Double_t qxEPVZERO = -999., qyEPVZERO = -999.; |
93db93de | 213 | Double_t qVZERO = CalculateQVectorLHC10h(); |
214 | Double_t psi=fAOD->GetEventplane()->CalculateVZEROEventPlane(fAOD,10,2,qxEPVZERO,qyEPVZERO);//FIXME we can a flag for 2010 and 2011 | |
16ee3540 | 215 | qVZERO= TMath::Sqrt(qxEPVZERO*qxEPVZERO + qyEPVZERO*qyEPVZERO); |
216 | if(qVZERO<fQVectorCutMin || qVZERO>fQVectorCutMax)return kFALSE; | |
23f51e78 | 217 | Double_t cent=fAOD->GetCentrality()->GetCentralityPercentile(fCentralityMethod.Data()); |
218 | ((TH2F*)fOutput->FindObject("fHistoQVector"))->Fill(cent,qVZERO); | |
219 | ((TH2F*)fOutput->FindObject("fHistoEP"))->Fill(cent,psi); | |
93db93de | 220 | ((TH1I*)fOutput->FindObject("fHistoCuts"))->Fill(kQVector); |
23f51e78 | 221 | |
decf69d9 | 222 | return kTRUE; |
decf69d9 | 223 | } |
224 | ||
93db93de | 225 | //______________________________________________________ |
226 | ||
227 | ||
228 | Double_t AliSpectraAODEventCuts::CalculateQVectorLHC10h(){ | |
229 | ||
230 | Int_t run = fAOD->GetRunNumber(); | |
231 | if(run != fRun){ | |
232 | // Load the calibrations run dependent | |
233 | if(OpenInfoCalbration(run))fRun=run; | |
48c4d28e | 234 | else{ |
235 | fqV0C=-999.; | |
236 | fqV0A=-999.; | |
237 | return -999.; | |
238 | } | |
93db93de | 239 | } |
240 | ||
241 | //V0 info | |
242 | Double_t Qxa2 = 0, Qya2 = 0; | |
243 | Double_t Qxc2 = 0, Qyc2 = 0; | |
244 | Double_t sumMc = 0, sumMa = 0; | |
245 | ||
246 | AliAODVZERO* aodV0 = fAOD->GetVZEROData(); | |
247 | ||
248 | for (Int_t iv0 = 0; iv0 < 64; iv0++) { | |
249 | ||
250 | Double_t phiV0 = TMath::PiOver4()*(0.5 + iv0 % 8); | |
251 | ||
252 | Float_t multv0 = aodV0->GetMultiplicity(iv0); | |
23f51e78 | 253 | ((TH2F*)fOutput->FindObject("fV0M"))->Fill(iv0,multv0); |
254 | ||
93db93de | 255 | if (iv0 < 32){ |
256 | ||
257 | Double_t multCorC = -10; | |
258 | ||
259 | if (iv0 < 8) | |
260 | multCorC = multv0*fV0Cpol1/fMultV0->GetBinContent(iv0+1); | |
261 | else if (iv0 >= 8 && iv0 < 16) | |
262 | multCorC = multv0*fV0Cpol2/fMultV0->GetBinContent(iv0+1); | |
263 | else if (iv0 >= 16 && iv0 < 24) | |
264 | multCorC = multv0*fV0Cpol3/fMultV0->GetBinContent(iv0+1); | |
265 | else if (iv0 >= 24 && iv0 < 32) | |
266 | multCorC = multv0*fV0Cpol4/fMultV0->GetBinContent(iv0+1); | |
267 | ||
268 | if (multCorC < 0){ | |
269 | cout<<"Problem with multiplicity in V0C"<<endl; | |
48c4d28e | 270 | fqV0C=-999.; |
271 | fqV0A=-999.; | |
272 | return -999.; | |
93db93de | 273 | } |
274 | ||
275 | Qxc2 += TMath::Cos(2*phiV0) * multCorC; | |
276 | Qyc2 += TMath::Sin(2*phiV0) * multCorC; | |
277 | ||
278 | sumMc += multCorC; | |
23f51e78 | 279 | ((TH2F*)fOutput->FindObject("fV0MCor"))->Fill(iv0,multCorC); |
93db93de | 280 | |
281 | } else { | |
282 | ||
283 | Double_t multCorA = -10; | |
284 | ||
285 | if (iv0 >= 32 && iv0 < 40) | |
286 | multCorA = multv0*fV0Apol1/fMultV0->GetBinContent(iv0+1); | |
287 | else if (iv0 >= 40 && iv0 < 48) | |
288 | multCorA = multv0*fV0Apol2/fMultV0->GetBinContent(iv0+1); | |
289 | else if (iv0 >= 48 && iv0 < 56) | |
290 | multCorA = multv0*fV0Apol3/fMultV0->GetBinContent(iv0+1); | |
291 | else if (iv0 >= 56 && iv0 < 64) | |
292 | multCorA = multv0*fV0Apol4/fMultV0->GetBinContent(iv0+1); | |
293 | ||
294 | if (multCorA < 0){ | |
295 | cout<<"Problem with multiplicity in V0A"<<endl; | |
48c4d28e | 296 | fqV0C=-999.; |
297 | fqV0A=-999.; | |
298 | return -999.; | |
93db93de | 299 | } |
300 | ||
301 | Qxa2 += TMath::Cos(2*phiV0) * multCorA; | |
302 | Qya2 += TMath::Sin(2*phiV0) * multCorA; | |
303 | ||
304 | sumMa += multCorA; | |
23f51e78 | 305 | ((TH2F*)fOutput->FindObject("fV0MCor"))->Fill(iv0,multCorA); |
306 | ||
93db93de | 307 | } |
308 | } | |
309 | ||
310 | Short_t centrV0 = GetCentrCode(fAOD); | |
311 | ||
6a6d2363 | 312 | Double_t Qxamean2 = 0.; |
313 | Double_t Qyamean2 = 0.; | |
314 | Double_t Qxcmean2 = 0.; | |
315 | Double_t Qycmean2 = 0.; | |
316 | ||
317 | if(centrV0!=-1){ | |
318 | Qxamean2 = fMeanQxa2[centrV0]; | |
319 | Qyamean2 = fMeanQya2[centrV0]; | |
320 | Qxcmean2 = fMeanQxc2[centrV0]; | |
321 | Qycmean2 = fMeanQyc2[centrV0]; | |
322 | } | |
93db93de | 323 | |
324 | Double_t QxaCor2 = Qxa2 - Qxamean2*sumMa; | |
325 | Double_t QyaCor2 = Qya2 - Qyamean2*sumMa; | |
326 | Double_t QxcCor2 = Qxc2 - Qxcmean2*sumMc; | |
327 | Double_t QycCor2 = Qyc2 - Qycmean2*sumMc; | |
328 | ||
329 | Double_t evPlAngV0ACor2 = TMath::ATan2(QyaCor2, QxaCor2)/2.; | |
330 | Double_t evPlAngV0CCor2 = TMath::ATan2(QycCor2, QxcCor2)/2.; | |
331 | ||
332 | ((TH2F*)fOutput->FindObject("fPsiACor"))->Fill((Float_t)fAOD->GetCentrality()->GetCentralityPercentile("V0M"), evPlAngV0ACor2); | |
333 | ((TH2F*)fOutput->FindObject("fPsiCCor"))->Fill((Float_t)fAOD->GetCentrality()->GetCentralityPercentile("V0M"), evPlAngV0CCor2); | |
93db93de | 334 | |
48c4d28e | 335 | fqV0C = TMath::Sqrt((QxcCor2*QxcCor2 + QycCor2*QycCor2)/sumMc); |
336 | fqV0A = TMath::Sqrt((QxaCor2*QxaCor2 + QyaCor2*QyaCor2)/sumMa); | |
337 | ||
338 | ((TH2F*)fOutput->FindObject("fQVecACor"))->Fill((Float_t)fAOD->GetCentrality()->GetCentralityPercentile("V0M"), fqV0A); | |
339 | ((TH2F*)fOutput->FindObject("fQVecCCor"))->Fill((Float_t)fAOD->GetCentrality()->GetCentralityPercentile("V0M"), fqV0C); | |
93db93de | 340 | |
341 | return -999; | |
342 | } | |
343 | ||
344 | ||
345 | ||
346 | ||
347 | //_____________________________________________________________________________ | |
348 | Short_t AliSpectraAODEventCuts::GetCentrCode(AliVEvent* ev) | |
349 | { | |
350 | ||
351 | Short_t centrCode = -1; | |
352 | ||
353 | AliCentrality* centrality = 0; | |
354 | AliAODEvent* aod = (AliAODEvent*)ev; | |
355 | centrality = aod->GetHeader()->GetCentralityP(); | |
356 | ||
357 | Float_t centV0 = centrality->GetCentralityPercentile("V0M"); | |
358 | Float_t centTrk = centrality->GetCentralityPercentile("TRK"); | |
359 | ||
360 | ||
361 | if (TMath::Abs(centV0 - centTrk) < 5.0 && centV0 <= 80 && centV0 > 0){ | |
362 | ||
363 | if ((centV0 > 0) && (centV0 <= 5.0)) | |
364 | centrCode = 0; | |
365 | else if ((centV0 > 5.0) && (centV0 <= 10.0)) | |
366 | centrCode = 1; | |
367 | else if ((centV0 > 10.0) && (centV0 <= 20.0)) | |
368 | centrCode = 2; | |
369 | else if ((centV0 > 20.0) && (centV0 <= 30.0)) | |
370 | centrCode = 3; | |
371 | else if ((centV0 > 30.0) && (centV0 <= 40.0)) | |
372 | centrCode = 4; | |
373 | else if ((centV0 > 40.0) && (centV0 <= 50.0)) | |
374 | centrCode = 5; | |
375 | else if ((centV0 > 50.0) && (centV0 <= 60.0)) | |
376 | centrCode = 6; | |
377 | else if ((centV0 > 60.0) && (centV0 <= 70.0)) | |
378 | centrCode = 7; | |
379 | else if ((centV0 > 70.0) && (centV0 <= 80.0)) | |
380 | centrCode = 8; | |
381 | } | |
382 | ||
383 | return centrCode; | |
384 | ||
385 | } | |
386 | ||
c88234ad | 387 | //______________________________________________________ |
388 | void AliSpectraAODEventCuts::PrintCuts() | |
389 | { | |
f6a38178 | 390 | // print info about event cuts |
391 | cout << "Event Stats" << endl; | |
93db93de | 392 | cout << " > Trigger Selection: " << fSelectBit << endl; |
393 | cout << " > Centrality estimator: " << fCentralityMethod << endl; | |
394 | cout << " > Number of accepted events: " << NumberOfEvents() << endl; | |
395 | cout << " > Number of processed events: " << NumberOfProcessedEvents() << endl; | |
396 | cout << " > Number of PhysSel events: " << NumberOfPhysSelEvents() << endl; | |
397 | cout << " > Vertex out of range: " << ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kVtxRange + 1) << endl; | |
398 | cout << " > Events cut by centrality: " << ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kVtxCentral + 1) << endl; | |
399 | cout << " > Events without vertex: " << ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kVtxNoEvent + 1) << endl; | |
400 | cout << " > QVector cut: " << ((TH1I*)fOutput->FindObject("fHistoCuts"))->GetBinContent(kQVector + 1) << endl; | |
829b5a81 | 401 | cout << " > Track type used for the QVector calculation: " << fTrackBits << endl; |
16ee3540 | 402 | cout << " > QRange: [" << fQVectorCutMin <<"," <<fQVectorCutMax<<"]"<< endl; |
10a8ccbe | 403 | cout << " > Vertex: [" << fVertexCutMin <<"," <<fVertexCutMax<<"]"<< endl; |
404 | cout << " > Multiplicity: [" << fMultiplicityCutMin <<"," <<fMultiplicityCutMax<<"]"<< endl; | |
829b5a81 | 405 | cout << " > Centrality: [" << fCentralityCutMin <<"," <<fCentralityCutMax<<"]"<< endl; |
f6a38178 | 406 | } |
c88234ad | 407 | |
93db93de | 408 | |
409 | //_____________________________________________________________________________ | |
410 | Bool_t AliSpectraAODEventCuts::OpenInfoCalbration(Int_t run) | |
972a21ad | 411 | { |
93db93de | 412 | |
413 | AliOADBContainer* cont = (AliOADBContainer*) fCalib->FindObject("hMultV0BefCorr"); | |
414 | if(!cont){ | |
415 | printf("OADB object hMultV0BefCorr is not available in the file\n"); | |
416 | return 0; | |
417 | } | |
418 | ||
419 | if(!(cont->GetObject(run))){ | |
420 | printf("OADB object hMultV0BefCorr is not available for run %i\n",run); | |
421 | return 0; | |
422 | } | |
423 | fMultV0 = ((TH2F*) cont->GetObject(run))->ProfileX(); | |
424 | ||
425 | TF1* fpolc1 = new TF1("fpolc1","pol0", 0, 7); | |
426 | fMultV0->Fit(fpolc1, "RN"); | |
427 | fV0Cpol1 = fpolc1->GetParameter(0); | |
428 | ||
429 | TF1* fpolc2 = new TF1("fpolc2","pol0", 8, 15); | |
430 | fMultV0->Fit(fpolc2, "RN"); | |
431 | fV0Cpol2 = fpolc2->GetParameter(0); | |
432 | ||
433 | TF1* fpolc3 = new TF1("fpolc3","pol0", 16, 23); | |
434 | fMultV0->Fit(fpolc3, "RN"); | |
435 | fV0Cpol3 = fpolc3->GetParameter(0); | |
436 | ||
437 | TF1* fpolc4 = new TF1("fpolc4","pol0", 24, 31); | |
438 | fMultV0->Fit(fpolc4, "RN"); | |
439 | fV0Cpol4 = fpolc4->GetParameter(0); | |
440 | ||
441 | TF1* fpola1 = new TF1("fpola1","pol0", 32, 39); | |
6a6d2363 | 442 | fMultV0->Fit(fpola1, "RN"); |
93db93de | 443 | fV0Apol1 = fpola1->GetParameter(0); |
444 | ||
445 | TF1* fpola2 = new TF1("fpola2","pol0", 40, 47); | |
446 | fMultV0->Fit(fpola2, "RN"); | |
447 | fV0Apol2 = fpola2->GetParameter(0); | |
a162b3e2 | 448 | |
93db93de | 449 | TF1* fpola3 = new TF1("fpola3","pol0", 48, 55); |
450 | fMultV0->Fit(fpola3, "RN"); | |
451 | fV0Apol3 = fpola3->GetParameter(0); | |
452 | ||
453 | TF1* fpola4 = new TF1("fpola4","pol0", 56, 63); | |
454 | fMultV0->Fit(fpola4, "RN"); | |
455 | fV0Apol4 = fpola4->GetParameter(0); | |
456 | ||
93db93de | 457 | for(Int_t i=0; i < 10; i++){ |
458 | ||
459 | char nameQxa2[100]; | |
6a6d2363 | 460 | snprintf(nameQxa2,100, "hQxa2m_%i", i); |
93db93de | 461 | |
462 | char nameQya2[100]; | |
6a6d2363 | 463 | snprintf(nameQya2,100, "hQya2m_%i", i); |
93db93de | 464 | |
465 | char nameQxc2[100]; | |
6a6d2363 | 466 | snprintf(nameQxc2,100, "hQxc2m_%i", i); |
93db93de | 467 | |
468 | char nameQyc2[100]; | |
6a6d2363 | 469 | snprintf(nameQyc2,100, "hQyc2m_%i", i); |
93db93de | 470 | |
471 | AliOADBContainer* contQxa2 = (AliOADBContainer*) fCalib->FindObject(nameQxa2); | |
472 | if(!contQxa2){ | |
473 | printf("OADB object %s is not available in the file\n", nameQxa2); | |
474 | return 0; | |
475 | } | |
476 | ||
477 | if(!(contQxa2->GetObject(run))){ | |
478 | printf("OADB object %s is not available for run %i\n", nameQxa2, run); | |
479 | return 0; | |
480 | } | |
481 | ||
482 | fMeanQxa2[i] = ((TH1F*) contQxa2->GetObject(run))->GetMean(); | |
483 | ||
484 | ||
485 | AliOADBContainer* contQya2 = (AliOADBContainer*) fCalib->FindObject(nameQya2); | |
486 | if(!contQya2){ | |
487 | printf("OADB object %s is not available in the file\n", nameQya2); | |
488 | return 0; | |
489 | } | |
490 | ||
491 | if(!(contQya2->GetObject(run))){ | |
492 | printf("OADB object %s is not available for run %i\n", nameQya2, run); | |
493 | return 0; | |
494 | } | |
495 | ||
496 | fMeanQya2[i] = ((TH1F*) contQya2->GetObject(run))->GetMean(); | |
497 | ||
498 | ||
499 | AliOADBContainer* contQxc2 = (AliOADBContainer*) fCalib->FindObject(nameQxc2); | |
500 | if(!contQxc2){ | |
501 | printf("OADB object %s is not available in the file\n", nameQxc2); | |
502 | return 0; | |
503 | } | |
504 | ||
505 | if(!(contQxc2->GetObject(run))){ | |
506 | printf("OADB object %s is not available for run %i\n", nameQxc2, run); | |
507 | return 0; | |
508 | } | |
509 | ||
510 | fMeanQxc2[i] = ((TH1F*) contQxc2->GetObject(run))->GetMean(); | |
511 | ||
512 | ||
513 | AliOADBContainer* contQyc2 = (AliOADBContainer*) fCalib->FindObject(nameQyc2); | |
514 | if(!contQyc2){ | |
515 | printf("OADB object %s is not available in the file\n", nameQyc2); | |
516 | return 0; | |
517 | } | |
518 | ||
519 | if(!(contQyc2->GetObject(run))){ | |
520 | printf("OADB object %s is not available for run %i\n", nameQyc2, run); | |
521 | return 0; | |
522 | } | |
523 | ||
524 | fMeanQyc2[i] = ((TH1F*) contQyc2->GetObject(run))->GetMean(); | |
525 | ||
526 | } | |
527 | return 1; | |
972a21ad | 528 | } |
529 | ||
93db93de | 530 | |
972a21ad | 531 | //______________________________________________________ |
532 | ||
533 | ||
c88234ad | 534 | Long64_t AliSpectraAODEventCuts::Merge(TCollection* list) |
535 | { | |
536 | // Merge a list of AliSpectraAODEventCuts objects with this. | |
537 | // Returns the number of merged objects (including this). | |
93db93de | 538 | |
539 | AliInfo("Merging"); | |
540 | ||
c88234ad | 541 | if (!list) |
542 | return 0; | |
543 | ||
544 | if (list->IsEmpty()) | |
545 | return 1; | |
93db93de | 546 | |
c88234ad | 547 | TIterator* iter = list->MakeIterator(); |
548 | TObject* obj; | |
93db93de | 549 | |
c88234ad | 550 | // collections of all histograms |
93db93de | 551 | TList collections; |
552 | ||
c88234ad | 553 | Int_t count = 0; |
554 | ||
555 | while ((obj = iter->Next())) { | |
556 | AliSpectraAODEventCuts* entry = dynamic_cast<AliSpectraAODEventCuts*> (obj); | |
557 | if (entry == 0) | |
558 | continue; | |
559 | ||
93db93de | 560 | TList * l = entry->GetOutputList(); |
561 | collections.Add(l); | |
c88234ad | 562 | count++; |
563 | } | |
564 | ||
93db93de | 565 | fOutput->Merge(&collections); |
c88234ad | 566 | |
567 | delete iter; | |
568 | ||
569 | return count+1; | |
570 | } | |
571 |