o add lists for ITSsa and ITSpureSA
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Aug 2011 16:39:48 +0000 (16:39 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Aug 2011 16:39:48 +0000 (16:39 +0000)
ANALYSIS/AliAnalysisTaskPIDqa.cxx
ANALYSIS/AliAnalysisTaskPIDqa.h

index eab0828..da816a3 100644 (file)
-/**************************************************************************
- * 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 purposes 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 purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id: AliAnalysisTaskPIDqa.cxx 43811 2010-09-23 14:13:31Z wiechula $ */
-#include <TList.h>
-#include <TVectorD.h>
-#include <TObjArray.h>
-#include <TH2.h>
-#include <TFile.h>
-#include <TPRegexp.h>
-#include <TChain.h>
-#include <TF1.h>
-#include <TSpline.h>
-
-#include <AliAnalysisManager.h>
-#include <AliInputEventHandler.h>
-#include <AliVEventHandler.h>
-#include <AliVEvent.h>
-#include <AliVParticle.h>
-#include <AliVTrack.h>
-#include <AliLog.h>
-#include <AliPID.h>
-#include <AliPIDResponse.h>
-#include <AliITSPIDResponse.h>
-#include <AliTPCPIDResponse.h>
-#include <AliTRDPIDResponse.h>
-#include <AliTOFPIDResponse.h>
-
-#include <AliESDEvent.h>
-
-#include "AliAnalysisTaskPIDqa.h"
-
-
-ClassImp(AliAnalysisTaskPIDqa)
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa():
-AliAnalysisTaskSE(),
-fPIDResponse(0x0),
-fListQA(0x0),
-fListQAits(0x0),
-fListQAtpc(0x0),
-fListQAtrd(0x0),
-fListQAtof(0x0),
-fListQAemcal(0x0),
-fListQAtpctof(0x0)
-{
-  //
-  // Dummy constructor
-  //
-}
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa(const char* name):
-AliAnalysisTaskSE(name),
-fPIDResponse(0x0),
-fListQA(0x0),
-fListQAits(0x0),
-fListQAtpc(0x0),
-fListQAtrd(0x0),
-fListQAtof(0x0),
-fListQAemcal(0x0),
-fListQAtpctof(0x0)
-{
-  //
-  // Default constructor
-  //
-  DefineInput(0,TChain::Class());
-  DefineOutput(1,TList::Class());
-}
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::~AliAnalysisTaskPIDqa()
-{
-  //
-  // Destructor
-  //
-
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::UserCreateOutputObjects()
-{
-  //
-  // Create the output QA objects
-  //
-
-  AliLog::SetClassDebugLevel("AliAnalysisTaskPIDqa",10);
-
-  //input hander
-  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
-  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());
-  if (!inputHandler) AliFatal("Input handler needed");
-
-  //pid response object
-  fPIDResponse=inputHandler->GetPIDResponse();
-  if (!fPIDResponse) AliError("PIDResponse object was not created");
-  
-  //
-  fListQA=new TList;
-  fListQA->SetOwner();
-  
-  fListQAits=new TList;
-  fListQAits->SetOwner();
-  fListQAits->SetName("ITS");
-  
-  fListQAtpc=new TList;
-  fListQAtpc->SetOwner();
-  fListQAtpc->SetName("TPC");
-  
-  fListQAtrd=new TList;
-  fListQAtrd->SetOwner();
-  fListQAtrd->SetName("TRD");
-  
-  fListQAtof=new TList;
-  fListQAtof->SetOwner();
-  fListQAtof->SetName("TOF");
-  
-  fListQAemcal=new TList;
-  fListQAemcal->SetOwner();
-  fListQAemcal->SetName("EMCAL");
-
-  fListQAtpctof=new TList;
-  fListQAtpctof->SetOwner();
-  fListQAtpctof->SetName("TPC_TOF");
-
-  fListQA->Add(fListQAits);
-  fListQA->Add(fListQAtpc);
-  fListQA->Add(fListQAtrd);
-  fListQA->Add(fListQAtof);
-  fListQA->Add(fListQAemcal);
-  fListQA->Add(fListQAtpctof);
-
-  SetupITSqa();
-  SetupTPCqa();
-  SetupTRDqa();
-  SetupTOFqa();
-  SetupEMCALqa();
-  SetupTPCTOFqa();
-
-  PostData(1,fListQA);
-}
-
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::UserExec(Option_t */*option*/)
-{
-  //
-  // Setup the PID response functions and fill the QA histograms
-  //
-
-  AliVEvent *event=InputEvent();
-  if (!event||!fPIDResponse) return;
-
-  
-  FillITSqa();
-  FillTPCqa();
-  FillTRDqa();
-  FillTOFqa();
-  FillEMCALqa();
-  FillTPCTOFqa();
-
-  PostData(1,fListQA);
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillITSqa()
-{
-  //
-  // Fill PID qa histograms for the ITS
-  //
-
-  AliVEvent *event=InputEvent();
-  
-  Int_t ntracks=event->GetNumberOfTracks();
-  for(Int_t itrack = 0; itrack < ntracks; itrack++){
-    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);
-    ULong_t status=track->GetStatus();
-    // not that nice. status bits not in virtual interface
-    // ITS refit + ITS pid
-    if (!( ( (status & AliVTrack::kITSrefit)==AliVTrack::kITSrefit ) &&
-           ( (status & AliVTrack::kITSpid  )==AliVTrack::kITSpid   ) )) continue;
-    Double_t mom=track->P();
-    
-    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-      TH2 *h=(TH2*)fListQAits->At(ispecie);
-      if (!h) continue;
-      Double_t nSigma=fPIDResponse->NumberOfSigmasITS(track, (AliPID::EParticleType)ispecie);
-      h->Fill(mom,nSigma);
-    }
-    
-    TH2 *h=(TH2*)fListQAits->At(AliPID::kSPECIES);
-    if (h) {
-      Double_t sig=track->GetITSsignal();
-      h->Fill(mom,sig);
-    }
-    
-  }
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTPCqa()
-{
-  //
-  // Fill PID qa histograms for the TPC
-  //
-  
-  AliVEvent *event=InputEvent();
-  
-  Int_t ntracks=event->GetNumberOfTracks();
-  for(Int_t itrack = 0; itrack < ntracks; itrack++){
-    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);
-    
-    //
-    //basic track cuts
-    //
-    ULong_t status=track->GetStatus();
-    // not that nice. status bits not in virtual interface
-    // TPC refit + ITS refit + TPC pid
-    if (!( (status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
-        !( (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||
-        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  ) ) continue;
-    
-    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
-    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;
-    if (track->GetTPCNclsF()>0) {
-      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
-    }
-    
-    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;
-    
-    Double_t mom=track->GetTPCmomentum();
-    
-    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-      TH2 *h=(TH2*)fListQAtpc->At(ispecie);
-      if (!h) continue;
-      Double_t nSigma=fPIDResponse->NumberOfSigmasTPC(track, (AliPID::EParticleType)ispecie);
-      h->Fill(mom,nSigma);
-    }
-    
-    TH2 *h=(TH2*)fListQAtpc->At(AliPID::kSPECIES);
-    if (h) {
-      Double_t sig=track->GetTPCsignal();
-      h->Fill(mom,sig);
-    }
-  }
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTRDqa()
-{
-  //
-  // Fill PID qa histograms for the TRD
-  //
-
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTOFqa()
-{
-  //
-  // Fill PID qa histograms for the TOF
-  //
-
-  AliVEvent *event=InputEvent();
-  
-
-  Int_t ntracks=event->GetNumberOfTracks();
-  Int_t tracksAtTof = 0;
-  for(Int_t itrack = 0; itrack < ntracks; itrack++){
-    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);
-    
-    //
-    //basic track cuts
-    //
-    ULong_t status=track->GetStatus();
-    // TPC refit + ITS refit +
-    // TOF out + TOFpid +
-    // kTIME
-    // (we don't use kTOFmismatch because it depends on TPC....)
-    if (!((status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
-        !((status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||
-        !((status & AliVTrack::kTOFout  ) == AliVTrack::kTOFout  ) ||
-        !((status & AliVTrack::kTOFpid  ) == AliVTrack::kTOFpid  ) ||
-        !((status & AliVTrack::kTIME    ) == AliVTrack::kTIME    ) ) continue;
-    
-    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
-    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;
-    if (track->GetTPCNclsF()>0) {
-      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
-    }
-    
-    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;
-    
-    tracksAtTof++;
-    
-    Double_t mom=track->P();
-    
-    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-      //TOF nSigma
-      TH2 *h=(TH2*)fListQAtof->At(ispecie);
-      if (!h) continue;
-      Double_t nSigma=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);
-      h->Fill(mom,nSigma);
-    }
-    
-    TH2 *h=(TH2*)fListQAtof->FindObject("hSigP_TOF");
-    if (h) {
-      Double_t sig=track->GetTOFsignal();
-      h->Fill(mom,sig);
-    }
-    
-    Double_t mask = (Double_t)fPIDResponse->GetTOFResponse().GetStartTimeMask(mom) + 0.5;
-    ((TH1F*)fListQAtof->FindObject("hStartTimeMask_TOF"))->Fill(mask);
-
-    Double_t res = (Double_t)fPIDResponse->GetTOFResponse().GetStartTimeRes(mom);
-    ((TH1F*)fListQAtof->FindObject("hStartTimeRes_TOF"))->Fill(res);
-
-    AliESDEvent *esd = dynamic_cast<AliESDEvent *>(event);
-    if (esd) {
-      Double_t startTime = esd->GetT0TOF(0);
-      if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeAC_T0"))->Fill(startTime);
-      else {
-       startTime = esd->GetT0TOF(1);
-       if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeA_T0"))->Fill(startTime);
-       startTime = esd->GetT0TOF(2);
-       if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeC_T0"))->Fill(startTime);
-      }
-    }    
-  }
-  if (tracksAtTof > 0) {
-    ((TH1F* )fListQAtof->FindObject("hnTracksAt_TOF"))->Fill(tracksAtTof);
-    Int_t mask = fPIDResponse->GetTOFResponse().GetStartTimeMask(5.); 
-    if (mask & 0x1) ((TH1F*)fListQAtof->FindObject("hT0MakerEff"))->Fill(tracksAtTof);
-}
-
-}
-
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillEMCALqa()
-{
-  //
-  // Fill PID qa histograms for the EMCAL
-  //
-
+/**************************************************************************\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
+/* $Id: AliAnalysisTaskPIDqa.cxx 43811 2010-09-23 14:13:31Z wiechula $ */\r
+#include <TList.h>\r
+#include <TVectorD.h>\r
+#include <TObjArray.h>\r
+#include <TH2.h>\r
+#include <TFile.h>\r
+#include <TPRegexp.h>\r
+#include <TChain.h>\r
+#include <TF1.h>\r
+#include <TSpline.h>\r
+\r
+#include <AliAnalysisManager.h>\r
+#include <AliInputEventHandler.h>\r
+#include <AliVEventHandler.h>\r
+#include <AliVEvent.h>\r
+#include <AliVParticle.h>\r
+#include <AliVTrack.h>\r
+#include <AliLog.h>\r
+#include <AliPID.h>\r
+#include <AliPIDResponse.h>\r
+#include <AliITSPIDResponse.h>\r
+#include <AliTPCPIDResponse.h>\r
+#include <AliTRDPIDResponse.h>\r
+#include <AliTOFPIDResponse.h>\r
+\r
+#include "AliAnalysisTaskPIDqa.h"\r
+\r
+\r
+ClassImp(AliAnalysisTaskPIDqa)\r
+\r
+//______________________________________________________________________________\r
+AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa():\r
+AliAnalysisTaskSE(),\r
+fPIDResponse(0x0),\r
+fListQA(0x0),\r
+fListQAits(0x0),\r
+fListQAitsSA(0x0),\r
+fListQAitsPureSA(0x0),\r
+fListQAtpc(0x0),\r
+fListQAtrd(0x0),\r
+fListQAtof(0x0),\r
+fListQAemcal(0x0),\r
+fListQAtpctof(0x0)\r
+{\r
+  //\r
+  // Dummy constructor\r
+  //\r
+}\r
+\r
+//______________________________________________________________________________\r
+AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa(const char* name):\r
+AliAnalysisTaskSE(name),\r
+fPIDResponse(0x0),\r
+fListQA(0x0),\r
+fListQAits(0x0),\r
+fListQAitsSA(0x0),\r
+fListQAitsPureSA(0x0),\r
+fListQAtpc(0x0),\r
+fListQAtrd(0x0),\r
+fListQAtof(0x0),\r
+fListQAemcal(0x0),\r
+fListQAtpctof(0x0)\r
+{\r
+  //\r
+  // Default constructor\r
+  //\r
+  DefineInput(0,TChain::Class());\r
+  DefineOutput(1,TList::Class());\r
+}\r
+\r
+//______________________________________________________________________________\r
+AliAnalysisTaskPIDqa::~AliAnalysisTaskPIDqa()\r
+{\r
+  //\r
+  // Destructor\r
+  //\r
+\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::UserCreateOutputObjects()\r
+{\r
+  //\r
+  // Create the output QA objects\r
+  //\r
+\r
+  AliLog::SetClassDebugLevel("AliAnalysisTaskPIDqa",10);\r
+\r
+  //input hander\r
+  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();\r
+  AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());\r
+  if (!inputHandler) AliFatal("Input handler needed");\r
+\r
+  //pid response object\r
+  fPIDResponse=inputHandler->GetPIDResponse();\r
+  if (!fPIDResponse) AliError("PIDResponse object was not created");\r
+  \r
+  //\r
+  fListQA=new TList;\r
+  fListQA->SetOwner();\r
+  \r
+  fListQAits=new TList;\r
+  fListQAits->SetOwner();\r
+  fListQAits->SetName("ITS");\r
+\r
+  fListQAitsSA=new TList;\r
+  fListQAitsSA->SetOwner();\r
+  fListQAitsSA->SetName("ITS");\r
+\r
+  fListQAitsPureSA=new TList;\r
+  fListQAitsPureSA->SetOwner();\r
+  fListQAitsPureSA->SetName("ITS");\r
+\r
+  fListQAtpc=new TList;\r
+  fListQAtpc->SetOwner();\r
+  fListQAtpc->SetName("TPC");\r
+  \r
+  fListQAtrd=new TList;\r
+  fListQAtrd->SetOwner();\r
+  fListQAtrd->SetName("TRD");\r
+  \r
+  fListQAtof=new TList;\r
+  fListQAtof->SetOwner();\r
+  fListQAtof->SetName("TOF");\r
+  \r
+  fListQAemcal=new TList;\r
+  fListQAemcal->SetOwner();\r
+  fListQAemcal->SetName("EMCAL");\r
+\r
+  fListQAtpctof=new TList;\r
+  fListQAtpctof->SetOwner();\r
+  fListQAtpctof->SetName("TPC_TOF");\r
+\r
+  fListQA->Add(fListQAits);\r
+  fListQA->Add(fListQAitsSA);\r
+  fListQA->Add(fListQAitsPureSA);\r
+  fListQA->Add(fListQAtpc);\r
+  fListQA->Add(fListQAtrd);\r
+  fListQA->Add(fListQAtof);\r
+  fListQA->Add(fListQAemcal);\r
+  fListQA->Add(fListQAtpctof);\r
+\r
+  SetupITSqa();\r
+  SetupTPCqa();\r
+  SetupTRDqa();\r
+  SetupTOFqa();\r
+  SetupEMCALqa();\r
+  SetupTPCTOFqa();\r
+\r
+  PostData(1,fListQA);\r
+}\r
+\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::UserExec(Option_t */*option*/)\r
+{\r
+  //\r
+  // Setup the PID response functions and fill the QA histograms\r
+  //\r
+\r
+  AliVEvent *event=InputEvent();\r
+  if (!event||!fPIDResponse) return;\r
+\r
+  \r
+  FillITSqa();\r
+  FillTPCqa();\r
+  FillTRDqa();\r
+  FillTOFqa();\r
+  FillEMCALqa();\r
+  FillTPCTOFqa();\r
+\r
+  PostData(1,fListQA);\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillITSqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the ITS\r
+  //\r
+\r
+  AliVEvent *event=InputEvent();\r
+  \r
+  Int_t ntracks=event->GetNumberOfTracks();\r
+  for(Int_t itrack = 0; itrack < ntracks; itrack++){\r
+    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);\r
+    ULong_t status=track->GetStatus();\r
+    // not that nice. status bits not in virtual interface\r
+    // ITS refit + ITS pid\r
+    if (!( ( (status & AliVTrack::kITSrefit)==AliVTrack::kITSrefit ) &&\r
+           ( (status & AliVTrack::kITSpid  )==AliVTrack::kITSpid   ) )) continue;\r
+    Double_t mom=track->P();\r
+    \r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+      TH2 *h=(TH2*)fListQAits->At(ispecie);\r
+      if (!h) continue;\r
+      Double_t nSigma=fPIDResponse->NumberOfSigmasITS(track, (AliPID::EParticleType)ispecie);\r
+      h->Fill(mom,nSigma);\r
+    }\r
+    \r
+    TH2 *h=(TH2*)fListQAits->At(AliPID::kSPECIES);\r
+    if (h) {\r
+      Double_t sig=track->GetITSsignal();\r
+      h->Fill(mom,sig);\r
+    }\r
+    \r
+  }\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTPCqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the TPC\r
+  //\r
+  \r
+  AliVEvent *event=InputEvent();\r
+  \r
+  Int_t ntracks=event->GetNumberOfTracks();\r
+  for(Int_t itrack = 0; itrack < ntracks; itrack++){\r
+    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);\r
+    \r
+    //\r
+    //basic track cuts\r
+    //\r
+    ULong_t status=track->GetStatus();\r
+    // not that nice. status bits not in virtual interface\r
+    // TPC refit + ITS refit + TPC pid\r
+    if (!( (status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||\r
+        !( (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||\r
+        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  ) ) continue;\r
+    \r
+    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);\r
+    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;\r
+    if (track->GetTPCNclsF()>0) {\r
+      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();\r
+    }\r
+    \r
+    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;\r
+    \r
+    Double_t mom=track->GetTPCmomentum();\r
+    \r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+      TH2 *h=(TH2*)fListQAtpc->At(ispecie);\r
+      if (!h) continue;\r
+      Double_t nSigma=fPIDResponse->NumberOfSigmasTPC(track, (AliPID::EParticleType)ispecie);\r
+      h->Fill(mom,nSigma);\r
+    }\r
+    \r
+    TH2 *h=(TH2*)fListQAtpc->At(AliPID::kSPECIES);\r
+    if (h) {\r
+      Double_t sig=track->GetTPCsignal();\r
+      h->Fill(mom,sig);\r
+    }\r
+  }\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTRDqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the TRD\r
+  //\r
+\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTOFqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the TOF\r
+  //\r
+\r
+  AliVEvent *event=InputEvent();\r
+  \r
+  Int_t ntracks=event->GetNumberOfTracks();\r
+  for(Int_t itrack = 0; itrack < ntracks; itrack++){\r
+    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);\r
+    \r
+    //\r
+    //basic track cuts\r
+    //\r
+    ULong_t status=track->GetStatus();\r
+    // not that nice. status bits not in virtual interface\r
+    // TPC refit + ITS refit +\r
+    // TOF out + TOFpid +\r
+    // kTIME\r
+    if (!((status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||\r
+        !((status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||\r
+        !((status & AliVTrack::kTOFout  ) == AliVTrack::kTOFout  ) ||\r
+        !((status & AliVTrack::kTOFpid  ) == AliVTrack::kTOFpid  ) ||\r
+        !((status & AliVTrack::kTIME    ) == AliVTrack::kTIME    ) ) continue;\r
+    \r
+    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);\r
+    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;\r
+    if (track->GetTPCNclsF()>0) {\r
+      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();\r
+    }\r
+    \r
+    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;\r
+    \r
+    \r
+    Double_t mom=track->P();\r
+    \r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+      //TOF nSigma\r
+      TH2 *h=(TH2*)fListQAtof->At(ispecie);\r
+      if (!h) continue;\r
+      Double_t nSigma=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);\r
+      h->Fill(mom,nSigma);\r
+    }\r
+    \r
+    TH2 *h=(TH2*)fListQAtof->At(AliPID::kSPECIES);\r
+    if (h) {\r
+      Double_t sig=track->GetTOFsignal();\r
+      h->Fill(mom,sig);\r
+    }\r
+    \r
+  }\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillEMCALqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the EMCAL\r
+  //\r
+\r
   AliVEvent *event=InputEvent();\r
   \r
   Int_t ntracks=event->GetNumberOfTracks();\r
@@ -410,62 +395,62 @@ void AliAnalysisTaskPIDqa::FillEMCALqa()
       }\r
     }\r
   }\r
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTPCTOFqa()
-{
-  //
-  // Fill PID qa histograms for the TOF
-  //   Here also the TPC histograms after TOF selection are filled
-  //
-
-  AliVEvent *event=InputEvent();
-
-  Int_t ntracks=event->GetNumberOfTracks();
-  for(Int_t itrack = 0; itrack < ntracks; itrack++){
-    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);
-
-    //
-    //basic track cuts
-    //
-    ULong_t status=track->GetStatus();
-    // not that nice. status bits not in virtual interface
-    // TPC refit + ITS refit +
-    // TOF out + TOFpid +
-    // kTIME
-    if (!((status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
-        !((status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||
-        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid ) ||
-        !((status & AliVTrack::kTOFout  ) == AliVTrack::kTOFout  ) ||
-        !((status & AliVTrack::kTOFpid  ) == AliVTrack::kTOFpid  ) ||
-        !((status & AliVTrack::kTIME    ) == AliVTrack::kTIME    ) ) continue;
-
-    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
-    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;
-    if (track->GetTPCNclsF()>0) {
-      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
-    }
-
-    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;
-
-
-    Double_t mom=track->P();
-    Double_t momTPC=track->GetTPCmomentum();
-
-    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-      //TOF nSigma
-      Double_t nSigmaTOF=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);
-      Double_t nSigmaTPC=fPIDResponse->NumberOfSigmasTPC(track, (AliPID::EParticleType)ispecie);
-
-      //TPC after TOF cut
-      TH2 *h=(TH2*)fListQAtpctof->At(ispecie);
-      if (h && TMath::Abs(nSigmaTOF)<3.) h->Fill(momTPC,nSigmaTPC);
-
-      //TOF after TPC cut
-      h=(TH2*)fListQAtpctof->At(ispecie+AliPID::kSPECIES);
-      if (h && TMath::Abs(nSigmaTPC)<3.) h->Fill(mom,nSigmaTOF);
-
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTPCTOFqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the TOF\r
+  //   Here also the TPC histograms after TOF selection are filled\r
+  //\r
+\r
+  AliVEvent *event=InputEvent();\r
+\r
+  Int_t ntracks=event->GetNumberOfTracks();\r
+  for(Int_t itrack = 0; itrack < ntracks; itrack++){\r
+    AliVTrack *track=(AliVTrack*)event->GetTrack(itrack);\r
+\r
+    //\r
+    //basic track cuts\r
+    //\r
+    ULong_t status=track->GetStatus();\r
+    // not that nice. status bits not in virtual interface\r
+    // TPC refit + ITS refit +\r
+    // TOF out + TOFpid +\r
+    // kTIME\r
+    if (!((status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||\r
+        !((status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||\r
+        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid ) ||\r
+        !((status & AliVTrack::kTOFout  ) == AliVTrack::kTOFout  ) ||\r
+        !((status & AliVTrack::kTOFpid  ) == AliVTrack::kTOFpid  ) ||\r
+        !((status & AliVTrack::kTIME    ) == AliVTrack::kTIME    ) ) continue;\r
+\r
+    Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);\r
+    Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;\r
+    if (track->GetTPCNclsF()>0) {\r
+      ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();\r
+    }\r
+\r
+    if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ) continue;\r
+\r
+\r
+    Double_t mom=track->P();\r
+    Double_t momTPC=track->GetTPCmomentum();\r
+\r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+      //TOF nSigma\r
+      Double_t nSigmaTOF=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);\r
+      Double_t nSigmaTPC=fPIDResponse->NumberOfSigmasTPC(track, (AliPID::EParticleType)ispecie);\r
+\r
+      //TPC after TOF cut\r
+      TH2 *h=(TH2*)fListQAtpctof->At(ispecie);\r
+      if (h && TMath::Abs(nSigmaTOF)<3.) h->Fill(momTPC,nSigmaTPC);\r
+\r
+      //TOF after TPC cut\r
+      h=(TH2*)fListQAtpctof->At(ispecie+AliPID::kSPECIES);\r
+      if (h && TMath::Abs(nSigmaTPC)<3.) h->Fill(mom,nSigmaTOF);\r
+\r
       //EMCAL after TOF and TPC cut\r
       h=(TH2*)fListQAtpctof->At(ispecie+2*AliPID::kSPECIES);\r
       if (h && TMath::Abs(nSigmaTOF)<3. && TMath::Abs(nSigmaTPC)<3. ){\r
@@ -493,128 +478,107 @@ void AliAnalysisTaskPIDqa::FillTPCTOFqa()
          }\r
        }\r
       }\r
-    }
-  }
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupITSqa()
-{
-  //
-  // Create the ITS qa objects
-  //
-  
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_ITS_%s",AliPID::ParticleName(ispecie)),
-                              Form("ITS n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1,vX->GetMatrixArray(),
-                              200,-10,10);
-    fListQAits->Add(hNsigmaP);
-  }
-  
-  
-  TH2F *hSig = new TH2F("hSigP_ITS",
-                        "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",
-                        vX->GetNrows()-1,vX->GetMatrixArray(),
-                        300,0,300);
-  fListQAits->Add(hSig);
-
-  delete vX;  
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupTPCqa()
-{
-  //
-  // Create the TPC qa objects
-  //
-  
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TPC_%s",AliPID::ParticleName(ispecie)),
-                              Form("TPC n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1,vX->GetMatrixArray(),
-                              200,-10,10);
-    fListQAtpc->Add(hNsigmaP);
-  }
-  
-  
-  TH2F *hSig = new TH2F("hSigP_TPC",
-                        "TPC signal vs. p;p [GeV]; TPC signal [arb. units]",
-                        vX->GetNrows()-1,vX->GetMatrixArray(),
-                        300,0,300);
-  fListQAtpc->Add(hSig);
-
-  delete vX;  
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupTRDqa()
-{
-  //
-  // Create the TRD qa objects
-  //
-  
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupTOFqa()
-{
-  //
-  // Create the TOF qa objects
-  //
-  
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TOF_%s",AliPID::ParticleName(ispecie)),
-                              Form("TOF n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1,vX->GetMatrixArray(),
-                              200,-10,10);
-    fListQAtof->Add(hNsigmaP);
-    // to be added: t-texp without StartTime subtraction
-  }
-  
-  
-  TH2F *hSig = new TH2F("hSigP_TOF",
-                        "TOF signal vs. p;p [GeV]; TOF signal [arb. units]",
-                        vX->GetNrows()-1,vX->GetMatrixArray(),
-                        300,0,300);
-  
-  fListQAtof->Add(hSig);
-
-  delete vX;  
-
-  TH1F *hStartTimeMask_TOF = new TH1F("hStartTimeMask_TOF","StartTime mask",8,0,8);
-  fListQAtof->Add(hStartTimeMask_TOF);
-  TH1F *hStartTimeRes_TOF = new TH1F("hStartTimeRes_TOF","StartTime resolution [ps]",100,0,500);
-  fListQAtof->Add(hStartTimeRes_TOF);
-
-  TH1F *hnTracksAt_TOF = new TH1F("hnTracksAt_TOF","Matched tracks at TOF",20,0,20);
-  fListQAtof->Add(hnTracksAt_TOF);
-  TH1F *hT0MakerEff = new TH1F("hT0MakerEff","Events with T0-TOF vs nTracks",20,0,20);
-  fListQAtof->Add(hT0MakerEff);
-
-  // this in principle should stay on a T0 PID QA, but are just the data prepared for TOF use
-  TH1F *hStartTimeA_T0 = new TH1F("hStartTimeA_T0","StartTime from T0A [ps]",1000,-1000,1000);
-  fListQAtof->Add(hStartTimeA_T0);
-  TH1F *hStartTimeC_T0 = new TH1F("hStartTimeC_T0","StartTime from T0C [ps]",1000,-1000,1000);
-  fListQAtof->Add(hStartTimeC_T0);
-  TH1F *hStartTimeAC_T0 = new TH1F("hStartTimeAC_T0","StartTime from T0AC [ps]",1000,-1000,1000);;
-  fListQAtof->Add(hStartTimeAC_T0);
-
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupEMCALqa()
-{
-  //
-  // Create the EMCAL qa objects
-  //
-
+    }\r
+  }\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupITSqa()\r
+{\r
+  //\r
+  // Create the ITS qa objects\r
+  //\r
+  \r
+  TVectorD *vX=MakeLogBinning(200,.1,30);\r
+  \r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_ITS_%s",AliPID::ParticleName(ispecie)),\r
+                              Form("ITS n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                              200,-10,10);\r
+    fListQAits->Add(hNsigmaP);\r
+  }\r
+  \r
+  \r
+  TH2F *hSig = new TH2F("hSigP_ITS",\r
+                        "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",\r
+                        vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                        300,0,300);\r
+  fListQAits->Add(hSig);\r
+\r
+  delete vX;  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupTPCqa()\r
+{\r
+  //\r
+  // Create the TPC qa objects\r
+  //\r
+  \r
+  TVectorD *vX=MakeLogBinning(200,.1,30);\r
+  \r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TPC_%s",AliPID::ParticleName(ispecie)),\r
+                              Form("TPC n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                              200,-10,10);\r
+    fListQAtpc->Add(hNsigmaP);\r
+  }\r
+  \r
+  \r
+  TH2F *hSig = new TH2F("hSigP_TPC",\r
+                        "TPC signal vs. p;p [GeV]; TPC signal [arb. units]",\r
+                        vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                        300,0,300);\r
+  fListQAtpc->Add(hSig);\r
+\r
+  delete vX;  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupTRDqa()\r
+{\r
+  //\r
+  // Create the TRD qa objects\r
+  //\r
+  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupTOFqa()\r
+{\r
+  //\r
+  // Create the TOF qa objects\r
+  //\r
+  \r
+  TVectorD *vX=MakeLogBinning(200,.1,30);\r
+  \r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TOF_%s",AliPID::ParticleName(ispecie)),\r
+                              Form("TOF n#sigma %s vs. p;p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                              200,-10,10);\r
+    fListQAtof->Add(hNsigmaP);\r
+  }\r
+  \r
+  \r
+  TH2F *hSig = new TH2F("hSigP_TOF",\r
+                        "TOF signal vs. p;p [GeV]; TOF signal [arb. units]",\r
+                        vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                        300,0,300);\r
+  fListQAtof->Add(hSig);\r
+\r
+  delete vX;  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupEMCALqa()\r
+{\r
+  //\r
+  // Create the EMCAL qa objects\r
+  //\r
+\r
   TVectorD *vX=MakeLogBinning(200,.1,30);\r
   \r
   TH2F *hNsigmaPt = new TH2F(Form("hNsigmaPt_EMCAL_%s",AliPID::ParticleName(0)),\r
@@ -630,35 +594,35 @@ void AliAnalysisTaskPIDqa::SetupEMCALqa()
   fListQAemcal->Add(hSigPt);\r
 \r
   delete vX;  \r
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupTPCTOFqa()
-{
-  //
-  // Create the qa objects for TPC + TOF combination
-  //
-  
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-
-  //TPC signals after TOF cut
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TPC_TOF_%s",AliPID::ParticleName(ispecie)),
-                              Form("TPC n#sigma %s vs. p (after TOF 3#sigma cut);p_{TPC} [GeV]; n#sigma",AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1,vX->GetMatrixArray(),
-                              200,-10,10);
-    fListQAtpctof->Add(hNsigmaP);
-  }
-
-  //TOF signals after TPC cut
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TOF_TPC_%s",AliPID::ParticleName(ispecie)),
-                              Form("TOF n#sigma %s vs. p (after TPC n#sigma cut);p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1,vX->GetMatrixArray(),
-                              200,-10,10);
-    fListQAtpctof->Add(hNsigmaP);
-  }
-
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupTPCTOFqa()\r
+{\r
+  //\r
+  // Create the qa objects for TPC + TOF combination\r
+  //\r
+  \r
+  TVectorD *vX=MakeLogBinning(200,.1,30);\r
+\r
+  //TPC signals after TOF cut\r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TPC_TOF_%s",AliPID::ParticleName(ispecie)),\r
+                              Form("TPC n#sigma %s vs. p (after TOF 3#sigma cut);p_{TPC} [GeV]; n#sigma",AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                              200,-10,10);\r
+    fListQAtpctof->Add(hNsigmaP);\r
+  }\r
+\r
+  //TOF signals after TPC cut\r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaP = new TH2F(Form("hNsigmaP_TOF_TPC_%s",AliPID::ParticleName(ispecie)),\r
+                              Form("TOF n#sigma %s vs. p (after TPC n#sigma cut);p [GeV]; n#sigma",AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                              200,-10,10);\r
+    fListQAtpctof->Add(hNsigmaP);\r
+  }\r
+\r
   //EMCAL signal after TOF and TPC cut\r
   for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
     TH2F *heopPt = new TH2F(Form("heopPt_TOF_TPC_%s",AliPID::ParticleName(ispecie)),\r
@@ -668,84 +632,84 @@ void AliAnalysisTaskPIDqa::SetupTPCTOFqa()
     fListQAtpctof->Add(heopPt);\r
   }\r
 \r
-  delete vX;
-}
-
-//______________________________________________________________________________
-TVectorD* AliAnalysisTaskPIDqa::MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)
-{
-  //
-  // Make logarithmic binning
-  // the user has to delete the array afterwards!!!
-  //
-  
-  //check limits
-  if (xmin<1e-20 || xmax<1e-20){
-    AliError("For Log binning xmin and xmax must be > 1e-20. Using linear binning instead!");
-    return MakeLinBinning(nbinsX, xmin, xmax);
-  }
-  if (xmax<xmin){
-    Double_t tmp=xmin;
-    xmin=xmax;
-    xmax=tmp;
-  }
-  TVectorD *binLim=new TVectorD(nbinsX+1);
-  Double_t first=xmin;
-  Double_t last=xmax;
-  Double_t expMax=TMath::Log(last/first);
-  for (Int_t i=0; i<nbinsX+1; ++i){
-    (*binLim)[i]=first*TMath::Exp(expMax/nbinsX*(Double_t)i);
-  }
-  return binLim;
-}
-
-//______________________________________________________________________________
-TVectorD* AliAnalysisTaskPIDqa::MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)
-{
-  //
-  // Make linear binning
-  // the user has to delete the array afterwards!!!
-  //
-  if (xmax<xmin){
-    Double_t tmp=xmin;
-    xmin=xmax;
-    xmax=tmp;
-  }
-  TVectorD *binLim=new TVectorD(nbinsX+1);
-  Double_t first=xmin;
-  Double_t last=xmax;
-  Double_t binWidth=(last-first)/nbinsX;
-  for (Int_t i=0; i<nbinsX+1; ++i){
-    (*binLim)[i]=first+binWidth*(Double_t)i;
-  }
-  return binLim;
-}
-
-//_____________________________________________________________________________
-TVectorD* AliAnalysisTaskPIDqa::MakeArbitraryBinning(const char* bins)
-{
-  //
-  // Make arbitrary binning, bins separated by a ','
-  //
-  TString limits(bins);
-  if (limits.IsNull()){
-    AliError("Bin Limit string is empty, cannot add the variable");
-    return 0x0;
-  }
-  
-  TObjArray *arr=limits.Tokenize(",");
-  Int_t nLimits=arr->GetEntries();
-  if (nLimits<2){
-    AliError("Need at leas 2 bin limits, cannot add the variable");
-    delete arr;
-    return 0x0;
-  }
-  
-  TVectorD *binLimits=new TVectorD(nLimits);
-  for (Int_t iLim=0; iLim<nLimits; ++iLim){
-    (*binLimits)[iLim]=(static_cast<TObjString*>(arr->At(iLim)))->GetString().Atof();
-  }
-  
-  delete arr;
-  return binLimits;
-}
+  delete vX;\r
+}\r
+\r
+//______________________________________________________________________________\r
+TVectorD* AliAnalysisTaskPIDqa::MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)\r
+{\r
+  //\r
+  // Make logarithmic binning\r
+  // the user has to delete the array afterwards!!!\r
+  //\r
+  \r
+  //check limits\r
+  if (xmin<1e-20 || xmax<1e-20){\r
+    AliError("For Log binning xmin and xmax must be > 1e-20. Using linear binning instead!");\r
+    return MakeLinBinning(nbinsX, xmin, xmax);\r
+  }\r
+  if (xmax<xmin){\r
+    Double_t tmp=xmin;\r
+    xmin=xmax;\r
+    xmax=tmp;\r
+  }\r
+  TVectorD *binLim=new TVectorD(nbinsX+1);\r
+  Double_t first=xmin;\r
+  Double_t last=xmax;\r
+  Double_t expMax=TMath::Log(last/first);\r
+  for (Int_t i=0; i<nbinsX+1; ++i){\r
+    (*binLim)[i]=first*TMath::Exp(expMax/nbinsX*(Double_t)i);\r
+  }\r
+  return binLim;\r
+}\r
+\r
+//______________________________________________________________________________\r
+TVectorD* AliAnalysisTaskPIDqa::MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)\r
+{\r
+  //\r
+  // Make linear binning\r
+  // the user has to delete the array afterwards!!!\r
+  //\r
+  if (xmax<xmin){\r
+    Double_t tmp=xmin;\r
+    xmin=xmax;\r
+    xmax=tmp;\r
+  }\r
+  TVectorD *binLim=new TVectorD(nbinsX+1);\r
+  Double_t first=xmin;\r
+  Double_t last=xmax;\r
+  Double_t binWidth=(last-first)/nbinsX;\r
+  for (Int_t i=0; i<nbinsX+1; ++i){\r
+    (*binLim)[i]=first+binWidth*(Double_t)i;\r
+  }\r
+  return binLim;\r
+}\r
+\r
+//_____________________________________________________________________________\r
+TVectorD* AliAnalysisTaskPIDqa::MakeArbitraryBinning(const char* bins)\r
+{\r
+  //\r
+  // Make arbitrary binning, bins separated by a ','\r
+  //\r
+  TString limits(bins);\r
+  if (limits.IsNull()){\r
+    AliError("Bin Limit string is empty, cannot add the variable");\r
+    return 0x0;\r
+  }\r
+  \r
+  TObjArray *arr=limits.Tokenize(",");\r
+  Int_t nLimits=arr->GetEntries();\r
+  if (nLimits<2){\r
+    AliError("Need at leas 2 bin limits, cannot add the variable");\r
+    delete arr;\r
+    return 0x0;\r
+  }\r
+  \r
+  TVectorD *binLimits=new TVectorD(nLimits);\r
+  for (Int_t iLim=0; iLim<nLimits; ++iLim){\r
+    (*binLimits)[iLim]=(static_cast<TObjString*>(arr->At(iLim)))->GetString().Atof();\r
+  }\r
+  \r
+  delete arr;\r
+  return binLimits;\r
+}\r
index 75e8955..2daac45 100644 (file)
@@ -38,14 +38,16 @@ public:
 
   
 private: 
-  AliPIDResponse *fPIDResponse;        //! PID response Handler
-  TList                 *fListQA;      //! list with all QA histograms
-  TList                 *fListQAits;   //! List with ITS QA histograms
-  TList                 *fListQAtpc;   //! List with TPC QA histograms
-  TList                 *fListQAtrd;   //! List with TRD QA histograms
-  TList                 *fListQAtof;   //! List with TOF QA histograms
-  TList                 *fListQAemcal; //! List with EMCAL QA histograms
-  TList                 *fListQAtpctof;//! List with combined PID from TPC + TOF
+  AliPIDResponse *fPIDResponse;             //! PID response Handler
+  TList                 *fListQA;           //! list with all QA histograms
+  TList                 *fListQAits;        //! List with ITS QA histograms
+  TList                 *fListQAitsSA;      //! List with ITS SA QA histograms
+  TList                 *fListQAitsPureSA;  //! List with ITS pure SA QA histograms
+  TList                 *fListQAtpc;        //! List with TPC QA histograms
+  TList                 *fListQAtrd;        //! List with TRD QA histograms
+  TList                 *fListQAtof;        //! List with TOF QA histograms
+  TList                 *fListQAemcal;      //! List with EMCAL QA histograms
+  TList                 *fListQAtpctof;     //! List with combined PID from TPC + TOF
 
   
   void ExecNewRun();