add pid qa task + fix TPC pid.
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Feb 2011 07:11:30 +0000 (07:11 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Feb 2011 07:11:30 +0000 (07:11 +0000)
PWG2/CMakelibPWG2flowTasks.pkg
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.cxx [new file with mode: 0644]
PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.h [new file with mode: 0644]
PWG2/FLOW/AliFlowTasks/AliFlowTrackCuts.cxx
PWG2/FLOW/AliFlowTools/glauberMC/AliGlauberMC.cxx
PWG2/FLOW/macros/AddTaskPIDflowQA.C [new file with mode: 0644]
PWG2/PWG2flowTasksLinkDef.h

index 9e23fbd..171152d 100644 (file)
@@ -25,7 +25,7 @@
 # SHLIBS - Shared Libraries and objects for linking (Executables only)           #
 #--------------------------------------------------------------------------------#
 
-set ( SRCS  FLOW/AliFlowTasks/AliFlowEventSimpleMaker.cxx FLOW/AliFlowTasks/AliFlowEvent.cxx FLOW/AliFlowTasks/AliFlowEventCuts.cxx FLOW/AliFlowTasks/AliFlowTrack.cxx FLOW/AliFlowTasks/AliFlowCandidateTrack.cxx FLOW/AliFlowTasks/AliFlowTrackCuts.cxx FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx FLOW/AliFlowTasks/AliAnalysisTaskLeeYangZeros.cxx FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowK0Candidates.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowEventforRP.cxx FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx FLOW/AliFlowTasks/AliAnalysisTaskQAflow.cxx)
+set ( SRCS  FLOW/AliFlowTasks/AliFlowEventSimpleMaker.cxx FLOW/AliFlowTasks/AliFlowEvent.cxx FLOW/AliFlowTasks/AliFlowEventCuts.cxx FLOW/AliFlowTasks/AliFlowTrack.cxx FLOW/AliFlowTasks/AliFlowCandidateTrack.cxx FLOW/AliFlowTasks/AliFlowTrackCuts.cxx FLOW/AliFlowTasks/AliAnalysisTaskScalarProduct.cxx FLOW/AliFlowTasks/AliAnalysisTaskMCEventPlane.cxx FLOW/AliFlowTasks/AliAnalysisTaskLYZEventPlane.cxx FLOW/AliFlowTasks/AliAnalysisTaskCumulants.cxx FLOW/AliFlowTasks/AliAnalysisTaskQCumulants.cxx FLOW/AliFlowTasks/AliAnalysisTaskLeeYangZeros.cxx FLOW/AliFlowTasks/AliAnalysisTaskFittingQDistribution.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowEvent.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowK0Candidates.cxx FLOW/AliFlowTasks/AliAnalysisTaskFlowEventforRP.cxx FLOW/AliFlowTasks/AliAnalysisTaskMixedHarmonics.cxx FLOW/AliFlowTasks/AliAnalysisTaskNestedLoops.cxx FLOW/AliFlowTasks/AliAnalysisTaskQAflow.cxx FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.cxx)
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.cxx b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.cxx
new file mode 100644 (file)
index 0000000..f05a57b
--- /dev/null
@@ -0,0 +1,600 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial pures is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any pure. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+
+// AliAnalysisTaskPIDflowQA:
+// QA for pid
+//
+//origin: Marek Chojnacki, Marek.Chojnacki@cern.ch
+//modified: Mikolaj Krzewicki, Mikolaj.Krzewicki@cern.ch
+
+#include "AliAnalysisTaskPIDflowQA.h"
+#include "AliAnalysisManager.h"
+#include "AliESDEvent.h"
+#include "AliInputEventHandler.h"
+#include "AliStack.h"
+#include "AliMCEvent.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TMath.h"
+#include "TH3F.h"
+#include "AliVEvent.h"
+#include "AliESDtrackCuts.h"
+#include "AliPID.h"
+#include "AliCDBManager.h"
+#include "AliFlowEventCuts.h"
+
+ClassImp( AliAnalysisTaskPIDflowQA)
+
+//________________________________________________________________________
+AliAnalysisTaskPIDflowQA:: AliAnalysisTaskPIDflowQA():
+  AliAnalysisTaskSE("AliAnalysisTaskPIDflowQA"),
+  fESD(NULL),
+  fCuts(NULL),
+  fEventCuts(NULL),
+  fESDpid(NULL),
+  fMC(kFALSE),
+  fITSsignal(NULL),
+  fTPCsignal(NULL),
+  fTOFsignal(NULL),
+  fITSsignalpi(NULL),
+  fTPCsignalpi(NULL),
+  fTOFsignalpi(NULL),
+  fITSsignalK(NULL),
+  fTPCsignalK(NULL),
+  fTOFsignalK(NULL),
+  fITSsignalp(NULL),
+  fTPCsignalp(NULL),
+  fTOFsignalp(NULL),
+  fITSsignalpiMC(NULL),
+  fTPCsignalpiMC(NULL),
+  fTOFsignalpiMC(NULL),
+  fITSsignalKMC(NULL),
+  fTPCsignalKMC(NULL),
+  fTOFsignalKMC(NULL),
+  fITSsignalpMC(NULL),
+  fTPCsignalpMC(NULL),
+  fTOFsignalpMC(NULL),
+  fITSsignalpip(NULL),
+  fTPCsignalpip(NULL),
+  fTOFsignalpip(NULL),
+  fITSsignalKp(NULL),
+  fTPCsignalKp(NULL),
+  fTOFsignalKp(NULL),
+  fITSsignalpp(NULL),
+  fTPCsignalpp(NULL),
+  fTOFsignalpp(NULL),
+  fITSsignalpiMCp(NULL),
+  fTPCsignalpiMCp(NULL),
+  fTOFsignalpiMCp(NULL),
+  fITSsignalKMCp(NULL),
+  fTPCsignalKMCp(NULL),
+  fTOFsignalKMCp(NULL),
+  fITSsignalpMCp(NULL),
+  fTPCsignalpMCp(NULL),
+  fTOFsignalpMCp(NULL),
+  fTOFsignalPiExpKvsPt(NULL),
+  fTOFsignalPiExpPvsPt(NULL),
+  fTOFsignalKExpPivsPt(NULL),
+  fTOFsignalKExpPvsPt(NULL),
+  fTOFsignalPExpPivsPt(NULL),
+  fTOFsignalPExpKvsPt(NULL),
+  fTOFsignalPiExpKvsP(NULL),
+  fTOFsignalPiExpPvsP(NULL),
+  fTOFsignalKExpPivsP(NULL),
+  fTOFsignalKExpPvsP(NULL),
+  fTOFsignalPExpPivsP(NULL),
+  fTOFsignalPExpKvsP(NULL),
+  fPvsPt(NULL),
+  fOuputList(NULL)
+{
+  //def ctor
+}
+
+//________________________________________________________________________
+AliAnalysisTaskPIDflowQA:: AliAnalysisTaskPIDflowQA(const char *name):
+  AliAnalysisTaskSE(name),
+  fESD(NULL),
+  fCuts(NULL),
+  fEventCuts(NULL),
+  fESDpid(NULL),
+  fMC(kFALSE),
+  fITSsignal(NULL),
+  fTPCsignal(NULL),
+  fTOFsignal(NULL),
+  fITSsignalpi(NULL),
+  fTPCsignalpi(NULL),
+  fTOFsignalpi(NULL),
+  fITSsignalK(NULL),
+  fTPCsignalK(NULL),
+  fTOFsignalK(NULL),
+  fITSsignalp(NULL),
+  fTPCsignalp(NULL),
+  fTOFsignalp(NULL),
+  fITSsignalpiMC(NULL),
+  fTPCsignalpiMC(NULL),
+  fTOFsignalpiMC(NULL),
+  fITSsignalKMC(NULL),
+  fTPCsignalKMC(NULL),
+  fTOFsignalKMC(NULL),
+  fITSsignalpMC(NULL),
+  fTPCsignalpMC(NULL),
+  fTOFsignalpMC(NULL),
+  fITSsignalpip(NULL),
+  fTPCsignalpip(NULL),
+  fTOFsignalpip(NULL),
+  fITSsignalKp(NULL),
+  fTPCsignalKp(NULL),
+  fTOFsignalKp(NULL),
+  fITSsignalpp(NULL),
+  fTPCsignalpp(NULL),
+  fTOFsignalpp(NULL),
+  fITSsignalpiMCp(NULL),
+  fTPCsignalpiMCp(NULL),
+  fTOFsignalpiMCp(NULL),
+  fITSsignalKMCp(NULL),
+  fTPCsignalKMCp(NULL),
+  fTOFsignalKMCp(NULL),
+  fITSsignalpMCp(NULL),
+  fTPCsignalpMCp(NULL),
+  fTOFsignalpMCp(NULL),
+  fTOFsignalPiExpKvsPt(NULL),
+  fTOFsignalPiExpPvsPt(NULL),
+  fTOFsignalKExpPivsPt(NULL),
+  fTOFsignalKExpPvsPt(NULL),
+  fTOFsignalPExpPivsPt(NULL),
+  fTOFsignalPExpKvsPt(NULL),
+  fTOFsignalPiExpKvsP(NULL),
+  fTOFsignalPiExpPvsP(NULL),
+  fTOFsignalKExpPivsP(NULL),
+  fTOFsignalKExpPvsP(NULL),
+  fTOFsignalPExpPivsP(NULL),
+  fTOFsignalPExpKvsP(NULL),
+  fPvsPt(NULL),
+  fOuputList(NULL)
+{
+  //Constructor
+  fESDpid=new AliESDpid();
+
+  //old
+  fESDpid->GetTPCResponse().SetBetheBlochParameters(0.0283086,
+      2.63394e+01,
+      5.04114e-11,
+      2.12543e+00,
+      4.88663e+00 );
+  //new
+  //fESDpid->GetTPCResponse().SetBetheBlochParameters(1.28949/50.,
+  //                                                  2.74095e+01,
+  //                                                  TMath::Exp(-3.21763e+01),
+  //                                                  2.44026,
+  //                                                  6.58800);
+
+  DefineOutput(1, TList::Class());
+}
+
+//________________________________________________________________________
+void  AliAnalysisTaskPIDflowQA::UserCreateOutputObjects()
+{
+  //UserCreateOutputObject
+  if (fOuputList) fOuputList->Delete();
+  delete fOuputList;
+  fOuputList=new TList();
+
+  const  Int_t ndec=2;
+  Int_t startvalue=-1;
+  const  Int_t npredec=50;
+  Double_t tabx[ndec*npredec+1];
+  for (Int_t i=0; i<ndec; i++)
+  {
+    for (Int_t j=0; j<npredec; j++)
+    {
+      tabx[npredec*i+j]=TMath::Power(10,((Double_t)i)+((Double_t)startvalue)+((Double_t)j)/((Double_t)npredec));
+    }
+  }
+  tabx[ndec*npredec]=TMath::Power(10,ndec+startvalue);
+
+
+  fITSsignal=new TH2F("fITSsignal","fITSsignal;dEdx;p[GeV/c]",ndec*npredec,tabx,900,0,900);
+  fOuputList->Add(fITSsignal);
+  fTPCsignal=new TH2F("fTPCsignal","fTPCsignal;dEdx;p[GeV/c]",ndec*npredec,tabx,900,0,900);
+  fOuputList->Add(fTPCsignal);
+  fTOFsignal=new TH2F("fTOFsignal","fTOFsignal;t-t_{#pi};p[GeV/c]",ndec*npredec,tabx,1200,-2000,10000);
+  fOuputList->Add(fTOFsignal);
+
+  Int_t kPtBins=60;
+  Double_t binsPtDummy[kPtBins+1];
+  binsPtDummy[0]=0.0;
+  for(int i=1; i<=kPtBins+1; i++)
+  {
+    if(binsPtDummy[i-1]+0.05<1.01)
+      binsPtDummy[i]=binsPtDummy[i-1]+0.05;
+    else
+      binsPtDummy[i]=binsPtDummy[i-1]+0.1;
+  }
+
+  Int_t kPBins=60;
+  Double_t binsPDummy[kPBins+1];
+  binsPDummy[0]=0.0;
+  for(int i=1; i<=kPBins+1; i++)
+  {
+    if(binsPDummy[i-1]+0.05<1.01)
+      binsPDummy[i]=binsPDummy[i-1]+0.05;
+    else
+      binsPDummy[i]=binsPDummy[i-1]+0.1;
+  }
+
+  fITSsignalpi=new TH2F("fITSsignalpi",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for pi+
+  fTPCsignalpi=new TH2F("fTPCsignalpi",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for pi+
+  fTOFsignalpi=new TH2F("fTOFsignalpi",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for pi+
+  fOuputList->Add(fITSsignalpi);
+  fOuputList->Add(fTPCsignalpi);
+  fOuputList->Add(fTOFsignalpi);
+
+  fITSsignalK=new TH2F("fITSsignalK",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for K+
+  fTPCsignalK=new TH2F("fTPCsignalK",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for K+
+  fTOFsignalK=new TH2F("fTOFsignalK",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for K+
+  fOuputList->Add(fITSsignalK);
+  fOuputList->Add(fTPCsignalK);
+  fOuputList->Add(fTOFsignalK);
+
+  fITSsignalp=new TH2F("fITSsignalp",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for p
+  fTPCsignalp=new TH2F("fTPCsignalp",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for p
+  fTOFsignalp=new TH2F("fTOFsignalp",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for p
+  fOuputList->Add(fITSsignalp);
+  fOuputList->Add(fTPCsignalp);
+  fOuputList->Add(fTOFsignalp);
+
+  fTOFsignalPiExpKvsPt=new TH2F("fTOFsignalPiExpKvsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPiExpPvsPt=new TH2F("fTOFsignalPiExpPvsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalKExpPivsPt=new TH2F("fTOFsignalKExpPivsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalKExpPvsPt=new TH2F("fTOFsignalKExpPvsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPExpPivsPt=new TH2F("fTOFsignalPExpPivsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPExpKvsPt=new TH2F("fTOFsignalPExpKvsPt",";pt[GeV/c];expected signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fOuputList->Add(fTOFsignalPiExpKvsPt);
+  fOuputList->Add(fTOFsignalPiExpPvsPt);
+  fOuputList->Add(fTOFsignalKExpPivsPt);
+  fOuputList->Add(fTOFsignalKExpPvsPt);
+  fOuputList->Add(fTOFsignalPExpPivsPt);
+  fOuputList->Add(fTOFsignalPExpKvsPt);
+
+  //p
+  fITSsignalpip=new TH2F("fITSsignalpip",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//ITS PID signal as function of p for pi+
+  fTPCsignalpip=new TH2F("fTPCsignalpip",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//TPC PID signal as function of p for pi+
+  fTOFsignalpip=new TH2F("fTOFsignalpip",";p[GeV/c];signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of p for pi+
+  fOuputList->Add(fITSsignalpip);
+  fOuputList->Add(fTPCsignalpip);
+  fOuputList->Add(fTOFsignalpip);
+
+  fITSsignalKp=new TH2F("fITSsignalKp",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//ITS PID signal as function of p for K+
+  fTPCsignalKp=new TH2F("fTPCsignalKp",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//TPC PID signal as function of p for K+
+  fTOFsignalKp=new TH2F("fTOFsignalKp",";p[GeV/c];signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of p for K+
+  fOuputList->Add(fITSsignalKp);
+  fOuputList->Add(fTPCsignalKp);
+  fOuputList->Add(fTOFsignalKp);
+
+  fITSsignalpp=new TH2F("fITSsignalpp",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//ITS PID signal as function of p for p
+  fTPCsignalpp=new TH2F("fTPCsignalpp",";p[GeV/c];signal",kPBins,binsPDummy,600,-4,4);//TPC PID signal as function of p for p
+  fTOFsignalpp=new TH2F("fTOFsignalpp",";p[GeV/c];signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of p for p
+  fOuputList->Add(fITSsignalpp);
+  fOuputList->Add(fTPCsignalpp);
+  fOuputList->Add(fTOFsignalpp);
+
+  fTOFsignalPiExpKvsP=new TH2F("fTOFsignalPiExpKvsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPiExpPvsP=new TH2F("fTOFsignalPiExpPvsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalKExpPivsP=new TH2F("fTOFsignalKExpPivsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalKExpPvsP=new TH2F("fTOFsignalKExpPvsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPExpPivsP=new TH2F("fTOFsignalPExpPivsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fTOFsignalPExpKvsP=new TH2F("fTOFsignalPExpKvsP",";p[GeV/c];expected signal",kPBins,binsPDummy,1000,-8000,8000);//TOF PID signal as function of pt
+  fOuputList->Add(fTOFsignalPiExpKvsP);
+  fOuputList->Add(fTOFsignalPiExpPvsP);
+  fOuputList->Add(fTOFsignalKExpPivsP);
+  fOuputList->Add(fTOFsignalKExpPvsP);
+  fOuputList->Add(fTOFsignalPExpPivsP);
+  fOuputList->Add(fTOFsignalPExpKvsP);
+
+  if(fMC)
+  {
+    fITSsignalpiMC=new TH2F("fITSsignalpiMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for pi+
+    fTPCsignalpiMC=new TH2F("fTPCsignalpiMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for pi+
+    fTOFsignalpiMC=new TH2F("fTOFsignalpiMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for pi+
+    fOuputList->Add(fITSsignalpiMC);
+    fOuputList->Add(fTPCsignalpiMC);
+    fOuputList->Add(fTOFsignalpiMC);
+
+    fITSsignalKMC=new TH2F("fITSsignalKMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for K+
+    fTPCsignalKMC=new TH2F("fTPCsignalKMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for K+
+    fTOFsignalKMC=new TH2F("fTOFsignalKMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for K+
+    fOuputList->Add(fITSsignalKMC);
+    fOuputList->Add(fTPCsignalKMC);
+    fOuputList->Add(fTOFsignalKMC);
+
+    fITSsignalpMC=new TH2F("fITSsignalpMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for p
+    fTPCsignalpMC=new TH2F("fTPCsignalpMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for p
+    fTOFsignalpMC=new TH2F("fTOFsignalpMC",";pt[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for p
+    fOuputList->Add(fITSsignalpMC);
+    fOuputList->Add(fTPCsignalpMC);
+    fOuputList->Add(fTOFsignalpMC);
+
+    fITSsignalpiMCp=new TH2F("fITSsignalpiMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for pi+
+    fTPCsignalpiMCp=new TH2F("fTPCsignalpiMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for pi+
+    fTOFsignalpiMCp=new TH2F("fTOFsignalpiMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for pi+
+    fOuputList->Add(fITSsignalpiMCp);
+    fOuputList->Add(fTPCsignalpiMCp);
+    fOuputList->Add(fTOFsignalpiMCp);
+
+    fITSsignalKMCp=new TH2F("fITSsignalKMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for K+
+    fTPCsignalKMCp=new TH2F("fTPCsignalKMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for K+
+    fTOFsignalKMCp=new TH2F("fTOFsignalKMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for K+
+    fOuputList->Add(fITSsignalKMCp);
+    fOuputList->Add(fTPCsignalKMCp);
+    fOuputList->Add(fTOFsignalKMCp);
+
+    fITSsignalpMCp=new TH2F("fITSsignalpMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//ITS PID signal as function of pt for p
+    fTPCsignalpMCp=new TH2F("fTPCsignalpMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,600,-4,4);//TPC PID signal as function of pt for p
+    fTOFsignalpMCp=new TH2F("fTOFsignalpMCp",";p[GeV/c];signal",kPtBins,binsPtDummy,1000,-8000,8000);//TOF PID signal as function of pt for p
+    fOuputList->Add(fITSsignalpMCp);
+    fOuputList->Add(fTPCsignalpMCp);
+    fOuputList->Add(fTOFsignalpMCp);
+  }
+
+  fPvsPt=new TH2F("fPvsPt","p vs p_{t}",kPBins,binsPDummy,kPtBins,binsPtDummy);
+  fOuputList->Add(fPvsPt);
+
+  PostData(1,  fOuputList);
+}
+
+//________________________________________________________________________
+void  AliAnalysisTaskPIDflowQA::UserExec(Option_t *)
+{
+  fESD = dynamic_cast<AliESDEvent*> (InputEvent());
+  if (!fESD) return;
+
+  if(!fCuts || !fEventCuts)
+  {
+    Printf("No CUTS Defined.........\n");
+    PostData(1,  fOuputList);
+    return;
+  }
+
+  if (!(fEventCuts->IsSelected(fESD)))
+  {
+    return;
+  }
+
+  AliStack* stack=0x0;
+  if(fMC)
+  {
+    AliMCEvent* mcEvent  = (AliMCEvent*) MCEvent();
+    Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
+    stack = mcEvent->Stack();
+  }
+
+  Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+  Int_t nTracks=fESD->GetNumberOfTracks();
+
+  AliESDtrack *trackESD=0;
+
+  for(int tr1=0; tr1<nTracks; tr1++)
+  {
+    trackESD=fESD->GetTrack(tr1);
+    if (!trackESD) continue;
+
+    if(!(fCuts->AcceptTrack(trackESD))) continue;
+
+    Int_t label=-1;
+    if(fMC) label=trackESD->GetLabel();
+
+    Int_t pdgcode=0;
+    if(stack&&fMC)
+    {
+      TParticle* particle2 = stack->Particle(TMath::Abs(label));
+      pdgcode=particle2->GetPdgCode();
+    }
+
+    Double_t p=trackESD->GetP();
+    Double_t pt=trackESD->Pt();
+    fPvsPt->Fill(p,pt);
+
+    pidITS(trackESD,pdgcode);
+    pidTPC(trackESD,pdgcode);
+    pidTOF(trackESD,pdgcode);
+  }
+
+  // Post output data.
+  PostData(1,  fOuputList);
+}
+
+//________________________________________________________________________
+void  AliAnalysisTaskPIDflowQA::Terminate(Option_t *)
+{
+  //Terminate
+  if(fCuts)
+    fCuts->Dump();
+  if(fMC)
+    Printf("MC On\n");
+
+  Printf("AliAnalysisTaskPIDflowQA: end of Terminate");
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPIDflowQA::pidITS(AliESDtrack* t, Int_t pdgcode)
+{
+  Int_t ngoodSDDSSD=0;
+  Double_t sample[4]= {0.0,0.0,0.0,0.0};
+  t->GetITSdEdxSamples(sample);
+  for(int i=0; i<4; i++)
+  {
+    if(sample[i]>50.0)
+      ngoodSDDSSD++;
+  }
+  if(ngoodSDDSSD<3) return;
+
+  Float_t dedx=(Float_t)t->GetITSsignal();
+  if(dedx<1.0) return;
+
+  Bool_t ifSA=!(t->IsOn(AliESDtrack::kTPCin));
+  Float_t p=t->GetP();
+  Float_t pt=t->Pt();
+
+  Float_t signalpi=fESDpid->GetITSResponse().Bethe(p,AliPID::ParticleMass(2),ifSA);
+  Float_t signalK=fESDpid->GetITSResponse().Bethe(p,AliPID::ParticleMass(3),ifSA);
+  Float_t signalp=fESDpid->GetITSResponse().Bethe(p,AliPID::ParticleMass(4),ifSA);
+  if(signalpi<1.0||signalK<1.0||signalp<1.0) return;
+
+  fITSsignal->Fill(p,dedx);
+
+  fITSsignalpip->Fill(p,TMath::Log(dedx)-TMath::Log(signalpi));
+  fITSsignalKp->Fill(p,TMath::Log(dedx)-TMath::Log(signalK));
+  fITSsignalpp->Fill(p,TMath::Log(dedx)-TMath::Log(signalp));
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fITSsignalpiMCp->Fill(p,TMath::Log(dedx)-TMath::Log(signalpi));
+    else if(TMath::Abs(pdgcode)==321)
+      fITSsignalKMCp->Fill(p,TMath::Log(dedx)-TMath::Log(signalK));
+    else if (TMath::Abs(pdgcode)==2212)
+      fITSsignalpMCp->Fill(p,TMath::Log(dedx)-TMath::Log(signalp));
+  }
+
+  fITSsignalpi->Fill(pt,TMath::Log(dedx)-TMath::Log(signalpi));
+  fITSsignalK->Fill(pt,TMath::Log(dedx)-TMath::Log(signalK));
+  fITSsignalp->Fill(pt,TMath::Log(dedx)-TMath::Log(signalp));
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fITSsignalpiMC->Fill(pt,TMath::Log(dedx)-TMath::Log(signalpi));
+    else if(TMath::Abs(pdgcode)==321)
+      fITSsignalKMC->Fill(pt,TMath::Log(dedx)-TMath::Log(signalK));
+    else if (TMath::Abs(pdgcode)==2212)
+      fITSsignalpMC->Fill(pt,TMath::Log(dedx)-TMath::Log(signalp));
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPIDflowQA::pidTPC(AliESDtrack* t, Int_t pdgcode)
+{
+  Double_t pinTPCglobal=t->GetInnerParam()->GetP();
+  Float_t sigPion     = fESDpid->GetTPCResponse().GetExpectedSignal(pinTPCglobal, AliPID::kPion);
+  Float_t sigKaon     = fESDpid->GetTPCResponse().GetExpectedSignal(pinTPCglobal, AliPID::kKaon);
+  Float_t sigProton   = fESDpid->GetTPCResponse().GetExpectedSignal(pinTPCglobal, AliPID::kProton);
+  Float_t pt=t->Pt();
+  Float_t p=t->GetP();
+  Double_t tpcSignal =t ->GetTPCsignal();
+  if(!(sigPion>0.0&&sigKaon>0.0&&sigProton>0.0))
+    return;
+
+  fTPCsignal->Fill(pinTPCglobal,tpcSignal);
+
+  fTPCsignalpip->Fill(p,(tpcSignal-sigPion)/sigPion);
+  fTPCsignalKp->Fill(p,(tpcSignal-sigKaon)/sigKaon);
+  fTPCsignalpp->Fill(p,(tpcSignal-sigProton)/sigProton);
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fTPCsignalpiMCp->Fill(p,(tpcSignal-sigPion)/sigPion);
+    else if(TMath::Abs(pdgcode)==321)
+      fTPCsignalKMCp->Fill(p,(tpcSignal-sigKaon)/sigKaon);
+    else if (TMath::Abs(pdgcode)==2212)
+      fTPCsignalpMCp->Fill(p,(tpcSignal-sigProton)/sigProton);
+  }
+
+  fTPCsignalpi->Fill(pt,(tpcSignal-sigPion)/sigPion);
+  fTPCsignalK->Fill(pt,(tpcSignal-sigKaon)/sigKaon);
+  fTPCsignalp->Fill(pt,(tpcSignal-sigProton)/sigProton);
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fTPCsignalpiMC->Fill(pt,(tpcSignal-sigPion)/sigPion);
+    else if(TMath::Abs(pdgcode)==321)
+      fTPCsignalKMC->Fill(pt,(tpcSignal-sigKaon)/sigKaon);
+    else if (TMath::Abs(pdgcode)==2212)
+      fTPCsignalpMC->Fill(pt,(tpcSignal-sigProton)/sigProton);
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskPIDflowQA::pidTOF(AliESDtrack* t, Int_t pdgcode)
+{
+  Bool_t goodtrack = (t) &&
+                     (t->GetStatus() & AliESDtrack::kTOFpid) &&
+                     (t->GetTOFsignal() > 12000) &&
+                     (t->GetTOFsignal() < 100000) &&
+                     (t->GetIntegratedLength() > 365) &&
+                     !(t->GetStatus() & AliESDtrack::kTOFmismatch);
+
+  if (!goodtrack) return;
+
+  Float_t pt=t->Pt();
+  Float_t p=t->GetP();
+  Float_t fT0track=fESDpid->GetTOFResponse().GetStartTime(p);
+  Float_t fTimeTOF=t->GetTOFsignal()- fT0track;
+
+  //2=pion 3=kaon 4=protons
+  Double_t inttimes[5]= {-1.0,-1.0,-1.0,-1.0,-1.0};
+  t->GetIntegratedTimes(inttimes);
+  fTOFsignal->Fill(p,fTimeTOF-inttimes[2]);
+
+  //P part
+  fTOFsignalpip->Fill(p,fTimeTOF-inttimes[2]);
+  fTOFsignalKp->Fill(p,fTimeTOF-inttimes[3]);
+  fTOFsignalpp->Fill(p,fTimeTOF-inttimes[4]);
+
+  fTOFsignalPiExpKvsPt->Fill(pt,-inttimes[2]+inttimes[3]);
+  fTOFsignalPiExpPvsPt->Fill(pt,-inttimes[2]+inttimes[4]);
+  fTOFsignalKExpPivsPt->Fill(pt,-inttimes[3]+inttimes[2]);
+  fTOFsignalKExpPvsPt->Fill(pt,-inttimes[3]+inttimes[4]);
+  fTOFsignalPExpPivsPt->Fill(pt,-inttimes[4]+inttimes[2]);
+  fTOFsignalPExpKvsPt->Fill(pt,-inttimes[4]+inttimes[3]);
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fTOFsignalpiMCp->Fill(p,fTimeTOF-inttimes[2]);
+    else if(TMath::Abs(pdgcode)==321)
+      fTOFsignalKMCp->Fill(p,fTimeTOF-inttimes[3]);
+    else if (TMath::Abs(pdgcode)==2212)
+      fTOFsignalpMCp->Fill(p,fTimeTOF-inttimes[4]);
+  }
+
+  //Pt part
+  fTOFsignalpi->Fill(pt,fTimeTOF-inttimes[2]);
+  fTOFsignalK->Fill(pt,fTimeTOF-inttimes[3]);
+  fTOFsignalp->Fill(pt,fTimeTOF-inttimes[4]);
+
+  fTOFsignalPiExpKvsP->Fill(p,-inttimes[2]+inttimes[3]);
+  fTOFsignalPiExpPvsP->Fill(p,-inttimes[2]+inttimes[4]);
+  fTOFsignalKExpPivsP->Fill(p,-inttimes[3]+inttimes[2]);
+  fTOFsignalKExpPvsP->Fill(p,-inttimes[3]+inttimes[4]);
+  fTOFsignalPExpPivsP->Fill(p,-inttimes[4]+inttimes[2]);
+  fTOFsignalPExpKvsP->Fill(p,-inttimes[4]+inttimes[3]);
+
+  if(fMC)
+  {
+    if(TMath::Abs(pdgcode)==211)
+      fTOFsignalpiMC->Fill(pt,fTimeTOF-inttimes[2]);
+    else if(TMath::Abs(pdgcode)==321)
+      fTOFsignalKMC->Fill(pt,fTimeTOF-inttimes[3]);
+    else if (TMath::Abs(pdgcode)==2212)
+      fTOFsignalpMC->Fill(pt,fTimeTOF-inttimes[4]);
+  }
+}
+
+
+
diff --git a/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.h b/PWG2/FLOW/AliFlowTasks/AliAnalysisTaskPIDflowQA.h
new file mode 100644 (file)
index 0000000..75e21e9
--- /dev/null
@@ -0,0 +1,108 @@
+//Class to extract data to do ITS+TPC global Spectra\r
+//Autor Marek Chojnacki, Marek.Chojnacki@cern.ch\r
+//modified Mikolaj Krzewicki, Mikolaj.Krzewicki@cern.ch\r
+\r
+#ifndef ALIANALYSISFLOWPIDTASK_H\r
+#define  ALIANALYSISFLOWPIDTASK_H\r
+class TH1F;\r
+class TH2F;\r
+class TH3F;\r
+class AliESDEvent;\r
+class AliESDtrack;\r
+class  AliESDtrackCuts;\r
+class AliESDpidCuts;\r
+class AliESDpid;\r
+class TGraph;\r
+class AliStack;\r
+class AliFlowEventCuts;\r
+#include "AliAnalysisTaskSE.h"\r
+#include "AliESDpid.h"\r
+\r
+class  AliAnalysisTaskPIDflowQA : public AliAnalysisTaskSE {\r
+public:\r
+  AliAnalysisTaskPIDflowQA();\r
+  AliAnalysisTaskPIDflowQA(const char *name);\r
+  virtual ~AliAnalysisTaskPIDflowQA() {}\r
+  \r
+  virtual void UserCreateOutputObjects();\r
+  virtual void UserExec(Option_t *option);\r
+  virtual void Terminate(Option_t *); \r
+\r
+  AliESDtrackCuts* GetAliESDtrackCuts() const {return fCuts;}\r
+  void SetAliESDtrackCuts(AliESDtrackCuts* const cuts ){fCuts=cuts;}\r
+  void SetEventCuts(AliFlowEventCuts* c) {fEventCuts=c;}\r
+  void SetMCOn(){fMC=kTRUE;}\r
+  AliESDpid* GetESDpid() const {return fESDpid;}\r
+\r
+private:\r
+  AliESDEvent *fESD;            //!ESD object    \r
+  AliESDtrackCuts *fCuts;       //cuts \r
+  AliFlowEventCuts *fEventCuts; //event cuts\r
+  AliESDpid *fESDpid;           //pid object\r
+  Bool_t fMC;                   //if TRUE use MC \r
+\r
+  TH2F *fITSsignal; //!ITS signal as function of p\r
+  TH2F *fTPCsignal; //!TPC signal as function of p\r
+  TH2F *fTOFsignal; //!TOF signal as function of  p \r
+  TH2F *fITSsignalpi;//!ITS PID signal as function of pt for pi+\r
+  TH2F *fTPCsignalpi;//!TPC PID signal as function of pt for pi+\r
+  TH2F *fTOFsignalpi;//!TOF PID signal as function of pt for pi+\r
+  TH2F *fITSsignalK;//!ITS PID signal as function of pt for K+\r
+  TH2F *fTPCsignalK;//!TPC PID signal as function of pt for K+\r
+  TH2F *fTOFsignalK;//!TOF PID signal as function of pt for K+\r
+  TH2F *fITSsignalp;//!ITS PID signal as function of pt for p\r
+  TH2F *fTPCsignalp;//!TPC PID signal as function of pt for p\r
+  TH2F *fTOFsignalp;//!TOF PID signal as function of pt for p\r
+  TH2F *fITSsignalpiMC;//!ITS PID signal as function of pt for pi+\r
+  TH2F *fTPCsignalpiMC;//!TPC PID signal as function of pt for pi+\r
+  TH2F *fTOFsignalpiMC;//!TOF PID signal as function of pt for pi+\r
+  TH2F *fITSsignalKMC;//!ITS PID signal as function of pt for K+\r
+  TH2F *fTPCsignalKMC;//!TPC PID signal as function of pt for K+\r
+  TH2F *fTOFsignalKMC;//!TOF PID signal as function of pt for K+\r
+  TH2F *fITSsignalpMC;//!ITS PID signal as function of pt for p\r
+  TH2F *fTPCsignalpMC;//!TPC PID signal as function of pt for p\r
+  TH2F *fTOFsignalpMC;//!TOF PID signal as function of pt for p\r
+  TH2F *fITSsignalpip;//!ITS PID signal as function of p for pi+\r
+  TH2F *fTPCsignalpip;//!TPC PID signal as function of p for pi+\r
+  TH2F *fTOFsignalpip;//!TOF PID signal as function of p for pi+\r
+  TH2F *fITSsignalKp;//!ITS PID signal as function of p for K+\r
+  TH2F *fTPCsignalKp;//!TPC PID signal as function of p for K+\r
+  TH2F *fTOFsignalKp;//!TOF PID signal as function of p for K+\r
+  TH2F *fITSsignalpp;//!ITS PID signal as function of p for p\r
+  TH2F *fTPCsignalpp;//!TPC PID signal as function of p for p\r
+  TH2F *fTOFsignalpp;//!TOF PID signal as function of p for p\r
+  TH2F *fITSsignalpiMCp;//!ITS PID signal as function of p for pi+\r
+  TH2F *fTPCsignalpiMCp;//!TPC PID signal as function of p for pi+\r
+  TH2F *fTOFsignalpiMCp;//!TOF PID signal as function of p for pi+\r
+  TH2F *fITSsignalKMCp;//!ITS PID signal as function of p for K+\r
+  TH2F *fTPCsignalKMCp;//!TPC PID signal as function of p for K+\r
+  TH2F *fTOFsignalKMCp;//!TOF PID signal as function of p for K+\r
+  TH2F *fITSsignalpMCp;//!ITS PID signal as function of p for p\r
+  TH2F *fTPCsignalpMCp;//!TPC PID signal as function of p for p\r
+  TH2F *fTOFsignalpMCp;//!TOF PID signal as function of p for p\r
+  TH2F *fTOFsignalPiExpKvsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalPiExpPvsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalKExpPivsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalKExpPvsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalPExpPivsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalPExpKvsPt;//!TOF expected signal\r
+  TH2F *fTOFsignalPiExpKvsP;//!TOF expected signal\r
+  TH2F *fTOFsignalPiExpPvsP;//!TOF expected signal\r
+  TH2F *fTOFsignalKExpPivsP;//!TOF expected signal\r
+  TH2F *fTOFsignalKExpPvsP;//!TOF expected signal\r
+  TH2F *fTOFsignalPExpPivsP;//!TOF expected signal\r
+  TH2F *fTOFsignalPExpKvsP;//!TOF expected signal\r
+  TH2F *fPvsPt; //!P vs Pt yield\r
+  TList *fOuputList;//!output list\r
+       \r
+  AliAnalysisTaskPIDflowQA(const  AliAnalysisTaskPIDflowQA&); // not implemented\r
+  AliAnalysisTaskPIDflowQA& operator=(const  AliAnalysisTaskPIDflowQA&); // not implemented\r
\r
+  void pidITS(AliESDtrack* t, Int_t pdgcode);\r
+  void pidTPC(AliESDtrack* t, Int_t pdgcode);\r
+  void pidTOF(AliESDtrack* t, Int_t pdgcode);\r
+    \r
+  ClassDef( AliAnalysisTaskPIDflowQA, 2); // example of analysis\r
+};\r
+\r
+#endif\r
index 554b8e2..4f207ae 100644 (file)
@@ -656,6 +656,7 @@ void AliFlowTrackCuts::HandleVParticle(AliVParticle* track)
 void AliFlowTrackCuts::HandleESDtrack(AliESDtrack* track)
 {
   //handle esd track
+  AliExternalTrackParam* ip=NULL;
   switch (fParamType)
   {
     case kGlobal:
@@ -669,6 +670,9 @@ void AliFlowTrackCuts::HandleESDtrack(AliESDtrack* track)
         fTrackLabel=-1;
         return;
       }
+      ip = const_cast<AliExternalTrackParam*>(fTPCtrack.GetInnerParam());
+      if (!ip) { ip = new AliExternalTrackParam(*(track->GetInnerParam())); }
+      else { *ip = *(track->GetInnerParam()); }
       fTrack = &fTPCtrack;
       //recalculate the label and mc particle, they may differ as TPClabel != global label
       fTrackLabel = (fFakesAreOK)?TMath::Abs(fTrack->GetLabel()):fTrack->GetLabel();
index 2072df0..1432e92 100644 (file)
@@ -375,8 +375,8 @@ Bool_t AliGlauberMC::CalcResults(Double_t bgen)
   // calc results for the given event
   //return true if we have participants
   
-  fNpart=0.;
-  fNcoll=0.;
+  fNpart=0;
+  fNcoll=0;
   fMeanX2=0.;
   fMeanY2=0.;
   fMeanXY=0.;
diff --git a/PWG2/FLOW/macros/AddTaskPIDflowQA.C b/PWG2/FLOW/macros/AddTaskPIDflowQA.C
new file mode 100644 (file)
index 0000000..b7699f0
--- /dev/null
@@ -0,0 +1,77 @@
+void AddTaskPIDflowQA( Float_t centrMin=0.,
+                       Float_t centrMax=100.,
+                       TString fileNameBase="outputPIDQA"  )
+{   
+  AliFlowEventCuts* cutsEvent = new AliFlowEventCuts("event cuts");
+  cutsEvent->SetCentralityPercentileRange(centrMin,centrMax);
+  cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0);
+  //cutsEvent->SetRefMultMethod(AliFlowEventCuts::kTPConly);
+  //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPD1tracklets);
+  cutsEvent->SetNContributorsRange(2);
+  cutsEvent->SetPrimaryVertexZrange(-10.,10.);
+  cutsEvent->SetCutSPDvertexerAnomaly(); //"Francesco's cut"
+  cutsEvent->SetCutZDCtiming();
+  
+       AliESDtrackCuts*  cutsTrack = new AliESDtrackCuts("cutsTrack","cutsTrack");
+       cutsTrack->SetPtRange(0.2,5.);
+       cutsTrack->SetEtaRange(-0.8,0.8);
+       cutsTrack->SetMinNClustersTPC(70);
+       cutsTrack->SetMaxChi2PerClusterTPC(4.0);
+       cutsTrack->SetMaxDCAToVertexXY(0.3);
+       cutsTrack->SetMaxDCAToVertexZ(0.3);
+       cutsTrack->SetDCAToVertex2D(kTRUE);
+       cutsTrack->SetAcceptKinkDaughters(kFALSE);
+       cutsTrack->SetRequireTPCRefit(kTRUE);
+       cutsTrack->SetRequireITSRefit(kTRUE);
+       cutsTrack->SetMinNClustersITS(2);
+       
+       //task1->SetNsigmaDCAcut(5.0,5.0);
+       //task1->SetMCOn();     
+
+  TString centralityName("");
+  centralityName+=Form("%.0f",centrMin);
+  centralityName+="-";
+  centralityName+=Form("%.0f",centrMax);
+
+  TString fileName(fileNameBase);
+  fileName.Append(Form("%.0f%.0f",centrMin,centrMax));
+  fileName.Append(".root");
+
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    Error("AddTaskFlowEvent", "No analysis manager to connect to.");
+    return;
+  }
+  
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskFlowEvent", "This task requires an input event handler");
+    return;
+  }  
+
+  AliAnalysisTaskPIDflowQA* task = new AliAnalysisTaskPIDflowQA(Form("taskPIDQA%.0f%.0f",centrMin,centrMax));
+       task->SetAliESDtrackCuts(cutsTrack);
+  task->SetEventCuts(cutsEvent);
+  task->SelectCollisionCandidates(AliVEvent::kMB);
+  //old
+  task->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(0.0283086,
+                                                    2.63394e+01,
+                                                    5.04114e-11,
+                                                    2.12543e+00,
+                                                    4.88663e+00 );
+  //new
+  //task->GetESDpid()->GetTPCResponse().SetBetheBlochParameters(1.28949/50.,
+  //                                                  2.74095e+01,
+  //                                                  TMath::Exp(-3.21763e+01),
+  //                                                  2.44026,
+  //                                                  6.58800);
+
+
+  mgr->AddTask(task);
+
+  AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("output%s",centralityName.Data()),
+                                                 TList::Class(),
+                                                 AliAnalysisManager::kOutputContainer,
+                                                 fileName.Data());
+  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
+  mgr->ConnectOutput(task,1,coutputQAtask);
+}
index f9d8a4c..d22d28d 100644 (file)
@@ -24,5 +24,6 @@
 #pragma link C++ class AliAnalysisTaskMixedHarmonics+;
 #pragma link C++ class AliAnalysisTaskNestedLoops+;
 #pragma link C++ class AliAnalysisTaskQAflow+;
+#pragma link C++ class AliAnalysisTaskPIDflowQA+;
 
 #endif