Add simple task for flow
authorrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 11:34:54 +0000 (11:34 +0000)
committerrbailhac <rbailhac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 11:34:54 +0000 (11:34 +0000)
PWGHF/CMakelibPWGHFhfe.pkg
PWGHF/PWGHFhfeLinkDef.h
PWGHF/hfe/AliAnalysisTaskHFEFlow.cxx
PWGHF/hfe/AliAnalysisTaskHFEFlowData.cxx [new file with mode: 0644]
PWGHF/hfe/AliAnalysisTaskHFEFlowData.h [new file with mode: 0644]
PWGHF/hfe/macros/AddTaskHFEtpctof.C
PWGHF/hfe/macros/AddTaskHFEtpctofv2.C

index fe77a44..03662ae 100644 (file)
@@ -83,6 +83,7 @@ set (SRCS
     hfe/AliHFEdebugTreeTask.cxx
     hfe/AliHFEVZEROEventPlane.cxx
     hfe/AliAnalysisTaskHFEFlow.cxx
+    hfe/AliAnalysisTaskHFEFlowData.cxx
     hfe/AliSelectNonHFE.cxx
     )
 
index 43e672f..ac45ece 100644 (file)
@@ -75,6 +75,7 @@
 
 #pragma link C++ class  AliHFEVZEROEventPlane+;
 #pragma link C++ class  AliAnalysisTaskHFEFlow+;
+#pragma link C++ class  AliAnalysisTaskHFEFlowData+;
 
 #pragma link C++ class  AliSelectNonHFE+;
 
index 3f2dc1d..559f802 100644 (file)
@@ -502,6 +502,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   //kPure - no mixing, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt\r
   //AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure;\r
   //AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure;\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlow: User create output objects");\r
  \r
   // AOD or ESD\r
   AliVEventHandler *inputHandler = dynamic_cast<AliVEventHandler *>(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
@@ -512,6 +514,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     SetAODAnalysis(kFALSE);\r
   }\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: AOD ESD");\r
 \r
   // RP TRACK CUTS:\r
   fcutsRP = AliFlowTrackCuts::GetStandardTPCStandaloneTrackCuts2010();\r
@@ -521,12 +524,16 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   //TList *qaCutsRP = fcutsRP->GetQA();\r
   //qaCutsRP->SetName("QA_StandartTPC_RP");\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: cutsRP");\r
+\r
   //POI TRACK CUTS:\r
   fcutsPOI = new AliFlowTrackCuts("dummy");\r
   fcutsPOI->SetParamType(AliFlowTrackCuts::kGlobal);\r
   fcutsPOI->SetPtRange(+1,-1); // select nothing QUICK\r
   fcutsPOI->SetEtaRange(+1,-1); // select nothing VZERO\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: cutsPOI");\r
+\r
   // Flow\r
   AliFlowCommonConstants* cc = AliFlowCommonConstants::GetMaster();\r
   cc->SetNbinsMult(10000);\r
@@ -545,6 +552,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   cc->SetQMin(0.0);\r
   cc->SetQMax(3.0);\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: common constants");\r
+\r
   \r
   // HFE cuts\r
 \r
@@ -555,6 +564,9 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fHFECuts->Initialize();\r
   if(fAODAnalysis) fHFECuts->SetAOD();  \r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: HFE cuts");\r
+\r
+\r
   // PID HFE\r
   //fPID->SetHasMCData(HasMCData());\r
   if(!fPID->GetNumberOfPIDdetectors()) fPID->AddDetector("TPC", 0);\r
@@ -562,10 +574,14 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fPIDqa->Initialize(fPID);\r
   fPID->SortDetectors();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: pid and pidqa");\r
+\r
   if(!fPIDTOFOnly->GetNumberOfPIDdetectors()) fPIDTOFOnly->AddDetector("TPC", 0);\r
   fPIDTOFOnly->InitializePID();\r
   fPIDTOFOnly->SortDetectors();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: pidtof");\r
+\r
   // HFE Background cuts\r
 \r
   if(!fHFEBackgroundCuts){\r
@@ -581,11 +597,15 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
      fHFEBackgroundCuts->SetPtRange(0.3,1e10);\r
   }\r
   \r
+  AliInfo("AliAnalysisTaskHFEFlow: hfe background");\r
+\r
   // PID background HFE\r
   if(!fPIDBackground->GetNumberOfPIDdetectors()) fPIDBackground->AddDetector("TPC", 0);\r
   fPIDBackground->InitializePID();\r
   fPIDBackgroundqa->Initialize(fPIDBackground);\r
   fPIDBackground->SortDetectors();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlow: pid background");\r
   \r
 \r
 \r
@@ -700,6 +720,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   Double_t maxInvMass = 0.3;\r
   Double_t binLimInvMass[nBinsInvMass+1];\r
   for(Int_t i=0; i<=nBinsInvMass; i++) binLimInvMass[i]=(Double_t)minInvMass + (maxInvMass-minInvMass)/nBinsInvMass*(Double_t)i ;\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlow: variables");\r
   \r
   //******************\r
   // Histograms\r
@@ -708,11 +730,15 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fListHist = new TList();\r
   fListHist->SetOwner();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: list");\r
+\r
   // Minimum histos\r
 \r
   // Histos\r
   fHistEV = new TH2D("fHistEV", "events", 3, 0, 3, 3, 0,3);\r
   \r
+  AliInfo("AliAnalysisTaskHFEFlow: histev");\r
+\r
   // Event plane as function of phiep, centrality\r
   const Int_t nDima=5;\r
   Int_t nBina[nDima] = {nBinsPhi,nBinsPhi,nBinsPhi,nBinsPhi,nBinsC};\r
@@ -724,6 +750,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fEventPlane->SetBinEdges(4,binLimC);\r
   fEventPlane->Sumw2();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: eventplane");\r
+\r
   // Resolution cosres_abc centrality\r
   const Int_t nDimfbis=4;\r
   Int_t nBinfbis[nDimfbis] = {nBinsCos,nBinsCos,nBinsCos,nBinsCMore};\r
@@ -734,6 +762,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fCosResabc->SetBinEdges(3,binLimCMore);\r
   fCosResabc->Sumw2();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: cosresabc");\r
+\r
   // Resolution cosres centrality\r
   const Int_t nDimf=2;\r
   Int_t nBinf[nDimf] = {nBinsCos, nBinsCMore};\r
@@ -742,6 +772,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fCosRes->SetBinEdges(1,binLimCMore);\r
   fCosRes->Sumw2();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: cosres");\r
+\r
   // Maps delta phi\r
   const Int_t nDimg=5;\r
   Int_t nBing[nDimg] = {nBinsPhi,nBinsC,nBinsPt, nBinsCharge,nBinsEtaLess};\r
@@ -753,6 +785,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fDeltaPhiMaps->SetBinEdges(4,binLimEtaLess);\r
   fDeltaPhiMaps->Sumw2();  \r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: deltaphimaps");\r
+\r
   // Maps cos phi\r
   const Int_t nDimh=5;\r
   Int_t nBinh[nDimh] = {nBinsCos,nBinsC,nBinsPt,nBinsCharge,nBinsEtaLess};\r
@@ -764,6 +798,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fCosPhiMaps->SetBinEdges(4,binLimEtaLess);\r
   fCosPhiMaps->Sumw2();\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: cosphimaps");\r
+\r
   //\r
   // fMonitorEventPlane\r
   //\r
@@ -777,6 +813,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fEventPlaneaftersubtraction->SetBinEdges(0,binLimPhi);\r
     fEventPlaneaftersubtraction->SetBinEdges(1,binLimC);\r
     fEventPlaneaftersubtraction->Sumw2();\r
+\r
+    AliInfo("AliAnalysisTaskHFEFlow: eventplane after sub");\r
     \r
     // Monitoring of the event Plane cos(2phi) sin(2phi) centrality\r
     const Int_t nDimi=3;\r
@@ -786,6 +824,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fCosSin2phiep->SetBinEdges(1,binLimCos);\r
     fCosSin2phiep->SetBinEdges(2,binLimCMore);\r
     fCosSin2phiep->Sumw2();\r
+\r
+    AliInfo("AliAnalysisTaskHFEFlow: cossin2phiep");\r
     \r
     // Monitoring Event plane after subtraction of the track\r
     const Int_t nDime=4;\r
@@ -796,30 +836,35 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fCos2phie->SetBinEdges(0,binLimCos);\r
     fCos2phie->SetBinEdges(1,binLimC);\r
     fCos2phie->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cos2phie");\r
     fSin2phie = new THnSparseF("sin2phie","sin2phie",nDime,nBine);\r
     fSin2phie->SetBinEdges(2,binLimPt);\r
     fSin2phie->SetBinEdges(3,binLimEta);\r
     fSin2phie->SetBinEdges(0,binLimCos);\r
     fSin2phie->SetBinEdges(1,binLimC);\r
     fSin2phie->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: sin2phie");\r
     fCos2phiep = new THnSparseF("cos2phiep","cos2phiep",nDime,nBine);\r
     fCos2phiep->SetBinEdges(2,binLimPt);\r
     fCos2phiep->SetBinEdges(3,binLimEta);\r
     fCos2phiep->SetBinEdges(0,binLimCos);\r
     fCos2phiep->SetBinEdges(1,binLimC);\r
     fCos2phiep->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cos2phiep");\r
     fSin2phiep = new THnSparseF("sin2phiep","sin2phiep",nDime,nBine);\r
     fSin2phiep->SetBinEdges(2,binLimPt);\r
     fSin2phiep->SetBinEdges(3,binLimEta);\r
     fSin2phiep->SetBinEdges(0,binLimCos);\r
     fSin2phiep->SetBinEdges(1,binLimC);\r
     fSin2phiep->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: sin2phiep");\r
     fSin2phiephiep = new THnSparseF("sin2phie_phiep","sin2phie_phiep",nDime,nBine);\r
     fSin2phiephiep->SetBinEdges(2,binLimPt);\r
     fSin2phiephiep->SetBinEdges(3,binLimEta);\r
     fSin2phiephiep->SetBinEdges(0,binLimCos);\r
     fSin2phiephiep->SetBinEdges(1,binLimC);\r
     fSin2phiephiep->Sumw2();  \r
+    AliInfo("AliAnalysisTaskHFEFlow: sin2phiephiep");\r
     \r
     const Int_t nDimfbiss=4;\r
     Int_t nBinfbiss[nDimfbiss] = {nBinsCos,nBinsCos,nBinsCos,nBinsC};\r
@@ -829,6 +874,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fSinResabc->SetBinEdges(2,binLimCos);\r
     fSinResabc->SetBinEdges(3,binLimC);\r
     fSinResabc->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: sinresabc");\r
     \r
     // Profile cosres centrality with 3 subevents\r
     fProfileCosResab = new TProfile("ProfileCosRes_a_b","ProfileCosRes_a_b",nBinsCMore,binLimCMore);\r
@@ -837,6 +883,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fProfileCosResac->Sumw2();\r
     fProfileCosResbc = new TProfile("ProfileCosRes_b_c","ProfileCosRes_b_c",nBinsCMore,binLimCMore);\r
     fProfileCosResbc->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: profilecosresbc");\r
     \r
     //\r
     const Int_t nDimff=2;\r
@@ -845,14 +892,17 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fSinRes->SetBinEdges(0,binLimCos);\r
     fSinRes->SetBinEdges(1,binLimC);\r
     fSinRes->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: sinres");\r
     \r
     // Profile cosres centrality\r
     fProfileCosRes = new TProfile("ProfileCosRes","ProfileCosRes",nBinsCMore,binLimCMore);\r
     fProfileCosRes->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: profilecosres");\r
     \r
     // Profile Maps cos phi\r
     fProfileCosPhiMaps = new TProfile2D("ProfileCosPhiMaps","ProfileCosPhiMaps",nBinsC,binLimC,nBinsPt,binLimPt);\r
     fProfileCosPhiMaps->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: profilecosphimaps");\r
 \r
   }\r
   //\r
@@ -867,6 +917,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fTrackingCuts->SetBinEdges(0,binLimPt);\r
     fTrackingCuts->SetBinEdges(1,binLimStep);\r
     fTrackingCuts->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: trackingcuts");\r
   }\r
 \r
   //\r
@@ -883,6 +934,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fDeltaPhiMapsContamination->SetBinEdges(2,binLimPt);\r
     fDeltaPhiMapsContamination->SetBinEdges(3,binLimTPCdEdx);\r
     fDeltaPhiMapsContamination->Sumw2();  \r
+    AliInfo("AliAnalysisTaskHFEFlow: deltaphimapscontamination");\r
   }\r
   //\r
   // fMonitorWithoutPID\r
@@ -898,6 +950,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fDeltaPhiMapsBeforePID->SetBinEdges(1,binLimC);\r
     fDeltaPhiMapsBeforePID->SetBinEdges(2,binLimPt);\r
     fDeltaPhiMapsBeforePID->Sumw2();  \r
+    AliInfo("AliAnalysisTaskHFEFlow: deltaphimapsbeforepid");\r
     \r
     const Int_t nDimhb=3;\r
     Int_t nBinhb[nDimhb] = {nBinsCos,nBinsC,nBinsPt};\r
@@ -907,6 +960,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fCosPhiMapsBeforePID->SetBinEdges(1,binLimC);\r
     fCosPhiMapsBeforePID->SetBinEdges(2,binLimPt);\r
     fCosPhiMapsBeforePID->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cosphimapsbeforepid");\r
   }\r
   //\r
   // fMonitorPhotonic\r
@@ -921,19 +975,22 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fDeltaPhiMapsTaggedPhotonic->SetBinEdges(1,binLimC);\r
     fDeltaPhiMapsTaggedPhotonic->SetBinEdges(2,binLimPt);\r
     fDeltaPhiMapsTaggedPhotonic->Sumw2();  \r
+    AliInfo("AliAnalysisTaskHFEFlow: deltaphimapstaggedphotonic");\r
     \r
     fDeltaPhiMapsTaggedNonPhotonic = new THnSparseF("DeltaPhiMapsTaggedNonPhotonic","DeltaPhiMapsTaggedNonPhotonic",nDimgbp,nBingbp);\r
     fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(0,binLimPhi);\r
     fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(1,binLimC);\r
     fDeltaPhiMapsTaggedNonPhotonic->SetBinEdges(2,binLimPt);\r
     fDeltaPhiMapsTaggedNonPhotonic->Sumw2();  \r
+    AliInfo("AliAnalysisTaskHFEFlow: deltaphimapstaggednonphotonic");\r
     \r
     fDeltaPhiMapsTaggedPhotonicLS = new THnSparseF("DeltaPhiMapsTaggedPhotonicLS","DeltaPhiMapsTaggedPhotonicLS",nDimgbp,nBingbp);\r
     fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(0,binLimPhi);\r
     fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(1,binLimC);\r
     fDeltaPhiMapsTaggedPhotonicLS->SetBinEdges(2,binLimPt);\r
     fDeltaPhiMapsTaggedPhotonicLS->Sumw2();  \r
-    \r
+    AliInfo("AliAnalysisTaskHFEFlow: deltaphimapstaggedphotonicls");    \r
+\r
     const Int_t nDimhbp=3;\r
     Int_t nBinhbp[nDimhbp] = {nBinsCos,nBinsC,nBinsPt};\r
     \r
@@ -942,18 +999,21 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fCosPhiMapsTaggedPhotonic->SetBinEdges(1,binLimC);\r
     fCosPhiMapsTaggedPhotonic->SetBinEdges(2,binLimPt);\r
     fCosPhiMapsTaggedPhotonic->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cosphimapstaggedphotonic");\r
     \r
     fCosPhiMapsTaggedNonPhotonic = new THnSparseF("CosPhiMapsTaggedNonPhotonic","CosPhiMapsTaggedNonPhotonic",nDimhbp,nBinhbp);\r
     fCosPhiMapsTaggedNonPhotonic->SetBinEdges(0,binLimCos);\r
     fCosPhiMapsTaggedNonPhotonic->SetBinEdges(1,binLimC);\r
     fCosPhiMapsTaggedNonPhotonic->SetBinEdges(2,binLimPt);\r
     fCosPhiMapsTaggedNonPhotonic->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cosphimapstaggednonphotonic");\r
     \r
     fCosPhiMapsTaggedPhotonicLS = new THnSparseF("CosPhiMapsTaggedPhotonicLS","CosPhiMapsTaggedPhotonicLS",nDimhbp,nBinhbp);\r
     fCosPhiMapsTaggedPhotonicLS->SetBinEdges(0,binLimCos);\r
     fCosPhiMapsTaggedPhotonicLS->SetBinEdges(1,binLimC);\r
     fCosPhiMapsTaggedPhotonicLS->SetBinEdges(2,binLimPt);\r
     fCosPhiMapsTaggedPhotonicLS->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: cosphimapstaggedphotonicls");\r
     \r
     const Int_t nDimMCSource=3;\r
     Int_t nBinMCSource[nDimMCSource] = {nBinsC,nBinsPt,nBinsSource};\r
@@ -962,6 +1022,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fMCSourceDeltaPhiMaps->SetBinEdges(1,binLimPt);\r
     fMCSourceDeltaPhiMaps->SetBinEdges(2,binLimSource);\r
     fMCSourceDeltaPhiMaps->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: mcsourcedeltaphimaps");\r
     \r
     // Maps invmass opposite\r
     const Int_t nDimOppSign=5;\r
@@ -973,6 +1034,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fOppSignDeltaPhiMaps->SetBinEdges(3,binLimInvMass);\r
     fOppSignDeltaPhiMaps->SetBinEdges(4,binLimSource);\r
     fOppSignDeltaPhiMaps->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: oppsigndeltaphimaps");\r
     \r
     // Maps invmass same sign\r
     const Int_t nDimSameSign=5;\r
@@ -984,6 +1046,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fSameSignDeltaPhiMaps->SetBinEdges(3,binLimInvMass);\r
     fSameSignDeltaPhiMaps->SetBinEdges(4,binLimSource);\r
     fSameSignDeltaPhiMaps->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: samesigndeltaphimaps");\r
     \r
     // Maps angle same sign\r
     const Int_t nDimAngleSameSign=3;\r
@@ -993,6 +1056,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fSameSignAngle->SetBinEdges(1,binLimC);\r
     fSameSignAngle->SetBinEdges(2,binLimSource);\r
     fSameSignAngle->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: samesignangle");\r
     \r
     // Maps angle opp sign\r
     const Int_t nDimAngleOppSign=3;\r
@@ -1002,6 +1066,8 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fOppSignAngle->SetBinEdges(1,binLimC);\r
     fOppSignAngle->SetBinEdges(2,binLimSource);\r
     fOppSignAngle->Sumw2();\r
+    AliInfo("AliAnalysisTaskHFEFlow: oppsignangle");\r
+\r
   }\r
 \r
   //**************************\r
@@ -1015,6 +1081,7 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fListHist->Add(fCosPhiMaps);\r
   fListHist->Add(fDeltaPhiMaps);\r
   fListHist->Add(fPIDqa->MakeList("HFEpidQA"));\r
+  AliInfo("AliAnalysisTaskHFEFlow: add default");\r
 \r
   if(fMonitorEventPlane) {\r
     fListHist->Add(fProfileCosRes);\r
@@ -1031,16 +1098,23 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
     fListHist->Add(fSinResabc);\r
     fListHist->Add(fProfileCosPhiMaps);\r
   }\r
+  AliInfo("AliAnalysisTaskHFEFlow: add monitor");\r
 \r
   if(fMonitorTrackCuts) fListHist->Add(fTrackingCuts);\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: add monitortrackcuts");\r
+\r
   if(fMonitorContamination) fListHist->Add(fDeltaPhiMapsContamination);\r
   \r
+  AliInfo("AliAnalysisTaskHFEFlow: add deltaphimapscontamination");\r
+\r
   if(fMonitorWithoutPID) {\r
     fListHist->Add(fDeltaPhiMapsBeforePID);\r
     fListHist->Add(fCosPhiMapsBeforePID);\r
   }\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: add without pid");\r
+\r
   if(fMonitorPhotonic) {\r
   fListHist->Add(fPIDBackgroundqa->MakeList("HFEpidBackgroundQA"));\r
   fListHist->Add(fDeltaPhiMapsTaggedPhotonic);\r
@@ -1056,11 +1130,16 @@ void AliAnalysisTaskHFEFlow::UserCreateOutputObjects()
   fListHist->Add(fOppSignAngle);\r
   }\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: add photonic");\r
+\r
   if(fHFEVZEROEventPlane && fMonitorEventPlane) fListHist->Add(fHFEVZEROEventPlane->GetOutputList());\r
   \r
+  AliInfo("AliAnalysisTaskHFEFlow: add event plane");\r
 \r
   PostData(1, fListHist);\r
 \r
+  AliInfo("AliAnalysisTaskHFEFlow: post");\r
+\r
 \r
 }\r
    \r
diff --git a/PWGHF/hfe/AliAnalysisTaskHFEFlowData.cxx b/PWGHF/hfe/AliAnalysisTaskHFEFlowData.cxx
new file mode 100644 (file)
index 0000000..0ea221d
--- /dev/null
@@ -0,0 +1,736 @@
+/**************************************************************************\r
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+*                                                                        *\r
+* Author: The ALICE Off-line Project.                                    *\r
+* Contributors are mentioned in the code where appropriate.              *\r
+*                                                                        *\r
+* Permission to use, copy, modify and distribute this software and its   *\r
+* documentation strictly for non-commercial purposes is hereby granted   *\r
+* without fee, provided that the above copyright notice appears in all   *\r
+* copies and that both the copyright notice and this permission notice   *\r
+* appear in the supporting documentation. The authors make no claims     *\r
+* about the suitability of this software for any purpose. It is          *\r
+* provided "as is" without express or implied warranty.                  *\r
+**************************************************************************/\r
+//\r
+// Flow task\r
+// \r
+// Authors:\r
+//   Raphaelle Bailhache <R.Bailhache@gsi.de>\r
+//\r
+#include "TROOT.h"\r
+#include "TH1D.h"\r
+#include "TH2D.h"\r
+#include "TChain.h"\r
+#include "TVector2.h"\r
+#include "THnSparse.h"\r
+#include "TMath.h"\r
+#include "TRandom3.h"\r
+#include "TProfile.h"\r
+#include "TProfile2D.h"\r
+\r
+#include "AliVEventHandler.h"\r
+#include "AliAnalysisTaskSE.h"\r
+#include "AliAnalysisManager.h"\r
+\r
+#include "AliVEvent.h"\r
+#include "AliESDInputHandler.h"\r
+#include "AliMCEvent.h"\r
+#include "AliESD.h"\r
+#include "AliESDEvent.h"\r
+#include "AliPIDResponse.h"\r
+#include "AliESDVZERO.h"\r
+#include "AliESDUtils.h"\r
+#include "AliMCParticle.h"\r
+#include "AliVTrack.h"\r
+#include "AliAODTrack.h"\r
+\r
+#include "AliFlowCandidateTrack.h"\r
+#include "AliFlowEvent.h"\r
+#include "AliFlowTrackCuts.h"\r
+#include "AliFlowVector.h"\r
+#include "AliFlowCommonConstants.h"\r
+\r
+#include "AliHFEcuts.h"\r
+#include "AliHFEpid.h"\r
+#include "AliHFEpidQAmanager.h"\r
+#include "AliHFEtools.h"\r
+#include "AliHFEVZEROEventPlane.h"\r
+\r
+#include "AliCentrality.h"\r
+#include "AliEventplane.h"\r
+#include "AliAnalysisTaskHFEFlowData.h"\r
+\r
+\r
+//____________________________________________________________________\r
+AliAnalysisTaskHFEFlowData::AliAnalysisTaskHFEFlowData() :\r
+  AliAnalysisTaskSE(),\r
+  fListHist(0x0), \r
+  fAODAnalysis(kFALSE),\r
+  fUseFlagAOD(kFALSE),\r
+  fApplyCut(kTRUE),\r
+  fFlags(1<<4),\r
+  fVZEROEventPlane(kFALSE),\r
+  fVZEROEventPlaneA(kFALSE),\r
+  fVZEROEventPlaneC(kFALSE),\r
+  fSubEtaGapTPC(kFALSE),\r
+  fEtaGap(0.0),\r
+  fDebugLevel(0),\r
+  fHFECuts(0),\r
+  fPID(0),\r
+  fPIDqa(0),\r
+  fHistEV(0),\r
+  fEventPlane(0x0),\r
+  fCosResabc(0x0),\r
+  fCosRes(0x0),\r
+  fDeltaPhiMaps(0x0),\r
+  fCosPhiMaps(0x0)\r
+{\r
+  // Constructor\r
+\r
+  \r
+}\r
+//______________________________________________________________________________\r
+AliAnalysisTaskHFEFlowData:: AliAnalysisTaskHFEFlowData(const char *name) :\r
+  AliAnalysisTaskSE(name),\r
+  fListHist(0x0),\r
+  fAODAnalysis(kFALSE),\r
+  fUseFlagAOD(kFALSE),\r
+  fApplyCut(kTRUE),\r
+  fFlags(1<<4), \r
+  fVZEROEventPlane(kFALSE),\r
+  fVZEROEventPlaneA(kFALSE),\r
+  fVZEROEventPlaneC(kFALSE),\r
+  fSubEtaGapTPC(kFALSE),\r
+  fEtaGap(0.0),\r
+  fDebugLevel(0),\r
+  fHFECuts(0),\r
+  fPID(0),\r
+  fPIDqa(0),\r
+  fHistEV(0),\r
+  fEventPlane(0x0),\r
+  fCosResabc(0x0),\r
+  fCosRes(0x0),\r
+  fDeltaPhiMaps(0x0),\r
+  fCosPhiMaps(0x0)\r
+{\r
+  //\r
+  // named ctor\r
+  //\r
+  \r
+  fPID = new AliHFEpid("hfePid");\r
+  fPIDqa = new AliHFEpidQAmanager;\r
+\r
+  DefineInput(0,TChain::Class());\r
+  DefineOutput(1, TList::Class());\r
+   \r
+}\r
+//____________________________________________________________\r
+AliAnalysisTaskHFEFlowData::AliAnalysisTaskHFEFlowData(const AliAnalysisTaskHFEFlowData &ref):\r
+  AliAnalysisTaskSE(ref),\r
+  fListHist(0x0),\r
+  fAODAnalysis(ref.fAODAnalysis), \r
+  fUseFlagAOD(ref.fUseFlagAOD),\r
+  fApplyCut(ref.fApplyCut),\r
+  fFlags(ref.fFlags),\r
+  fVZEROEventPlane(ref.fVZEROEventPlane),\r
+  fVZEROEventPlaneA(ref.fVZEROEventPlaneA),\r
+  fVZEROEventPlaneC(ref.fVZEROEventPlaneC),\r
+  fSubEtaGapTPC(ref.fSubEtaGapTPC),\r
+  fEtaGap(ref.fEtaGap),\r
+  fDebugLevel(ref.fDebugLevel),\r
+  fHFECuts(0),\r
+  fPID(0),\r
+  fPIDqa(0),\r
+  fHistEV(0),\r
+  fEventPlane(0x0),\r
+  fCosResabc(0x0),\r
+  fCosRes(0x0),\r
+  fDeltaPhiMaps(0x0),\r
+  fCosPhiMaps(0x0)\r
+{\r
+  //\r
+  // Copy Constructor\r
+  //\r
+  ref.Copy(*this);\r
+}\r
+\r
+//____________________________________________________________\r
+AliAnalysisTaskHFEFlowData &AliAnalysisTaskHFEFlowData::operator=(const AliAnalysisTaskHFEFlowData &ref){\r
+  //\r
+  // Assignment operator\r
+  //\r
+  if(this == &ref) \r
+    ref.Copy(*this);\r
+  return *this;\r
+}\r
+\r
+//____________________________________________________________\r
+void AliAnalysisTaskHFEFlowData::Copy(TObject &o) const {\r
+  // \r
+  // Copy into object o\r
+  //\r
+  AliAnalysisTaskHFEFlowData &target = dynamic_cast<AliAnalysisTaskHFEFlowData &>(o);\r
+  target.fAODAnalysis = fAODAnalysis;\r
+  target.fUseFlagAOD = fUseFlagAOD;\r
+  target.fApplyCut = fApplyCut;\r
+  target.fFlags = fFlags;\r
+  target.fVZEROEventPlane = fVZEROEventPlane;\r
+  target.fVZEROEventPlaneA = fVZEROEventPlaneA;\r
+  target.fVZEROEventPlaneC = fVZEROEventPlaneC;\r
+  target.fSubEtaGapTPC = fSubEtaGapTPC;\r
+  target.fEtaGap = fEtaGap;\r
+  target.fDebugLevel = fDebugLevel;\r
+  target.fHFECuts = fHFECuts;\r
+  target.fPID = fPID;\r
+  target.fPIDqa = fPIDqa;\r
+  \r
+}\r
+//____________________________________________________________\r
+AliAnalysisTaskHFEFlowData::~AliAnalysisTaskHFEFlowData(){\r
+  //\r
+  // Destructor\r
+  //\r
+  if(fListHist) delete fListHist;\r
+  if(fHFECuts) delete fHFECuts;\r
+  if(fPID) delete fPID;\r
+  if(fPIDqa) delete fPIDqa;\r
\r
+\r
+}\r
+//________________________________________________________________________\r
+void AliAnalysisTaskHFEFlowData::UserCreateOutputObjects()\r
+{\r
+\r
+  //********************\r
+  // Create histograms\r
+  //********************\r
+\r
+  //**************\r
+  // Cuts\r
+  //**************\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: create output objects");\r
+\r
+  // HFE cuts\r
+\r
+  if(!fHFECuts){\r
+    fHFECuts = new AliHFEcuts;\r
+    fHFECuts->CreateStandardCuts();\r
+  }\r
+  fHFECuts->Initialize();\r
+  if(fAODAnalysis) fHFECuts->SetAOD();  \r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: HFE cuts initialize");\r
+\r
+  // PID HFE\r
+  //fPID->SetHasMCData(HasMCData());\r
+  if(!fPID->GetNumberOfPIDdetectors()) fPID->AddDetector("TPC", 0);\r
+  fPID->InitializePID();\r
+  fPIDqa->Initialize(fPID);\r
+  fPID->SortDetectors();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: pid and pidqa");\r
+  \r
+  //**************************\r
+  // Bins for the THnSparse\r
+  //**************************\r
+\r
+  Int_t nBinsPt = 24;\r
+  Double_t binLimPt[25] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2,\r
+                          1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 3., 3.5, 4., 5.,\r
+                          6.};\r
+  \r
+  Int_t nBinsEtaLess = 2;\r
+  Double_t minEta = -0.8;\r
+  Double_t maxEta = 0.8;\r
+  Double_t binLimEtaLess[nBinsEtaLess+1];\r
+  for(Int_t i=0; i<=nBinsEtaLess; i++) binLimEtaLess[i]=(Double_t)minEta + (maxEta-minEta)/nBinsEtaLess*(Double_t)i ;\r
\r
+  Int_t nBinsCos = 50;\r
+  Double_t minCos = -1.0;\r
+  Double_t maxCos = 1.0;\r
+  Double_t binLimCos[nBinsCos+1];\r
+  for(Int_t i=0; i<=nBinsCos; i++) binLimCos[i]=(Double_t)minCos + (maxCos-minCos)/nBinsCos*(Double_t)i ;\r
\r
+  Int_t nBinsC = 11;\r
+  Double_t minC = 0.0;\r
+  Double_t maxC = 11.0;\r
+  Double_t binLimC[nBinsC+1];\r
+  for(Int_t i=0; i<=nBinsC; i++) binLimC[i]=(Double_t)minC + (maxC-minC)/nBinsC*(Double_t)i ;\r
+\r
+  Int_t nBinsCMore = 20;\r
+  Double_t minCMore = 0.0;\r
+  Double_t maxCMore = 20.0;\r
+  Double_t binLimCMore[nBinsCMore+1];\r
+  for(Int_t i=0; i<=nBinsCMore; i++) binLimCMore[i]=(Double_t)minCMore + (maxCMore-minCMore)/nBinsCMore*(Double_t)i ;\r
+\r
+  Int_t nBinsPhi = 25;\r
+  Double_t minPhi = 0.0;\r
+  Double_t maxPhi = TMath::Pi();\r
+  Double_t binLimPhi[nBinsPhi+1];\r
+  for(Int_t i=0; i<=nBinsPhi; i++) {\r
+    binLimPhi[i]=(Double_t)minPhi + (maxPhi-minPhi)/nBinsPhi*(Double_t)i ;\r
+  }\r
+\r
+  Int_t nBinsCharge = 2;\r
+  Double_t minCharge = -1.0;\r
+  Double_t maxCharge = 1.0;\r
+  Double_t binLimCharge[nBinsCharge+1];\r
+  for(Int_t i=0; i<=nBinsCharge; i++) binLimCharge[i]=(Double_t)minCharge + (maxCharge-minCharge)/nBinsCharge*(Double_t)i ;\r
+  \r
+  AliInfo("AliAnalysisTaskHFEFlowData: array of bins");\r
+\r
+  //******************\r
+  // Histograms\r
+  //******************\r
+    \r
+  fListHist = new TList();\r
+  fListHist->SetOwner();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: list created");\r
+  \r
+  // Histos\r
+  fHistEV = new TH2D("fHistEV", "events", 3, 0, 3, 3, 0,3);\r
+  \r
+  AliInfo("AliAnalysisTaskHFEFlowData: fHistEv");\r
+\r
+  // Event plane as function of phiep, centrality\r
+  const Int_t nDima=5;\r
+  Int_t nBina[nDima] = {nBinsPhi,nBinsPhi,nBinsPhi,nBinsPhi,nBinsC};\r
+  fEventPlane = new THnSparseF("EventPlane","EventPlane",nDima,nBina);\r
+  fEventPlane->SetBinEdges(0,binLimPhi);\r
+  fEventPlane->SetBinEdges(1,binLimPhi);\r
+  fEventPlane->SetBinEdges(2,binLimPhi);\r
+  fEventPlane->SetBinEdges(3,binLimPhi);\r
+  fEventPlane->SetBinEdges(4,binLimC);\r
+  fEventPlane->Sumw2();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: fEventPlane");\r
+  \r
+  // Resolution cosres_abc centrality\r
+  const Int_t nDimfbis=4;\r
+  Int_t nBinfbis[nDimfbis] = {nBinsCos,nBinsCos,nBinsCos,nBinsCMore};\r
+  fCosResabc = new THnSparseF("CosRes_abc","CosRes_abc",nDimfbis,nBinfbis);\r
+  fCosResabc->SetBinEdges(0,binLimCos);\r
+  fCosResabc->SetBinEdges(1,binLimCos);\r
+  fCosResabc->SetBinEdges(2,binLimCos);\r
+  fCosResabc->SetBinEdges(3,binLimCMore);\r
+  fCosResabc->Sumw2();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: fCosResabc");\r
+\r
+  // Resolution cosres centrality\r
+  const Int_t nDimf=2;\r
+  Int_t nBinf[nDimf] = {nBinsCos, nBinsCMore};\r
+  fCosRes = new THnSparseF("CosRes","CosRes",nDimf,nBinf);\r
+  fCosRes->SetBinEdges(0,binLimCos);\r
+  fCosRes->SetBinEdges(1,binLimCMore);\r
+  fCosRes->Sumw2();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: fCosRes");\r
+  \r
+  // Maps delta phi\r
+  const Int_t nDimg=5;\r
+  Int_t nBing[nDimg] = {nBinsPhi,nBinsC,nBinsPt, nBinsCharge,nBinsEtaLess};\r
+  fDeltaPhiMaps = new THnSparseF("DeltaPhiMaps","DeltaPhiMaps",nDimg,nBing);\r
+  fDeltaPhiMaps->SetBinEdges(0,binLimPhi);\r
+  fDeltaPhiMaps->SetBinEdges(1,binLimC);\r
+  fDeltaPhiMaps->SetBinEdges(2,binLimPt);\r
+  fDeltaPhiMaps->SetBinEdges(3,binLimCharge);\r
+  fDeltaPhiMaps->SetBinEdges(4,binLimEtaLess);\r
+  fDeltaPhiMaps->Sumw2();  \r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: fDeltaPhiMaps");\r
+\r
+  // Maps cos phi\r
+  const Int_t nDimh=5;\r
+  Int_t nBinh[nDimh] = {nBinsCos,nBinsC,nBinsPt,nBinsCharge,nBinsEtaLess};\r
+  fCosPhiMaps = new THnSparseF("CosPhiMaps","CosPhiMaps",nDimh,nBinh);\r
+  fCosPhiMaps->SetBinEdges(0,binLimCos);\r
+  fCosPhiMaps->SetBinEdges(1,binLimC);\r
+  fCosPhiMaps->SetBinEdges(2,binLimPt);\r
+  fCosPhiMaps->SetBinEdges(3,binLimCharge);\r
+  fCosPhiMaps->SetBinEdges(4,binLimEtaLess);\r
+  fCosPhiMaps->Sumw2();\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: fCosPhiMaps");\r
+\r
+  //**************************\r
+  // Add to the list\r
+  //******************************\r
+\r
+  //fListHist->Add(qaCutsRP);\r
+  fListHist->Add(fPIDqa->MakeList("HFEpidQA"));\r
+  fListHist->Add(fHistEV);\r
+  fListHist->Add(fEventPlane);\r
+  fListHist->Add(fCosRes);\r
+  fListHist->Add(fCosResabc);\r
+  fListHist->Add(fDeltaPhiMaps);\r
+  fListHist->Add(fCosPhiMaps);\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: added to the list");\r
+  \r
+  \r
+  PostData(1, fListHist);\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: Post Data");\r
+\r
+}\r
+   \r
+//________________________________________________________________________\r
+void AliAnalysisTaskHFEFlowData::UserExec(Option_t */*option*/)\r
+{\r
+  //\r
+  // Loop over event\r
+  //\r
+\r
+  AliInfo("AliAnalysisTaskHFEFlowData: UserExec");\r
+   \r
+  Float_t cntr = 0.0;\r
+  Double_t binct = 11.5;\r
+  Double_t binctMore = 20.5;\r
+  Float_t binctt = -1.0;\r
+  \r
+  Double_t valuensparsea[5];\r
+  Double_t valuensparsefbis[4];\r
+  Double_t valuensparsef[2];\r
+  Double_t valuensparseg[5];\r
+  Double_t valuensparseh[5];\r
+\r
+  AliDebug(1, "Variable initialized");\r
+\r
+  \r
+  /////////////////\r
+  // centrality\r
+  /////////////////\r
+  \r
+  //AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());\r
+  //if(!esd) return;\r
+  AliCentrality *centrality = fInputEvent->GetCentrality();\r
+  //printf("Got the centrality\n");\r
+  if(!centrality) {\r
+    PostData(1, fListHist);\r
+    return;\r
+  }\r
+  cntr = centrality->GetCentralityPercentile("V0M");\r
+  if((0.0< cntr) && (cntr<5.0)) binct = 0.5;\r
+  if((5.0< cntr) && (cntr<10.0)) binct = 1.5;\r
+  if((10.0< cntr) && (cntr<20.0)) binct = 2.5;\r
+  if((20.0< cntr) && (cntr<30.0)) binct = 3.5;\r
+  if((30.0< cntr) && (cntr<40.0)) binct = 4.5;\r
+  if((40.0< cntr) && (cntr<50.0)) binct = 5.5;\r
+  if((50.0< cntr) && (cntr<60.0)) binct = 6.5;\r
+  if((60.0< cntr) && (cntr<70.0)) binct = 7.5;\r
+  if((70.0< cntr) && (cntr<80.0)) binct = 8.5;\r
+  if((80.0< cntr) && (cntr<90.0)) binct = 9.5;\r
+  if((90.0< cntr) && (cntr<100.0)) binct = 10.5;\r
+  \r
+  if((0.< cntr) && (cntr < 20.)) binctt = 0.5;\r
+  if((20.< cntr) && (cntr < 40.)) binctt = 1.5;\r
+  if((40.< cntr) && (cntr < 80.)) binctt = 2.5;\r
+\r
+  if((0.0< cntr) && (cntr<5.0)) binctMore = 0.5;\r
+  if((5.0< cntr) && (cntr<10.0)) binctMore = 1.5;\r
+  if((10.0< cntr) && (cntr<15.0)) binctMore = 2.5;\r
+  if((15.0< cntr) && (cntr<20.0)) binctMore = 3.5;\r
+  if((20.0< cntr) && (cntr<25.0)) binctMore = 4.5;\r
+  if((25.0< cntr) && (cntr<30.0)) binctMore = 5.5;\r
+  if((30.0< cntr) && (cntr<35.0)) binctMore = 6.5;\r
+  if((35.0< cntr) && (cntr<40.0)) binctMore = 7.5;\r
+  if((40.0< cntr) && (cntr<45.0)) binctMore = 8.5;\r
+  if((45.0< cntr) && (cntr<50.0)) binctMore = 9.5;\r
+  if((50.0< cntr) && (cntr<55.0)) binctMore = 10.5;\r
+  if((55.0< cntr) && (cntr<60.0)) binctMore = 11.5;\r
+  if((60.0< cntr) && (cntr<65.0)) binctMore = 12.5;\r
+  if((65.0< cntr) && (cntr<70.0)) binctMore = 13.5;\r
+  if((70.0< cntr) && (cntr<75.0)) binctMore = 14.5;\r
+  if((75.0< cntr) && (cntr<80.0)) binctMore = 15.5;\r
+  if((80.0< cntr) && (cntr<85.0)) binctMore = 16.5;\r
+  if((85.0< cntr) && (cntr<90.0)) binctMore = 17.5;\r
+  if((90.0< cntr) && (cntr<95.0)) binctMore = 18.5;\r
+  if((95.0< cntr) && (cntr<100.0)) binctMore = 19.5;\r
+\r
+  \r
+  if(binct > 11.0) {\r
+    PostData(1, fListHist);\r
+    return;\r
+  }\r
\r
+  AliDebug(1, "Centrality");\r
+\r
+  // centrality\r
+  valuensparsea[4] = binct;  \r
+  valuensparsef[1] = binctMore;  \r
+  valuensparsefbis[3] = binctMore;  \r
+  valuensparseg[1] = binct;\r
+  valuensparseh[1] = binct; \r
+  \r
+  //////////////////////\r
+  // run number\r
+  //////////////////////\r
+\r
+  Int_t runnumber = fInputEvent->GetRunNumber();\r
+  \r
+  if(!fPID->IsInitialized()){\r
+    fPID->InitializePID(runnumber);\r
+  }\r
+\r
+  AliDebug(1, "Run number");\r
+\r
+  //////////\r
+  // PID\r
+  //////////\r
\r
+  AliPIDResponse *pidResponse = fInputHandler->GetPIDResponse();\r
+  if(!pidResponse){\r
+    PostData(1, fListHist);\r
+    return;\r
+  }\r
+  fPID->SetPIDResponse(pidResponse);\r
+\r
+  AliDebug(1, "PID");\r
+\r
+  fHistEV->Fill(binctt,0.0);\r
\r
+  AliDebug(1, "fHistEv");\r
+\r
+  //////////////////\r
+  // Event cut\r
+  //////////////////\r
+  if(!fHFECuts->CheckEventCuts("fEvRecCuts", fInputEvent)) {\r
+    PostData(1, fListHist);\r
+    return;\r
+  }\r
+\r
+  AliDebug(1, "Event cut");\r
+\r
+  fHistEV->Fill(binctt,1.0);\r
+\r
+  ////////////////////////////////////  \r
+  // First method event plane\r
+  ////////////////////////////////////\r
+\r
+  AliEventplane* vEPa = fInputEvent->GetEventplane();\r
+  Float_t eventPlanea = 0.0;\r
+  Float_t eventPlaneTPC = 0.0;\r
+  Float_t eventPlaneV0A = 0.0;\r
+  Float_t eventPlaneV0C = 0.0;\r
+  Float_t eventPlaneV0 = 0.0;\r
+  TVector2 *standardQ = 0x0;\r
+  TVector2 *qsub1a = 0x0;\r
+  TVector2 *qsub2a = 0x0;\r
+\r
+  // V0\r
+\r
+  eventPlaneV0 = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0", fInputEvent,2));\r
+  if(eventPlaneV0 > TMath::Pi()) eventPlaneV0 = eventPlaneV0 - TMath::Pi();\r
+  eventPlaneV0A = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0A", fInputEvent,2));\r
+  if(eventPlaneV0A > TMath::Pi()) eventPlaneV0A = eventPlaneV0A - TMath::Pi();\r
+  eventPlaneV0C = TVector2::Phi_0_2pi(vEPa->GetEventplane("V0C", fInputEvent,2));\r
+  if(eventPlaneV0C > TMath::Pi()) eventPlaneV0C = eventPlaneV0C - TMath::Pi();\r
+  \r
+  AliDebug(1, "V0 event plane");\r
+  \r
+  // TPC\r
+\r
+  standardQ = vEPa->GetQVector(); \r
+  Double_t qx = -1.0;\r
+  Double_t qy = -1.0;\r
+  if(standardQ) {\r
+    qx = standardQ->X();\r
+    qy = standardQ->Y();\r
+  }  \r
+  TVector2 qVectorfortrack;\r
+  qVectorfortrack.Set(qx,qy);\r
+  eventPlaneTPC = TVector2::Phi_0_2pi(qVectorfortrack.Phi())/2.; \r
+\r
+  AliDebug(1, "TPC event plane");\r
+\r
+  // Choose the one used for v2\r
+\r
+  if(fVZEROEventPlane) eventPlanea = eventPlaneV0;\r
+  if(fVZEROEventPlaneA) eventPlanea = eventPlaneV0A;\r
+  if(fVZEROEventPlaneC) eventPlanea = eventPlaneV0C;\r
+  if(!fVZEROEventPlane) eventPlanea = eventPlaneTPC;\r
+\r
+  Float_t eventPlanesub1a = -100.0;\r
+  Float_t eventPlanesub2a = -100.0;\r
+  Double_t diffsub1sub2a = -100.0;\r
+  Double_t diffsubasubb = -100.0;\r
+  Double_t diffsubasubc = -100.0;\r
+  Double_t diffsubbsubc = -100.0;\r
+  \r
+  diffsubasubb = TMath::Cos(2.*(eventPlaneV0A - eventPlaneV0C));\r
+  diffsubasubc = TMath::Cos(2.*(eventPlaneV0A - eventPlaneTPC));\r
+  diffsubbsubc = TMath::Cos(2.*(eventPlaneV0C - eventPlaneTPC));\r
+  \r
+  qsub1a = vEPa->GetQsub1();\r
+  qsub2a = vEPa->GetQsub2();\r
+  if(qsub1a) eventPlanesub1a = TVector2::Phi_0_2pi(qsub1a->Phi())/2.;\r
+  if(qsub2a) eventPlanesub2a = TVector2::Phi_0_2pi(qsub2a->Phi())/2.;\r
+  if(qsub1a && qsub2a) {\r
+    diffsub1sub2a = TMath::Cos(2.*TVector2::Phi_0_2pi(qsub1a->Phi()/2.- qsub2a->Phi()/2.));\r
+  }\r
+\r
+  AliDebug(1, "Diff");\r
+  \r
+  /////////////////////////////////////////////////////////\r
+  // Cut for event with event plane reconstructed by all\r
+  ////////////////////////////////////////////////////////\r
+  \r
+  if((!standardQ) || (!qsub1a) || (!qsub2a)) {\r
+    PostData(1, fListHist);\r
+    return;\r
+  }\r
+\r
+  AliDebug(1, "Number of tracks");\r
+  \r
+  Int_t nbtracks = fInputEvent->GetNumberOfTracks();\r
+  \r
+  //////////////////////\r
+  // Fill Histos\r
+  //////////////////////\r
+\r
+  fHistEV->Fill(binctt,2.0);\r
+  \r
+  // Fill\r
+  valuensparsea[0] = eventPlaneV0A;\r
+  valuensparsea[1] = eventPlaneV0C;\r
+  valuensparsea[2] = eventPlaneTPC;\r
+  valuensparsea[3] = eventPlaneV0;  \r
+  fEventPlane->Fill(&valuensparsea[0]);\r
+  \r
+  if(!fVZEROEventPlane) {\r
+    valuensparsef[0] = diffsub1sub2a;\r
+    fCosRes->Fill(&valuensparsef[0]);\r
+  }\r
+  else {\r
+    valuensparsefbis[0] = diffsubasubb;\r
+    valuensparsefbis[1] = diffsubbsubc;\r
+    valuensparsefbis[2] = diffsubasubc;\r
+    fCosResabc->Fill(&valuensparsefbis[0]);\r
+  }\r
+    \r
+  \r
+  //////////////////////////\r
+  // Loop over ESD track\r
+  //////////////////////////\r
\r
+  AliDebug(1, "Loop tracks");\r
+\r
+  for(Int_t k = 0; k < nbtracks; k++){\r
+    \r
+    AliVTrack *track = (AliVTrack *) fInputEvent->GetTrack(k);\r
+    if(!track) continue;\r
+\r
+    if(fAODAnalysis) {\r
+      AliAODTrack *aodtrack = dynamic_cast<AliAODTrack *>(track);\r
+      if(!aodtrack){\r
+       AliError("AOD track is not there");\r
+       PostData(1, fListHist);\r
+       return;\r
+      }  \r
+      //printf("Find AOD track on\n");\r
+      if(fUseFlagAOD){\r
+       if(aodtrack->GetFlags() != fFlags) continue;  // Only process AOD tracks where the HFE is set\r
+      }\r
+    }\r
+    \r
+    if(fApplyCut) {\r
+      Bool_t survived = kTRUE;\r
+      for(Int_t icut = AliHFEcuts::kStepRecKineITSTPC; icut <= AliHFEcuts::kStepHFEcutsTRD; icut++){\r
+       if(!fHFECuts->CheckParticleCuts(icut + AliHFEcuts::kNcutStepsMCTrack, (TObject *)track)){\r
+         survived = kFALSE;\r
+         break;\r
+       }\r
+      }\r
+      if(!survived) continue;\r
+    }\r
+    \r
+    // Apply PID\r
+    AliHFEpidObject hfetrack;\r
+    if(!fAODAnalysis) hfetrack.SetAnalysisType(AliHFEpidObject::kESDanalysis);\r
+    else hfetrack.SetAnalysisType(AliHFEpidObject::kAODanalysis);\r
+    hfetrack.SetRecTrack(track);\r
+    hfetrack.SetCentrality((Int_t)binct);\r
+    hfetrack.SetPbPb();\r
+    if(!fPID->IsSelected(&hfetrack,0x0,"recTrackCont",fPIDqa)) {\r
+      continue;\r
+    }\r
+    \r
+    /////////////////////////////////////////////////////////\r
+    // Subtract electron candidate from TPC event plane\r
+    ////////////////////////////////////////////////////////\r
+    Float_t eventplanesubtracted = 0.0;    \r
+\r
+    if(!fVZEROEventPlane) {\r
+      // Subtract the tracks from the event plane\r
+      Double_t qX = standardQ->X() - vEPa->GetQContributionX(track);  //Modify the components: subtract the track you want to look at with your analysis\r
+      Double_t qY = standardQ->Y() - vEPa->GetQContributionY(track);  //Modify the components: subtract the track you want to look at with your analysis\r
+      TVector2 newQVectorfortrack;\r
+      newQVectorfortrack.Set(qX,qY);\r
+      eventplanesubtracted = TVector2::Phi_0_2pi(newQVectorfortrack.Phi())/2; \r
+    }\r
+    else eventplanesubtracted = eventPlanea;\r
+\r
+    ////////////////////////////////////////\r
+    // Fill pt and eta for the THnSparseF\r
+    ///////////////////////////////////////\r
+\r
+    valuensparseg[2] = track->Pt();\r
+    valuensparseh[2] = track->Pt();\r
+    if(track->Charge() > 0.0) {\r
+      valuensparseg[3] = 0.2;\r
+      valuensparseh[3] = 0.2;\r
+    }\r
+    else {\r
+      valuensparseg[3] = -0.2;\r
+      valuensparseh[3] = -0.2;\r
+    }\r
+    valuensparseh[4] = track->Eta();\r
+    valuensparseg[4] = track->Eta();\r
+\r
+    ///////////////////////////////\r
+    // Event plane without track\r
+    /////////////////////////////\r
+    Bool_t fillEventPlane = kTRUE;\r
+    if(!fVZEROEventPlane){\r
+      if((!qsub1a) || (!qsub2a)) fillEventPlane = kFALSE;\r
+      if(fSubEtaGapTPC) {\r
+       if(track->Eta() < (- fEtaGap/2.)) eventplanesubtracted = eventPlanesub1a;\r
+       else if(track->Eta() > (fEtaGap/2.)) eventplanesubtracted = eventPlanesub2a;\r
+       else fillEventPlane = kFALSE;\r
+      }\r
+    }\r
+    \r
+    ///////////////////////\r
+    // Calculate deltaphi\r
+    ///////////////////////\r
+    Double_t phitrack = track->Phi();  \r
+    Double_t deltaphi = TVector2::Phi_0_2pi(phitrack - eventplanesubtracted);\r
+    if(deltaphi > TMath::Pi()) deltaphi = deltaphi - TMath::Pi();\r
+   \r
+    /////////////////////\r
+    // Fill THnSparseF\r
+    /////////////////////\r
+\r
+    valuensparseg[0] = deltaphi;\r
+    if(fillEventPlane) fDeltaPhiMaps->Fill(&valuensparseg[0]);\r
+    \r
+    //\r
+    valuensparseh[0] = TMath::Cos(2*TVector2::Phi_mpi_pi(phitrack-eventplanesubtracted));\r
+    if(fillEventPlane) {\r
+      fCosPhiMaps->Fill(&valuensparseh[0]);\r
+    }\r
+    \r
+  }\r
+\r
+\r
+  AliDebug(1, "Post data");\r
+  \r
+  PostData(1, fListHist);\r
+\r
+\r
\r
+}\r
diff --git a/PWGHF/hfe/AliAnalysisTaskHFEFlowData.h b/PWGHF/hfe/AliAnalysisTaskHFEFlowData.h
new file mode 100644 (file)
index 0000000..682e373
--- /dev/null
@@ -0,0 +1,116 @@
+/**************************************************************************\r
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+*                                                                        *\r
+* Author: The ALICE Off-line Project.                                    *\r
+* Contributors are mentioned in the code where appropriate.              *\r
+*                                                                        *\r
+* Permission to use, copy, modify and distribute this software and its   *\r
+* documentation strictly for non-commercial purposes is hereby granted   *\r
+* without fee, provided that the above copyright notice appears in all   *\r
+* copies and that both the copyright notice and this permission notice   *\r
+* appear in the supporting documentation. The authors make no claims     *\r
+* about the suitability of this software for any purpose. It is          *\r
+* provided "as is" without express or implied warranty.                  *\r
+**************************************************************************/\r
+//\r
+// Flow task class for the ALICE HFE group\r
+//\r
+//\r
+#ifndef ALIANALYSISTASKHFEFLOWDATA_H\r
+#define ALIANALYSISTASKHFEFLOWDATA_H\r
+\r
+\r
+\r
+\r
+#include <AliAnalysisTaskSE.h>\r
+\r
+class TList;\r
+class AliFlowTrackCuts;\r
+class AliFlowCandidateTrack;\r
+class AliHFEcuts;\r
+class AliHFEpid;\r
+class TH1D;\r
+class TH2D;\r
+class TProfile;\r
+class TProfile2D;\r
+class THnSparse;\r
+class AliHFEpidQAmanager;\r
+class AliFlowEvent;\r
+class AliHFEVZEROEventPlane;\r
+\r
+class AliAnalysisTaskHFEFlowData: public AliAnalysisTaskSE {\r
+  \r
+public:\r
+  AliAnalysisTaskHFEFlowData();\r
+  AliAnalysisTaskHFEFlowData(const char *name);\r
+  AliAnalysisTaskHFEFlowData(const AliAnalysisTaskHFEFlowData &ref);\r
+  AliAnalysisTaskHFEFlowData& operator=(const AliAnalysisTaskHFEFlowData &ref);\r
+  virtual void Copy(TObject &o) const;\r
+  virtual ~AliAnalysisTaskHFEFlowData();\r
+  \r
+  virtual void  UserExec(Option_t */*option*/);\r
+  virtual void  UserCreateOutputObjects();\r
+\r
+  void SetAODAnalysis(Bool_t aodAnalysis) { fAODAnalysis = aodAnalysis; };\r
+  void SetUseFlagAOD(Bool_t useFlagAOD) { fUseFlagAOD = useFlagAOD; }\r
+  void SetApplyCut(Bool_t applyCut) { fApplyCut = applyCut; }\r
+  void SetFlags(ULong_t flags)          { fFlags = flags; }\r
+  \r
+  AliHFEpid *GetPID() const { return fPID; }\r
+  AliHFEpidQAmanager *GetPIDQAManager() const { return fPIDqa; }\r
+\r
+  void SetHFECuts(AliHFEcuts * const cuts) { fHFECuts = cuts; };\r
+  void SetSubEtaGapTPC(Bool_t  subEtaGapTPC) { fSubEtaGapTPC = subEtaGapTPC; };\r
+  void SetEtaGap(Double_t  etaGap) { fEtaGap = etaGap; };\r
+  void SetVZEROEventPlane(Bool_t vzeroEventPlane) { fVZEROEventPlane = vzeroEventPlane; };\r
+  void SetVZEROEventPlaneA(Bool_t vzeroEventPlaneA) { fVZEROEventPlaneA = vzeroEventPlaneA; };\r
+  void SetVZEROEventPlaneC(Bool_t vzeroEventPlaneC) { fVZEROEventPlaneC = vzeroEventPlaneC; };\r
+  \r
+  void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel;};\r
+  \r
+private:\r
+  TList     *fListHist;         //! TH list\r
+  Bool_t    fAODAnalysis;       // AOD analysis\r
+  Bool_t    fUseFlagAOD;        // Use the preselected AOD track\r
+  Bool_t    fApplyCut;       // Apply the analysis cut for AOD tracks\r
+  ULong_t   fFlags;             // reconstruction AOD status flags \r
+  \r
+  Bool_t    fVZEROEventPlane;  // Use Event Planes from VZERO\r
+  Bool_t    fVZEROEventPlaneA; // Use Event Planes from VZERO A\r
+  Bool_t    fVZEROEventPlaneC; // Use Event Planes from VZERO C\r
+\r
+  Bool_t    fSubEtaGapTPC;    // bool to fill with eta gap\r
+  Double_t  fEtaGap;          // Value of the eta gap\r
\r
+  Int_t     fDebugLevel; // Debug Level  \r
+\r
+  // Cuts for HFE\r
+  AliHFEcuts *fHFECuts;           // HFE cuts\r
+  AliHFEpid  *fPID;               // PID cuts \r
+  AliHFEpidQAmanager *fPIDqa;     // QA Manager\r
+  \r
+  // Histos\r
+  TH2D *fHistEV;               //! Number of events\r
+  \r
+  // A Event plane as function of phiepa, phiepb, phiepc, phiepd centrality \r
+  // a V0A, b V0C, c TPC, d V0\r
+  THnSparseF *fEventPlane;     //! Event plane\r
+  \r
+  // Fbis Resolution as function of cosres, cosres, cosres, centrality for three subevents (V0)\r
+  // a V0A, b V0C, c TPC\r
+  THnSparseF *fCosResabc; //! Res\r
+  \r
+  // F Resolution as function of cosres, centrality for two subevents (TPC)\r
+  THnSparseF *fCosRes; //! Res\r
+  \r
+  // G Maps delta phi as function of deltaphi, centrality, pt\r
+  THnSparseF *fDeltaPhiMaps; //! Delta phi\r
+  \r
+  // H Maps cos phi : cos, centrality, pt\r
+  THnSparseF *fCosPhiMaps;         //! Cos\r
+    \r
+  \r
+  ClassDef(AliAnalysisTaskHFEFlowData, 1); // analysisclass\r
+};\r
+\r
+#endif\r
index 4f61b27..80761c1 100644 (file)
@@ -33,8 +33,9 @@ AliAnalysisTask *AddTaskHFEtpctof(Bool_t beauty=kTRUE, Int_t tpcCls=110,  Int_t
     task->SetFillNoCuts(kTRUE);
     task->SetUseFlagAOD(kFALSE);
     task->SetApplyCutAOD(kTRUE);
-  }  
-  
+  }
+
+   
   mgr->AddTask(task);
 
   TString containerName = mgr->GetCommonFileName();
index 4e3eb19..08b790f 100644 (file)
@@ -1,11 +1,5 @@
 AliAnalysisTask *AddTaskHFEtpctofv2(Int_t tpcCls=110, Double_t tpcClsr=50, Int_t tpcClspid=60, Double_t tpcsharedfraction=10, Int_t itsCls=4, Double_t chi2peritscl=36, Int_t pixellayer=2, Double_t dcaxy=100,Double_t dcaz=200, Double_t tofsig=30., Double_t tpceff=50., Int_t vzero=3, Int_t debuglevel=0, Bool_t algorithmMA=kFALSE, Bool_t massconstraint=kFALSE){
 
-  // libraries in case
-  gSystem->Load("libANALYSIS.so");
-  gSystem->Load("libANALYSISalice.so");
-  gSystem->Load("libPWGflowBase.so");
-  gSystem->Load("libPWGflowTasks.so");
-  
   //
   // Define TPC cut for 2011 data
   //
@@ -33,8 +27,8 @@ AliAnalysisTask *AddTaskHFEtpctofv2(Int_t tpcCls=110, Double_t tpcClsr=50, Int_t
     tpcdedx[3]=-0.17;
     tpcdedx[4]=-0.022;
     tpcdedx[5]=-0.018;
-    tpcdedx[6]=0.018;
-    tpcdedx[7]=0.018;
+    tpcdedx[6]=-0.018;
+    tpcdedx[7]=-0.018;
   }
   if(TMath::Abs(tpceff-45)<0.01) {
     tpcdedx[0]=-0.062;
@@ -68,8 +62,7 @@ AliAnalysisTask *AddTaskHFEtpctofv2(Int_t tpcCls=110, Double_t tpcClsr=50, Int_t
   }
 
   // Name
-  TString appendixx(TString::Format("TPC%dr%dp%ds%dITS%dC%dPi%dDCAr%dz%dTOF%dTPCe%dV%dD%dec%dal%dm%d",tpcCls,(Int_t)tpcClsr,tpcClspid,(Int_t) tpcsharedfraction,itsCls,(Int_t) chi2peritscl,(Int_t) pixellayer,(Int_t) dcaxy,(Int_t)dcaz,(Int_t) tofsig,(Int_t)tpceff,vzero,debuglevel,(Int_t)algorithmMA,(Int_t)massconstraint));
-  printf("appendixx %s\n", appendixx.Data());
+  TString appendixx("tpctofv2");
   
 
   //set config file name
@@ -103,7 +96,7 @@ AliAnalysisTask *AddTaskHFEtpctofv2(Int_t tpcCls=110, Double_t tpcClsr=50, Int_t
   containerName += appendixx.Data();
 
   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
-  mgr->ConnectOutput(task,1, mgr->CreateContainer((const char*)(appendixx.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
+  mgr->ConnectOutput(task,1, mgr->CreateContainer("testtpctofv2", TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()));
   mgr->ConnectInput(task,0, cinput );    
 
   return NULL;