]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/charmFlow/AliAnalysisTaskSEHFv2.cxx
- ownership of output hist lists
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / charmFlow / AliAnalysisTaskSEHFv2.cxx
CommitLineData
a8f6c03f 1/**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/////////////////////////////////////////////////////////////
17//
18// AliAnalysisTaskSEHFv2 gives the needed tools for the D
19// mesons v2 analysis with event plane method
20// Authors: Chiara Bianchin, cbianchi@pd.infn.it,
21// Robert Grajcarek, grajcarek@physi.uni-heidelberg.de
22// Giacomo Ortona, ortona@to.infn.it
23// Carlos Eugenio Perez Lara, carlos.eugenio.perez.lara@cern.ch
24//
25/////////////////////////////////////////////////////////////
26
f829c4f7 27/* $Id$ */
28
a8f6c03f 29#include <Riostream.h>
30#include <TClonesArray.h>
31#include <TCanvas.h>
32#include <TList.h>
33#include <TFile.h>
34#include <TString.h>
35#include <TH1F.h>
36#include <TH2F.h>
37#include <TGraphErrors.h>
38#include <TGraph.h>
39#include <TDatabasePDG.h>
40#include <TRandom3.h>
41#include <TVector2.h>
42#include <TArrayF.h>
43
44#include <AliLog.h>
45#include <AliAnalysisDataSlot.h>
46#include <AliAnalysisDataContainer.h>
47#include "AliAnalysisManager.h"
48#include "AliAODHandler.h"
49#include "AliAODEvent.h"
50#include "AliAODVertex.h"
51#include "AliAODTrack.h"
52#include "AliAODMCHeader.h"
53#include "AliAODMCParticle.h"
54#include "AliAODRecoDecayHF3Prong.h"
55#include "AliAODRecoDecayHF.h"
56#include "AliAODRecoDecayHF2Prong.h"
57#include "AliAODRecoDecayHF4Prong.h"
58#include "AliAODRecoCascadeHF.h"
a8f6c03f 59
60#include "AliAnalysisTaskSE.h"
61#include "AliRDHFCutsDplustoKpipi.h"
62#include "AliRDHFCutsD0toKpipipi.h"
63#include "AliRDHFCutsDstoKKpi.h"
64#include "AliRDHFCutsDStartoKpipi.h"
65#include "AliRDHFCutsD0toKpi.h"
66#include "AliRDHFCutsLctopKpi.h"
67
68#include "AliHFMassFitter.h"
69#include "AliEventplane.h"
70#include "AliFlowTrack.h"
71#include "AliFlowVector.h"
72#include "AliFlowTrackCuts.h"
35405405 73#include "AliFlowEvent.h"
a8f6c03f 74
75#include "AliAnalysisTaskSEHFv2.h"
76
77ClassImp(AliAnalysisTaskSEHFv2)
78
79
80//________________________________________________________________________
81AliAnalysisTaskSEHFv2::AliAnalysisTaskSEHFv2():
82AliAnalysisTaskSE(),
83 fhEventsInfo(0),
84 fOutput(0),
85 fRDCuts(0),
590dea9c 86 fLowmasslimit(1.669),
87 fUpmasslimit(2.069),
a8f6c03f 88 fNPtBins(1),
a8f6c03f 89 fNMassBins(200),
35405405 90 fReadMC(kFALSE),
ed352b10 91 fUseAfterBurner(kFALSE),
a8f6c03f 92 fDecChannel(0),
ed352b10 93 fAfterBurner(0),
590dea9c 94 fEventPlaneMeth(kTPCVZERO),
95 fEventPlanesComp(10),
05620b8d 96 fV0EPorder(2),
e68599a9 97 fMinCentr(20),
35405405 98 fMaxCentr(80),
99 fEtaGap(kFALSE)
a8f6c03f 100{
101 // Default constructor
102}
103
104//________________________________________________________________________
590dea9c 105AliAnalysisTaskSEHFv2::AliAnalysisTaskSEHFv2(const char *name,AliRDHFCuts *rdCuts,Int_t decaychannel):
a8f6c03f 106 AliAnalysisTaskSE(name),
107 fhEventsInfo(0),
108 fOutput(0),
109 fRDCuts(rdCuts),
a8f6c03f 110 fLowmasslimit(0),
111 fUpmasslimit(0),
112 fNPtBins(1),
a8f6c03f 113 fNMassBins(200),
114 fReadMC(kFALSE),
ed352b10 115 fUseAfterBurner(kFALSE),
a8f6c03f 116 fDecChannel(decaychannel),
35405405 117 fAfterBurner(0),
590dea9c 118 fEventPlaneMeth(kTPCVZERO),
119 fEventPlanesComp(10),
05620b8d 120 fV0EPorder(2),
e68599a9 121 fMinCentr(20),
35405405 122 fMaxCentr(80),
123 fEtaGap(kFALSE)
a8f6c03f 124{
ad34433d 125 // standard constructor
a8f6c03f 126 Int_t pdg=421;
127 switch(fDecChannel){
128 case 0:
129 pdg=411;
130 break;
131 case 1:
132 pdg=421;
133 break;
134 case 2:
135 pdg=413;
136 break;
137 case 3:
138 pdg=431;
139 break;
140 case 4:
141 pdg=421;
142 break;
143 case 5:
144 pdg=4122;
145 break;
146 }
ed352b10 147 fAfterBurner = new AliHFAfterBurner(fDecChannel);
a8f6c03f 148 if(pdg==413) SetMassLimits((Float_t)0.135,(Float_t)0.165);
149 else SetMassLimits((Float_t)0.2,pdg); //check range
150 fNPtBins=fRDCuts->GetNPtBins();
a8f6c03f 151
152 if(fDebug>1)fRDCuts->PrintAll();
153 // Output slot #1 writes into a TH1F container
154 DefineOutput(1,TH1F::Class()); //Info on the number of events etc.
155 // Output slot #2 writes into a TList container
156 DefineOutput(2,TList::Class()); //Main output
157 // Output slot #3 writes into a AliRDHFCuts container (cuts)
158 switch(fDecChannel){
159 case 0:
160 DefineOutput(3,AliRDHFCutsDplustoKpipi::Class()); //Cut object for Dplus
161 break;
162 case 1:
163 DefineOutput(3,AliRDHFCutsD0toKpi::Class()); //Cut object for D0
164 break;
165 case 2:
166 DefineOutput(3,AliRDHFCutsDStartoKpipi::Class()); //Cut object for D*
167 break;
168 }
169 //DefineOutput(4,AliFlowEventSimple::Class());
35405405 170 //DefineOutput(4,TList::Class());
a8f6c03f 171}
172
173//________________________________________________________________________
174AliAnalysisTaskSEHFv2::~AliAnalysisTaskSEHFv2()
175{
176 // Destructor
ad34433d 177 delete fOutput;
178 delete fhEventsInfo;
179 delete fRDCuts;
ad34433d 180 delete fAfterBurner;
a8f6c03f 181}
35405405 182//_________________________________________________________________
a8f6c03f 183void AliAnalysisTaskSEHFv2::SetMassLimits(Float_t range, Int_t pdg){
ad34433d 184 // Set limits for mass spectra plots
a8f6c03f 185 Float_t mass=0;
186 Int_t abspdg=TMath::Abs(pdg);
187 mass=TDatabasePDG::Instance()->GetParticle(abspdg)->Mass();
188 fUpmasslimit = mass+range;
189 fLowmasslimit = mass-range;
190}
191//_________________________________________________________________
192void AliAnalysisTaskSEHFv2::SetMassLimits(Float_t lowlimit, Float_t uplimit){
ad34433d 193 // Set limits for mass spectra plots
a8f6c03f 194 if(uplimit>lowlimit)
195 {
196 fUpmasslimit = uplimit;
197 fLowmasslimit = lowlimit;
198 }
199}
200
201
202//________________________________________________________________________
203void AliAnalysisTaskSEHFv2::LocalInit()
204{
205 // Initialization
206
207 if(fDebug > 1) printf("AnalysisTaskSEHFv2::Init() \n");
208
05620b8d 209 fRDCuts->SetMinCentrality(fMinCentr);
210 fRDCuts->SetMaxCentrality(fMaxCentr);
a8f6c03f 211
212 switch(fDecChannel){
213 case 0:
214 {
215 AliRDHFCutsDplustoKpipi* copycut=new AliRDHFCutsDplustoKpipi(*(static_cast<AliRDHFCutsDplustoKpipi*>(fRDCuts)));
216 // Post the data
217 PostData(3,copycut);
218 }
219 break;
220 case 1:
221 {
222 AliRDHFCutsD0toKpi* copycut=new AliRDHFCutsD0toKpi(*(static_cast<AliRDHFCutsD0toKpi*>(fRDCuts)));
223 // Post the data
224 PostData(3,copycut);
225 }
226 break;
227 case 2:
228 {
229 AliRDHFCutsDStartoKpipi* copycut=new AliRDHFCutsDStartoKpipi(*(static_cast<AliRDHFCutsDStartoKpipi*>(fRDCuts)));
230 // Post the data
231 PostData(3,copycut);
232 }
233 break;
234 default:
235 return;
236 }
237 return;
238}
239//________________________________________________________________________
240void AliAnalysisTaskSEHFv2::UserCreateOutputObjects()
241{
242 // Create the output container
243
244 if(fDebug > 1) printf("AnalysisTaskSEHFv2::UserCreateOutputObjects() \n");
245
65ee3f93 246 fhEventsInfo=new TH1F(GetOutputSlot(1)->GetContainer()->GetName(), "Number of AODs scanned",7,-0.5,6.5);
a8f6c03f 247 fhEventsInfo->GetXaxis()->SetBinLabel(1,"nEventsAnal");
248 fhEventsInfo->GetXaxis()->SetBinLabel(2,"nEvSelected");
249 fhEventsInfo->GetXaxis()->SetBinLabel(3,"nCandidatesSelected");
250 fhEventsInfo->GetXaxis()->SetBinLabel(4,"out of pt bounds");
590dea9c 251 fhEventsInfo->GetXaxis()->SetBinLabel(5,Form("Ev Sel in Centr %.0f-%.0f%s",fRDCuts->GetMinCentrality(),fRDCuts->GetMaxCentrality(),"%"));
252 fhEventsInfo->GetXaxis()->SetBinLabel(6,"mismatch lab");
65ee3f93 253 fhEventsInfo->GetXaxis()->SetBinLabel(7,"non valid TPC EP");
a8f6c03f 254 fhEventsInfo->GetXaxis()->SetNdivisions(1,kFALSE);
255
256
257 // Several histograms are more conveniently managed in a TList
258 fOutput = new TList();
259 fOutput->SetOwner();
260 fOutput->SetName("MainOutput");
261
05620b8d 262 for(Int_t icentr=fMinCentr+5;icentr<=fMaxCentr;icentr=icentr+5){
a8f6c03f 263 TString centrname;centrname.Form("centr%d_%d",icentr-5,icentr);
a8f6c03f 264
590dea9c 265 TH2F* hMPtCand=new TH2F(Form("hMPtCand%s",centrname.Data()),Form("Mass vs pt %s;pt (GeV);M (GeV/c^{2})",centrname.Data()),120,0,24.,fNMassBins,fLowmasslimit,fUpmasslimit);
266 fOutput->Add(hMPtCand);//For <pt> calculation
267
a8f6c03f 268
590dea9c 269 //Candidate distributions
270 for(Int_t i=0;i<fNPtBins;i++){
271 TH2F* hMc2phi=new TH2F(Form("hMc2phi_pt%d%s",i,centrname.Data()),Form("Mass vs cos2#Delta#phi (p_{t} bin %d %s);cos2#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),100,-1.,1.,fNMassBins,fLowmasslimit,fUpmasslimit);
272 fOutput->Add(hMc2phi);//for 2D analysis
273
274 TH2F* hMphi=new TH2F(Form("hMphi_pt%d%s",i,centrname.Data()),Form("Mass vs #Delta#phi %s;#Delta#phi;M (GeV/c^{2})",centrname.Data()),96,0,TMath::Pi(),fNMassBins,fLowmasslimit,fUpmasslimit);
275 fOutput->Add(hMphi);//for phi bins analysis
276
a8f6c03f 277 if (fReadMC){
278 TH2F* hMc2phiS=new TH2F(Form("hMc2phiS_pt%d%s",i,centrname.Data()),Form("Mass vs cos2#Delta#phi (p_{t} bin %d %s);cos2#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),100,-1.,1.,fNMassBins,fLowmasslimit,fUpmasslimit);
279 fOutput->Add(hMc2phiS);
280 TH2F * hMphiS=new TH2F(Form("hMphiS_pt%d%s",i,centrname.Data()),Form("Mass vs #Delta#phi (p_{t} bin %d %s);#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),96,0,2*TMath::Pi(),fNMassBins,fLowmasslimit,fUpmasslimit);
281 fOutput->Add(hMphiS);
282 TH2F* hMc2phiB=new TH2F(Form("hMc2phiB_pt%d%s",i,centrname.Data()),Form("Mass vs cos2#Delta#phi (p_{t} bin %d %s);cos2#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),100,-1.,1.,fNMassBins,fLowmasslimit,fUpmasslimit);
283 fOutput->Add(hMc2phiB);
284 TH2F * hMphiB=new TH2F(Form("hMphiB_pt%d%s",i,centrname.Data()),Form("Mass vs #Delta#phi (p_{t} bin %d %s);#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),96,0,2*TMath::Pi(),fNMassBins,fLowmasslimit,fUpmasslimit);
285 fOutput->Add(hMphiB);
286 if((fDecChannel != AliAnalysisTaskSEHFv2::kDplustoKpipi) &&(fDecChannel != AliAnalysisTaskSEHFv2::kDstartoKpipi)){
287 TH2F* hMc2phiR=new TH2F(Form("hMc2phiR_pt%d%s",i,centrname.Data()),Form("Mass vs cos2#Delta#phi (p_{t} bin %d %s);cos2#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),100,-1.,1.,fNMassBins,fLowmasslimit,fUpmasslimit);
288 fOutput->Add(hMc2phiR);
289 TH2F* hMphiR=new TH2F(Form("hMphiR_pt%d%s",i,centrname.Data()),Form("Mass vs #Delta#phi (p_{t} bin %d %s);#Delta#phi;M (GeV/c^{2})",i,centrname.Data()),96,0,2*TMath::Pi(),fNMassBins,fLowmasslimit,fUpmasslimit);
290 fOutput->Add(hMphiR);
291 }
292 }
293 }
a8f6c03f 294
590dea9c 295
296 //Event Plane
297 TH2F* hEvPlane=new TH2F(Form("hEvPlane%s",centrname.Data()),Form("VZERO/TPC Event plane angle %s;#phi Ev Plane (TPC);#phi Ev Plane (VZERO);Entries",centrname.Data()),200,0.,TMath::Pi(),200,0.,TMath::Pi());
298 fOutput->Add(hEvPlane);
e68599a9 299
65ee3f93 300 TH1F* hEvPlaneA=new TH1F(Form("hEvPlaneA%s",centrname.Data()),Form("Event plane angle %s;#phi Ev Plane;Entries",centrname.Data()),200,0.,TMath::Pi());
301 fOutput->Add(hEvPlaneA);
302
303 TH1F* hEvPlaneB=new TH1F(Form("hEvPlaneB%s",centrname.Data()),Form("Event plane angle %s;#phi Ev Plane;Entries",centrname.Data()),200,0.,TMath::Pi());
304 fOutput->Add(hEvPlaneB);
a8f6c03f 305
a8f6c03f 306 TH1F* hEvPlaneCand=new TH1F(Form("hEvPlaneCand%s",centrname.Data()),Form("Event plane angle - Event plane angle per candidate %s;#phi(Ev Plane Candidate);Entries",centrname.Data()),200,-TMath::Pi(),TMath::Pi());
307 fOutput->Add(hEvPlaneCand);
308
309 TH1F* hEvPlaneReso=new TH1F(Form("hEvPlaneReso%s",centrname.Data()),Form("Event plane angle Resolution %s;cos2(#psi_{A}-#psi_{B});Entries",centrname.Data()),220,-1.1,1.1);
310 fOutput->Add(hEvPlaneReso);
21cafb93 311 if(fEventPlaneMeth>kTPCVZERO){
65ee3f93 312 TH1F* hEvPlaneReso2=new TH1F(Form("hEvPlaneReso2%s",centrname.Data()),Form("Event plane angle Resolution %s;cos2(#psi_{A}-#psi_{B});Entries",centrname.Data()),220,-1.1,1.1);
313 fOutput->Add(hEvPlaneReso2);
314 TH1F* hEvPlaneReso3=new TH1F(Form("hEvPlaneReso3%s",centrname.Data()),Form("Event plane angle Resolution %s;cos2(#psi_{A}-#psi_{B});Entries",centrname.Data()),220,-1.1,1.1);
315 fOutput->Add(hEvPlaneReso3);
316 }
a8f6c03f 317 }
318
a8f6c03f 319 PostData(1,fhEventsInfo);
320 PostData(2,fOutput);
590dea9c 321
a8f6c03f 322 return;
323}
324
325//________________________________________________________________________
326void AliAnalysisTaskSEHFv2::UserExec(Option_t */*option*/)
327{
328 // Execute analysis for current event:
329 // heavy flavor candidates association to MC truth
a8f6c03f 330 AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
331 if(fDebug>2) printf("Analysing decay %d\n",fDecChannel);
332 // Post the data already here
333 PostData(1,fhEventsInfo);
334 PostData(2,fOutput);
335
336 TClonesArray *arrayProng =0;
337 Int_t absPdgMom=0;
338 if(!aod && AODEvent() && IsStandardAOD()) {
339 // In case there is an AOD handler writing a standard AOD, use the AOD
340 // event in memory rather than the input (ESD) event.
341 aod = dynamic_cast<AliAODEvent*> (AODEvent());
342 // in this case the braches in the deltaAOD (AliAOD.VertexingHF.root)
343 // have to taken from the AOD event hold by the AliAODExtension
344 AliAODHandler* aodHandler = (AliAODHandler*)
345 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
346 if(aodHandler->GetExtensions()) {
347
348 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject("AliAOD.VertexingHF.root");
349 AliAODEvent *aodFromExt = ext->GetAOD();
350
351
352 if(fDecChannel==0){
353 absPdgMom=411;
354 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Charm3Prong");
355 }
356 if(fDecChannel==1){
357 absPdgMom=421;
358 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("D0toKpi");
359 }
360 if(fDecChannel==2){
361 absPdgMom=413;
362 arrayProng=(TClonesArray*)aodFromExt->GetList()->FindObject("Dstar");
363 }
364 }
471f1b0c 365 } else if(aod){
a8f6c03f 366 if(fDecChannel==0){
367 absPdgMom=411;
368 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
369 }
370 if(fDecChannel==1){
371 absPdgMom=421;
372 arrayProng=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
373 }
374 if(fDecChannel==2){
375 absPdgMom=413;
376 arrayProng=(TClonesArray*)aod->GetList()->FindObject("Dstar");
377 }
378 }
379
10287b52 380 if(!aod || !arrayProng) {
a8f6c03f 381 AliError("AliAnalysisTaskSEHFv2::UserExec:Branch not found!\n");
382 return;
383 }
384
385 // fix for temporary bug in ESDfilter
386 // the AODs with null vertex pointer didn't pass the PhysSel
387 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) return;
388
389 TClonesArray *arrayMC=0;
390 AliAODMCHeader *mcHeader=0;
391
392 // load MC particles
393 if(fReadMC){
394
395 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
396 if(!arrayMC) {
397 AliWarning("AliAnalysisTaskSEHFv2::UserExec:MC particles branch not found!\n");
471f1b0c 398 return;
a8f6c03f 399 }
400
401 // load MC header
402 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
403 if(!mcHeader) {
404 AliError("AliAnalysisTaskSEHFv2::UserExec:MC header branch not found!\n");
405 return;
406 }
407 }
408
409 fhEventsInfo->Fill(0); // count event
410
411 AliAODRecoDecayHF *d=0;
412
413 Int_t nCand = arrayProng->GetEntriesFast();
414 if(fDebug>2) printf("Number of D2H: %d\n",nCand);
415
590dea9c 416 Bool_t isEvSel=fRDCuts->IsEventSelected(aod);
417 if(!isEvSel){
418 if(!fRDCuts->IsEventRejectedDueToCentrality())fhEventsInfo->Fill(4);
419 return;
420 }
a8f6c03f 421
590dea9c 422 fhEventsInfo->Fill(1);
423 AliEventplane *pl=aod->GetEventplane();
424 if(!pl){
425 AliError("AliAnalysisTaskSEHFv2::UserExec:no eventplane! v2 analysis without eventplane not possible!\n");
a8f6c03f 426 return;
427 }
590dea9c 428
429 //Event plane
430 Double_t eventplane=0;
431 Double_t rpangleTPC=0;
432 Double_t rpangleVZERO=0;
433 Double_t planereso=0;
434 Double_t deltaPsi=0;
65ee3f93 435 Double_t rpangleeventB=0;
436 Double_t rpangleeventA=0;
590dea9c 437
438 //For candidate removal from TPC EP
439 TVector2* q=0x0;
35405405 440 TVector2 *qsub1=0x0;
441 TVector2 *qsub2=0x0;
442
a8f6c03f 443 //determine centrality bin
444 Float_t centr=fRDCuts->GetCentrality(aod);
445 Int_t icentr=0;
05620b8d 446 for(Int_t ic=fMinCentr+5;ic<=fMaxCentr;ic=ic+5){
a8f6c03f 447 if(ic>centr){
448 icentr=ic;
449 break;
450 }
451 }
452 TString centrbinname=Form("centr%d_%d",icentr-5,icentr);
590dea9c 453
ed352b10 454 if(fReadMC){
ed352b10 455 TRandom3 *g = new TRandom3(0);
65ee3f93 456 eventplane=g->Rndm()*TMath::Pi();
ed352b10 457 delete g;g=0x0;
590dea9c 458 if(fUseAfterBurner)fAfterBurner->SetEventPlane((Double_t)eventplane);
a8f6c03f 459 }else{
590dea9c 460 if(fEventPlaneMeth!=kTPC){
461 //VZERO EP and resolution
65ee3f93 462 rpangleVZERO=GetPhi0Pi(pl->GetEventplane("V0",aod,fV0EPorder));
21cafb93 463 if(fEventPlaneMeth>kTPCVZERO){
65ee3f93 464 //Using V0A/C for VZERO resolution
465 rpangleeventA= GetPhi0Pi(pl->GetEventplane("V0A",aod,fV0EPorder));
466 rpangleeventB= GetPhi0Pi(pl->GetEventplane("V0C",aod,fV0EPorder));
467
468 deltaPsi =rpangleeventA-rpangleeventB;
590dea9c 469 eventplane=rpangleVZERO;
ed352b10 470 }
590dea9c 471 }
65ee3f93 472 // TPC event plane
473 rpangleTPC = pl->GetEventplane("Q");
21cafb93 474 if(fEventPlaneMeth<=kTPCVZERO){
65ee3f93 475 // TPC resolution
476 q = pl->GetQVector();
35405405 477 if(fEtaGap){
65ee3f93 478 qsub1 = pl->GetQsub1();
479 qsub2 = pl->GetQsub2();
21cafb93 480 if(!qsub1 || !qsub2){
481 fhEventsInfo->Fill(6);
482 return;
483 }
65ee3f93 484 rpangleeventA = qsub1->Phi()/2.;
485 rpangleeventB = qsub2->Phi()/2.;
590dea9c 486 }
65ee3f93 487 deltaPsi = pl->GetQsubRes();
488 // planereso = TMath::Cos(2.*deltaPsi); // reaction plane resolution
a8f6c03f 489 }
a8f6c03f 490 }
21cafb93 491
492 //verify TPC EP
493 Double_t rpsubTPC=rpangleTPC;
494 if(fEventPlaneMeth==kVZEROpos||fEventPlaneMeth==kVZEROneg){
495 TVector2 *qsub=0x0;
496 if(fEventPlaneMeth==kVZEROneg)qsub=pl->GetQsub2();
497 else qsub=pl->GetQsub1();
498 if(!qsub){
499 fhEventsInfo->Fill(6);
500 return;
501 }
502 if(qsub->X()==0 && qsub->Y()==0){
503 fhEventsInfo->Fill(6);
504 return;
505 }
506 rpsubTPC=qsub->Phi()/2.;
507 }
508 if(rpsubTPC<0){
509 fhEventsInfo->Fill(6);
510 return;
511 }
65ee3f93 512
513 if(TMath::Abs(deltaPsi)>TMath::Pi()/2.){
514 if(deltaPsi>0.) deltaPsi-=TMath::Pi();
515 else deltaPsi +=TMath::Pi();
516 } // difference of subevents reaction plane angle cannot be bigger than phi/2
517 planereso = TMath::Cos(2.*deltaPsi); // reaction plane resolution
590dea9c 518 if(TMath::Abs(rpangleTPC-rpangleVZERO)>fEventPlanesComp)return;
65ee3f93 519
21cafb93 520 if(fDebug>2)printf("Filling EP-related histograms\n");
590dea9c 521 //Filling EP-related histograms
590dea9c 522 ((TH2F*)fOutput->FindObject(Form("hEvPlane%s",centrbinname.Data())))->Fill(rpangleTPC,rpangleVZERO); // reaction plane angle without autocorrelations removal
523 ((TH1F*)fOutput->FindObject(Form("hEvPlaneReso%s",centrbinname.Data())))->Fill(planereso); //RP resolution
21cafb93 524 if(fEventPlaneMeth>kTPCVZERO||fEtaGap){
65ee3f93 525 ((TH1F*)fOutput->FindObject(Form("hEvPlaneA%s",centrbinname.Data())))->Fill(rpangleeventA); //Angle of first subevent
526 ((TH1F*)fOutput->FindObject(Form("hEvPlaneB%s",centrbinname.Data())))->Fill(rpangleeventB); //Angle of second subevent
527 }
21cafb93 528 if(fEventPlaneMeth>kTPCVZERO){
529 Double_t deltaSub=rpsubTPC-rpangleeventA;
65ee3f93 530 if(TMath::Abs(deltaSub)>TMath::Pi()/2.){// difference of subevents reaction plane angle cannot be bigger than phi/2
531 if(deltaSub>0.) deltaSub-=TMath::Pi();
532 else deltaSub +=TMath::Pi();
533 }
534 ((TH1F*)fOutput->FindObject(Form("hEvPlaneReso2%s",centrbinname.Data())))->Fill(TMath::Cos(2.*deltaSub)); //RP resolution
21cafb93 535 deltaSub =rpsubTPC-rpangleeventB;
65ee3f93 536 if(TMath::Abs(deltaSub)>TMath::Pi()/2.){// difference of subevents reaction plane angle cannot be bigger than phi/2
537 if(deltaSub>0.) deltaSub-=TMath::Pi();
538 else deltaSub +=TMath::Pi();
539 }
540 ((TH1F*)fOutput->FindObject(Form("hEvPlaneReso3%s",centrbinname.Data())))->Fill(TMath::Cos(2.*deltaSub)); //RP resolution
541 }
a8f6c03f 542
21cafb93 543 if(fDebug>2)printf("Loop on D candidates\n");
590dea9c 544 //Loop on D candidates
a8f6c03f 545 for (Int_t iCand = 0; iCand < nCand; iCand++) {
a8f6c03f 546 d=(AliAODRecoDecayHF*)arrayProng->UncheckedAt(iCand);
a8f6c03f 547 Bool_t isSelBit=kTRUE;
548 if(fDecChannel==0) isSelBit=d->HasSelectionBit(AliRDHFCuts::kDplusCuts);
549 if(fDecChannel==1) isSelBit=d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts);
550 if(fDecChannel==2) isSelBit=d->HasSelectionBit(AliRDHFCuts::kD0fromDstarCuts);
590dea9c 551 if(!isSelBit)continue;
552 Int_t ptbin=fRDCuts->PtBin(d->Pt());
553 if(ptbin<0) {
554 fhEventsInfo->Fill(3);
555 continue;
556 }
557 Bool_t isFidAcc = fRDCuts->IsInFiducialAcceptance(d->Pt(),d->Y(absPdgMom));
558 if(!isFidAcc)continue;
559 Int_t isSelected= fRDCuts->IsSelected(d,AliRDHFCuts::kCandidate,aod);
560 if(!isSelected)continue;
561
562 fhEventsInfo->Fill(2); // candidate selected
563 if(fDebug>3) printf("+++++++Is Selected\n");
a8f6c03f 564
590dea9c 565 Float_t* invMass=0x0;
566 Int_t nmasses;
567 CalculateInvMasses(d,invMass,nmasses);
a8f6c03f 568
21cafb93 569 if(fEventPlaneMeth<=kTPCVZERO){
590dea9c 570 eventplane = GetEventPlaneForCandidate(d,q,pl,qsub1,qsub2); // remove autocorrelations
571 ((TH1F*)fOutput->FindObject(Form("hEvPlaneCand%s",centrbinname.Data())))->Fill(rpangleTPC-eventplane);
572 }
a8f6c03f 573
590dea9c 574 Double_t phi=d->Phi();
575 if(fReadMC&&fUseAfterBurner)phi=fAfterBurner->GetNewAngle(d,arrayMC);
576 Float_t deltaphi=GetPhi0Pi(phi-eventplane);
577
578 //fill the histograms with the appropriate method
579 if(fDecChannel==0)FillDplus(d,arrayMC,ptbin,deltaphi,invMass,isSelected,icentr);
580 else if(fDecChannel==1)FillD02p(d,arrayMC,ptbin,deltaphi,invMass,isSelected,icentr);
581 else if(fDecChannel==2)FillDstar(d,arrayMC,ptbin,deltaphi,invMass,isSelected,icentr);
582
471f1b0c 583 delete [] invMass;
a8f6c03f 584 }
585
586 PostData(1,fhEventsInfo);
587 PostData(2,fOutput);
590dea9c 588
a8f6c03f 589 return;
590}
591
592//***************************************************************************
593
594// Methods used in the UserExec
595
596void AliAnalysisTaskSEHFv2::CalculateInvMasses(AliAODRecoDecayHF* d,Float_t*& masses,Int_t& nmasses){
597 //Calculates all the possible invariant masses for each candidate
598 //NB: the implementation for each candidate is responsibility of the corresponding developer
599
600 if(fDecChannel==0){
601 //D+ -- Giacomo
602 nmasses=1;
603 masses=new Float_t[nmasses];
604 Int_t pdgdaughters[3] = {211,321,211};
605 masses[0]=d->InvMass(3,(UInt_t*)pdgdaughters);
606 }
607 if(fDecChannel==1){
608 //D0 (Kpi) -- Chiara
609 const Int_t ndght=2;
610 nmasses=2;
611 masses=new Float_t[nmasses];
612 Int_t pdgdaughtersD0[ndght]={211,321};//pi,K
613 masses[0]=d->InvMass(ndght,(UInt_t*)pdgdaughtersD0); //D0
614 Int_t pdgdaughtersD0bar[ndght]={321,211};//K,pi
615 masses[1]=d->InvMass(ndght,(UInt_t*)pdgdaughtersD0bar); //D0bar
616 }
617 if(fDecChannel==2){
618 //D* -- Robert,Yifei, Alessandro
619 nmasses=1;
620 masses=new Float_t[nmasses];
621 masses[0]=((AliAODRecoCascadeHF*)d)->DeltaInvMass();
622 }
623}
624
625//******************************************************************************
626
590dea9c 627//Methods to fill the histograms, one for each channel
a8f6c03f 628//NB: the implementation for each candidate is responsibility of the corresponding developer
629
590dea9c 630//******************************************************************************
ad34433d 631void AliAnalysisTaskSEHFv2::FillDplus(AliAODRecoDecayHF* d,TClonesArray *arrayMC,Int_t ptbin,Float_t deltaphi, const Float_t* masses,Int_t isSel,Int_t icentr){
a8f6c03f 632 //D+ channel
633 if(!isSel){
634 if(fDebug>3)AliWarning("Candidate not selected\n");
635 return;
636 }
637 if(!masses){
638 if(fDebug>3)AliWarning("Masses not calculated\n");
639 return;
640 }
641
a8f6c03f 642 ((TH2F*)fOutput->FindObject(Form("hMc2phi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
590dea9c 643 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
e68599a9 644 ((TH2F*)fOutput->FindObject(Form("hMPtCandcentr%d_%d",icentr-5,icentr)))->Fill(d->Pt(),masses[0]);
a8f6c03f 645 Int_t pdgdaughters[3] = {211,321,211};
646
647 if(fReadMC){
648 Int_t lab=-1;
ed352b10 649 if(fUseAfterBurner){
650 Bool_t isSignal=fAfterBurner->GetIsSignal();
651 if(isSignal)lab=10;
652 }else {
653 lab = d->MatchToMC(411,arrayMC,3,pdgdaughters);
654 }
a8f6c03f 655 if(lab>=0){ //signal
a8f6c03f 656 ((TH2F*)fOutput->FindObject(Form("hMc2phiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
657 ((TH2F*)fOutput->FindObject(Form("hMphiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
658 } else{ //background
a8f6c03f 659 ((TH2F*)fOutput->FindObject(Form("hMc2phiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
660 ((TH2F*)fOutput->FindObject(Form("hMphiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
661 }
662 }
663}
664
590dea9c 665//******************************************************************************
ad34433d 666void AliAnalysisTaskSEHFv2::FillD02p(AliAODRecoDecayHF* d,TClonesArray *arrayMC,Int_t ptbin,Float_t deltaphi, const Float_t* masses,Int_t isSel,Int_t icentr){
a8f6c03f 667
668 //D0->Kpi channel
669
670 //mass histograms
671 if(!masses){
672 if(fDebug>3)AliWarning("Masses not calculated\n");
673 return;
674 }
a8f6c03f 675 if(isSel==1 || isSel==3) {
a8f6c03f 676 ((TH2F*)fOutput->FindObject(Form("hMc2phi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
590dea9c 677 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
e68599a9 678 ((TH2F*)fOutput->FindObject(Form("hMPtCandcentr%d_%d",icentr-5,icentr)))->Fill(d->Pt(),masses[0]);
a8f6c03f 679 }
680 if(isSel>=2) {
a8f6c03f 681 ((TH2F*)fOutput->FindObject(Form("hMc2phi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[1]);
590dea9c 682 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[1]);
e68599a9 683 ((TH2F*)fOutput->FindObject(Form("hMPtCandcentr%d_%d",icentr-5,icentr)))->Fill(d->Pt(),masses[1]);
a8f6c03f 684 }
685
a8f6c03f 686 //MC histograms
687 if(fReadMC){
688
689 Int_t matchtoMC=-1;
690
691 //D0
692 Int_t pdgdaughters[2];
693 pdgdaughters[0]=211;//pi
694 pdgdaughters[1]=321;//K
695 Int_t nprongs=2;
696 Int_t absPdgMom=421;
697
698 matchtoMC = d->MatchToMC(absPdgMom,arrayMC,nprongs,pdgdaughters);
699
700 Int_t prongPdgPlus=421,prongPdgMinus=(-1)*421;
701 if((isSel==1 || isSel==3)){ //D0
702 if(matchtoMC>=0){
703 AliAODMCParticle *dMC = (AliAODMCParticle*)arrayMC->At(matchtoMC);
704 Int_t pdgMC = dMC->GetPdgCode();
705
706 if(pdgMC==prongPdgPlus) {
a8f6c03f 707 ((TH2F*)fOutput->FindObject(Form("hMc2phiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
708 ((TH2F*)fOutput->FindObject(Form("hMphiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
709 }
710 else {
a8f6c03f 711 ((TH2F*)fOutput->FindObject(Form("hMc2phiR_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
590dea9c 712 ((TH2F*)fOutput->FindObject(Form("hMphiR_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
a8f6c03f 713 }
714 } else {
a8f6c03f 715 ((TH2F*)fOutput->FindObject(Form("hMc2phiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
590dea9c 716 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
a8f6c03f 717 }
718 }
719 if(isSel>=2){ //D0bar
720 if(matchtoMC>=0){
721 AliAODMCParticle *dMC = (AliAODMCParticle*)arrayMC->At(matchtoMC);
722 Int_t pdgMC = dMC->GetPdgCode();
723
724 if(pdgMC==prongPdgMinus) {
a8f6c03f 725 ((TH2F*)fOutput->FindObject(Form("hMc2phiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[1]);
726 ((TH2F*)fOutput->FindObject(Form("hMphiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[1]);
727 }
728 else {
a8f6c03f 729 ((TH2F*)fOutput->FindObject(Form("hMc2phiR_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[1]);
590dea9c 730 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[1]);
a8f6c03f 731 }
732 } else {
a8f6c03f 733 ((TH2F*)fOutput->FindObject(Form("hMc2phiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[1]);
734 ((TH2F*)fOutput->FindObject(Form("hMphiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[1]);
735 }
736 }
737 }
738}
590dea9c 739//******************************************************************************
ad34433d 740void AliAnalysisTaskSEHFv2::FillDstar(AliAODRecoDecayHF* d,TClonesArray *arrayMC,Int_t ptbin,Float_t deltaphi, const Float_t* masses,Int_t isSel,Int_t icentr){
a8f6c03f 741 //D* channel
742 if(!isSel){
743 if(fDebug>3)AliWarning("Candidate not selected\n");
744 return;
745 }
746 if(!masses){
747 if(fDebug>3)AliWarning("Masses not calculated\n");
748 return;
749 }
590dea9c 750
a8f6c03f 751 ((TH2F*)fOutput->FindObject(Form("hMc2phi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
590dea9c 752 ((TH2F*)fOutput->FindObject(Form("hMphi_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
e68599a9 753 ((TH2F*)fOutput->FindObject(Form("hMPtCandcentr%d_%d",icentr-5,icentr)))->Fill(d->Pt(),masses[0]);
a8f6c03f 754 Int_t pdgDgDStartoD0pi[2]={421,211};
755 Int_t pdgDgD0toKpi[2]={321,211};
756
757 if(fReadMC){
758 Int_t lab=-1;
759 lab = ((AliAODRecoCascadeHF*)d)->MatchToMC(413,421,pdgDgDStartoD0pi,pdgDgD0toKpi,arrayMC);
760 if(lab>=0){ //signal
a8f6c03f 761 ((TH2F*)fOutput->FindObject(Form("hMc2phiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
762 ((TH2F*)fOutput->FindObject(Form("hMphiS_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
763 } else{ //background
a8f6c03f 764 ((TH2F*)fOutput->FindObject(Form("hMc2phiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(TMath::Cos(2*deltaphi),masses[0]);
765 ((TH2F*)fOutput->FindObject(Form("hMphiB_pt%dcentr%d_%d",ptbin,icentr-5,icentr)))->Fill(deltaphi,masses[0]);
766 }
767 }
a8f6c03f 768}
769
a8f6c03f 770//________________________________________________________________________
590dea9c 771void AliAnalysisTaskSEHFv2::SetEventPlaneMethod(Int_t method){
21cafb93 772 if(method>kVZEROpos||method<0){
590dea9c 773 AliWarning("No EP method associated to the selection, setting to TPC EP\n");
774 method=kTPCVZERO;
a8f6c03f 775 }
590dea9c 776 fEventPlaneMeth=method;
a8f6c03f 777}
590dea9c 778
a8f6c03f 779//________________________________________________________________________
780Float_t AliAnalysisTaskSEHFv2::GetPhi0Pi(Float_t phi){
ad34433d 781 // Sets the phi angle in the range 0-pi
a8f6c03f 782 Float_t result=phi;
783 while(result<0){
784 result=result+TMath::Pi();
785 }
786 while(result>TMath::Pi()){
787 result=result-TMath::Pi();
788 }
590dea9c 789 return result;
a8f6c03f 790}
791
792//________________________________________________________________________
ad34433d 793Float_t AliAnalysisTaskSEHFv2::GetEventPlaneForCandidate(AliAODRecoDecayHF* d, const TVector2* q,AliEventplane *pl, const TVector2* qsub1, const TVector2* qsub2){
a8f6c03f 794 // remove autocorrelations
795
35405405 796 TArrayF* qx = 0x0;
797 TArrayF* qy = 0x0;
798 TVector2 qcopy;
799 if(!fEtaGap){
800 qx = pl->GetQContributionXArray();
801 qy = pl->GetQContributionYArray();
802 qcopy = *q;
803 }
804 else {
805 if(d->Eta()>0.){
806 qx = pl->GetQContributionXArraysub1();
807 qy = pl->GetQContributionYArraysub1();
808 qcopy = *qsub1;
809 }
810 else{
811 qx = pl->GetQContributionXArraysub2();
812 qy = pl->GetQContributionYArraysub2();
813 qcopy = *qsub2;
814 }
815 }
816
a8f6c03f 817 if(fDecChannel==2){
818 //D* -- Yifei, Alessandro,Robert
819 AliAODRecoDecayHF2Prong* theD0particle = ((AliAODRecoCascadeHF*)d)->Get2Prong();
820 AliAODTrack *track0 = (AliAODTrack*)theD0particle->GetDaughter(0);
821 AliAODTrack *track1 = (AliAODTrack*)theD0particle->GetDaughter(1);
822 AliAODTrack *track2 = ((AliAODRecoCascadeHF*)d)->GetBachelor();
823 // reduce global q vector
824
825 TVector2 q0;
826 if((track0->GetID()) < qx->fN){
827 q0.Set(qx->At(track0->GetID()),qy->At(track0->GetID()));}
828
829 TVector2 q1;
830 if((track1->GetID()) < qx->fN){
831 q1.Set(qx->At(track1->GetID()),qy->At(track1->GetID()));}
832
833 TVector2 q2;
834 if((track2->GetID()) < qx->fN){
835 q2.Set(qx->At(track2->GetID()),qy->At(track2->GetID()));}
836
837 qcopy = qcopy -(q0+q1+q2);
838
839 }
840
841 // reduce Q vector for D+ and D0
842
843 if(fDecChannel==1){
844 //D0 -- Chiara
845 AliAODTrack *track0 = (AliAODTrack*)d->GetDaughter(0);
846 AliAODTrack *track1 = (AliAODTrack*)d->GetDaughter(1);
847
848 TVector2 q0;
849 if((track0->GetID()) < qx->fN){
850 q0.Set(qx->At(track0->GetID()),qy->At(track0->GetID()));}
851
852 TVector2 q1;
853 if((track1->GetID()) < qx->fN){
854 q1.Set(qx->At(track1->GetID()),qy->At(track1->GetID()));}
855
856 qcopy = qcopy -(q0+q1);
857 }
858
859 if(fDecChannel==0){
860 //D+ -- Giacomo
861 AliAODTrack *track0 = (AliAODTrack*)d->GetDaughter(0);
862 AliAODTrack *track1 = (AliAODTrack*)d->GetDaughter(1);
863 AliAODTrack *track2 = (AliAODTrack*)d->GetDaughter(2);
864
865 TVector2 q0;
866 if((track0->GetID()) < qx->fN){
867 q0.Set(qx->At(track0->GetID()),qy->At(track0->GetID()));}
868
869 TVector2 q1;
870 if((track1->GetID()) < qx->fN){
871 q1.Set(qx->At(track1->GetID()),qy->At(track1->GetID()));}
872
873 TVector2 q2;
874 if((track2->GetID()) < qx->fN){
875 q2.Set(qx->At(track2->GetID()),qy->At(track2->GetID()));}
876
877 qcopy = qcopy -(q0+q1+q2);
878
879 }
880
881 return qcopy.Phi()/2.;
882
883}
590dea9c 884// //________________________________________________________________________
885// Float_t AliAnalysisTaskSEHFv2::GetEventPlaneFromV0(AliAODEvent *aodEvent){
886// // Compute event plane for VZERO - Obsolete, used for 2010 data
887
888// Int_t centr=fRDCuts->GetCentrality(aodEvent);
889// centr=centr-centr%10;
890// //temporary fix
891// if(centr<20)centr=20;
892// if(centr>70)centr=70;
893// //end temporary fix
894// Int_t binx=0;
895// Int_t iParHist=(centr-20)/10;
896
897// TString name;name.Form("parhist%d_%d",centr,centr+10);
898
899// if(fDebug>15)printf("EPfromV0 centr %d, iparhist %d (%p-%p)\n",centr,iParHist,fParHist->FindObject(name.Data()),fParHist->At(iParHist));
900
901// Int_t runnumber=aodEvent->GetRunNumber();
902// if(fParHist->At(iParHist)){
903// for(Int_t i=1;i<=((TH2D*)fParHist->At(iParHist))->GetNbinsX()&&binx<=0;i++){
904// Int_t run=atoi(((TH2D*)fParHist->At(iParHist))->GetXaxis()->GetBinLabel(i));
905// if(run>=runnumber)binx=i;
906// }
907// }else{
908// fhEventsInfo->Fill(7);
909// }
a8f6c03f 910
590dea9c 911// AliFlowTrackCuts* cutsRP = AliFlowTrackCuts::GetStandardVZEROOnlyTrackCuts();
912// cutsRP->SetEvent(aodEvent, MCEvent());//, 0x0);
913// cutsRP->SetName( Form("rp_cuts") );
914// AliFlowTrackCuts* dummy = new AliFlowTrackCuts("null_cuts");
915// dummy->SetParamType(AliFlowTrackCuts::kGlobal);
916// dummy->SetPtRange(+1,-1); // select nothing QUICK
917// dummy->SetEtaRange(+1,-1); // select nothing VZERO
918// dummy->SetEvent(aodEvent,MCEvent());
919
920// //////////////// construct the flow event container ////////////
921// AliFlowEvent flowEvent(cutsRP,dummy);
922// flowEvent.SetReferenceMultiplicity( 64 );
923// for(Int_t i=0;i<64&&binx>0;i++){
924// AliFlowTrack *flowTrack=flowEvent.GetTrack(i);
925// Double_t inte=((TH2D*)fParHist->At(iParHist))->Integral(binx,binx,i+1,i+1);
926// if(inte>0)flowTrack->SetWeight(flowTrack->Weight()/inte);
927// }
928// if(fDebug>15)printf("EPfromV0 flow tracks weights done\n");
ed352b10 929
590dea9c 930// AliFlowVector qvec=flowEvent.GetQ(fV0EPorder);
931// Double_t angleEP=(1./(Double_t)fV0EPorder)*qvec.Phi();
932// if(fDebug>15)printf("EPfromV0 phi %f\n",angleEP);
933// return angleEP;
934// }
a8f6c03f 935//________________________________________________________________________
936void AliAnalysisTaskSEHFv2::Terminate(Option_t */*option*/)
937{
a8f6c03f 938 // Terminate analysis
939 //
940 if(fDebug > 1) printf("AnalysisTaskSEHFv2: Terminate() \n");
590dea9c 941
a8f6c03f 942 return;
943}
944