o coverity fixes
authorwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 23:30:44 +0000 (23:30 +0000)
committerwiechula <wiechula@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 23:30:44 +0000 (23:30 +0000)
ANALYSIS/AliAnalysisTaskPIDqa.cxx
ANALYSIS/AliESDv0KineCuts.cxx
ANALYSIS/TenderSupplies/AliTPCTenderSupply.cxx

index 9f7f5f7..e1eff32 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>
+/**************************************************************************\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 <AliESDEvent.h>\r
 #include <AliAODEvent.h>\r
 #include <AliESDv0.h>\r
 #include <AliAODv0.h>\r
 #include <AliESDv0KineCuts.h>\r
-
-#include "AliAnalysisTaskPIDqa.h"
-
-
-ClassImp(AliAnalysisTaskPIDqa)
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa():
-AliAnalysisTaskSE(),
-fPIDResponse(0x0),
+\r
+#include "AliAnalysisTaskPIDqa.h"\r
+\r
+\r
+ClassImp(AliAnalysisTaskPIDqa)\r
+\r
+//______________________________________________________________________________\r
+AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa():\r
+AliAnalysisTaskSE(),\r
+fPIDResponse(0x0),\r
 fV0cuts(0x0),\r
 fV0electrons(0x0),\r
 fV0pions(0x0),\r
 fV0kaons(0x0),\r
 fV0protons(0x0),\r
-fListQA(0x0),
-fListQAits(0x0),
-fListQAitsSA(0x0),
-fListQAitsPureSA(0x0),
-fListQAtpc(0x0),
-fListQAtrd(0x0),
-fListQAtof(0x0),
-fListQAemcal(0x0),
-fListQAhmpid(0x0),
-fListQAtofhmpid(0x0),
+fListQA(0x0),\r
+fListQAits(0x0),\r
+fListQAitsSA(0x0),\r
+fListQAitsPureSA(0x0),\r
+fListQAtpc(0x0),\r
+fListQAtrd(0x0),\r
+fListQAtof(0x0),\r
+fListQAemcal(0x0),\r
+fListQAhmpid(0x0),\r
+fListQAtofhmpid(0x0),\r
 fListQAtpctof(0x0),\r
 fListQAV0(0x0)\r
-{
-  //
-  // Dummy constructor
-  //
-}
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa(const char* name):
-AliAnalysisTaskSE(name),
-fPIDResponse(0x0),
+{\r
+  //\r
+  // Dummy constructor\r
+  //\r
+}\r
+\r
+//______________________________________________________________________________\r
+AliAnalysisTaskPIDqa::AliAnalysisTaskPIDqa(const char* name):\r
+AliAnalysisTaskSE(name),\r
+fPIDResponse(0x0),\r
 fV0cuts(0x0),\r
 fV0electrons(0x0),\r
 fV0pions(0x0),\r
 fV0kaons(0x0),\r
 fV0protons(0x0),\r
-fListQA(0x0),
-fListQAits(0x0),
-fListQAitsSA(0x0),
-fListQAitsPureSA(0x0),
-fListQAtpc(0x0),
-fListQAtrd(0x0),
-fListQAtof(0x0),
-fListQAemcal(0x0),
-fListQAhmpid(0x0),
-fListQAtofhmpid(0x0),
+fListQA(0x0),\r
+fListQAits(0x0),\r
+fListQAitsSA(0x0),\r
+fListQAitsPureSA(0x0),\r
+fListQAtpc(0x0),\r
+fListQAtrd(0x0),\r
+fListQAtof(0x0),\r
+fListQAemcal(0x0),\r
+fListQAhmpid(0x0),\r
+fListQAtofhmpid(0x0),\r
 fListQAtpctof(0x0),\r
 fListQAV0(0x0)\r
-{
-  //
-  // Default constructor
-  //
-  DefineInput(0,TChain::Class());
-  DefineOutput(1,TList::Class());
-}
-
-//______________________________________________________________________________
-AliAnalysisTaskPIDqa::~AliAnalysisTaskPIDqa()
-{
-  //
-  // Destructor
-  //
+{\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
   delete fV0cuts;\r
   delete fV0electrons;\r
@@ -118,27 +118,27 @@ AliAnalysisTaskPIDqa::~AliAnalysisTaskPIDqa()
   delete fV0kaons;\r
   delete fV0protons;\r
 \r
-  if (!AliAnalysisManager::GetAnalysisManager()->IsProofMode()) delete fListQA;
-}
-
-//______________________________________________________________________________
-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");
-  
+  if (!AliAnalysisManager::GetAnalysisManager()->IsProofMode()) delete fListQA;\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
   // V0 Kine cuts \r
   fV0cuts = new AliESDv0KineCuts;\r
  \r
@@ -148,113 +148,113 @@ void AliAnalysisTaskPIDqa::UserCreateOutputObjects()
   fV0kaons     = new TObjArray;\r
   fV0protons   = new TObjArray;\r
 \r
-  //
-  fListQA=new TList;
-  fListQA->SetOwner();
-  
-  fListQAits=new TList;
-  fListQAits->SetOwner();
-  fListQAits->SetName("ITS");
-
-  fListQAitsSA=new TList;
-  fListQAitsSA->SetOwner();
-  fListQAitsSA->SetName("ITS_SA");
-
-  fListQAitsPureSA=new TList;
-  fListQAitsPureSA->SetOwner();
-  fListQAitsPureSA->SetName("ITS_PureSA");
-
-  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");
-  
-  fListQAhmpid=new TList;
-  fListQAhmpid->SetOwner();
-  fListQAhmpid->SetName("HMPID");
-  
-  fListQAtpctof=new TList;
-  fListQAtpctof->SetOwner();
-  fListQAtpctof->SetName("TPC_TOF");
-
-  fListQAtofhmpid=new TList;
-  fListQAtofhmpid->SetOwner();
-  fListQAtofhmpid->SetName("TOF_HMPID");
-  
+  //\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_SA");\r
+\r
+  fListQAitsPureSA=new TList;\r
+  fListQAitsPureSA->SetOwner();\r
+  fListQAitsPureSA->SetName("ITS_PureSA");\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
+  fListQAhmpid=new TList;\r
+  fListQAhmpid->SetOwner();\r
+  fListQAhmpid->SetName("HMPID");\r
+  \r
+  fListQAtpctof=new TList;\r
+  fListQAtpctof->SetOwner();\r
+  fListQAtpctof->SetName("TPC_TOF");\r
+\r
+  fListQAtofhmpid=new TList;\r
+  fListQAtofhmpid->SetOwner();\r
+  fListQAtofhmpid->SetName("TOF_HMPID");\r
+  \r
   fListQAV0=new TList;\r
   fListQAV0->SetOwner();\r
   fListQAV0->SetName("V0decay");\r
   \r
-  fListQA->Add(fListQAits);
-  fListQA->Add(fListQAitsSA);
-  fListQA->Add(fListQAitsPureSA);
-  fListQA->Add(fListQAtpc);
-  fListQA->Add(fListQAtrd);
-  fListQA->Add(fListQAtof);
-  fListQA->Add(fListQAemcal);
-  fListQA->Add(fListQAhmpid);
-  fListQA->Add(fListQAtpctof);
-  fListQA->Add(fListQAtofhmpid);
+  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(fListQAhmpid);\r
+  fListQA->Add(fListQAtpctof);\r
+  fListQA->Add(fListQAtofhmpid);\r
   fListQA->Add(fListQAV0);\r
-
-  SetupITSqa();
-  SetupTPCqa();
-  SetupTRDqa();
-  SetupTOFqa();
-  SetupEMCALqa();
-  SetupHMPIDqa();
-  SetupTPCTOFqa();
-  SetupTOFHMPIDqa();
+\r
+  SetupITSqa();\r
+  SetupTPCqa();\r
+  SetupTRDqa();\r
+  SetupTOFqa();\r
+  SetupEMCALqa();\r
+  SetupHMPIDqa();\r
+  SetupTPCTOFqa();\r
+  SetupTOFHMPIDqa();\r
   SetupV0qa();\r
-  
-  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;
-
+  \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
   // Start with the V0 task (only possible for ESDs?)\r
   FillV0PIDlist();\r
-  
-  FillITSqa();
-  FillTPCqa();
-  FillTRDqa();
-  FillTOFqa();
-  FillEMCALqa();
-  FillHMPIDqa();
-  
-  //combined detector QA
-  FillTPCTOFqa();
-  FillTOFHMPIDqa();
-  
+  \r
+  FillITSqa();\r
+  FillTPCqa();\r
+  FillTRDqa();\r
+  FillTOFqa();\r
+  FillEMCALqa();\r
+  FillHMPIDqa();\r
+  \r
+  //combined detector QA\r
+  FillTPCTOFqa();\r
+  FillTOFHMPIDqa();\r
+  \r
   // Clear the V0 PID arrays\r
   ClearV0PIDlist();\r
 \r
 \r
   \r
-  PostData(1,fListQA);
-}
-
-//______________________________________________________________________________
+  PostData(1,fListQA);\r
+}\r
+\r
+//______________________________________________________________________________\r
 void  AliAnalysisTaskPIDqa::FillV0PIDlist(){\r
 \r
   //\r
@@ -348,267 +348,267 @@ void  AliAnalysisTaskPIDqa::ClearV0PIDlist(){
 \r
 }\r
 //______________________________________________________________________________\r
-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 selection
-    if (!( ( (status & AliVTrack::kITSrefit)==AliVTrack::kITSrefit ) ||
-          ! ( (status & AliVTrack::kITSpid  )==AliVTrack::kITSpid   ) )) continue;
-    Double_t mom=track->P();
-    
-    TList *theList = 0x0;
-    if(( (status & AliVTrack::kTPCin)==AliVTrack::kTPCin )){
-      //ITS+TPC tracks
-      theList=fListQAits;
-    }else{
-      if(!( (status & AliVTrack::kITSpureSA)==AliVTrack::kITSpureSA )){ 
-       //ITS Standalone tracks
-       theList=fListQAitsSA;
-      }else{
-       //ITS Pure Standalone tracks
-       theList=fListQAitsPureSA;
-      }
-    }
-    
-    
-    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-      TH2 *h=(TH2*)theList->At(ispecie);
-      if (!h) continue;
-      Double_t nSigma=fPIDResponse->NumberOfSigmasITS(track, (AliPID::EParticleType)ispecie);
-      h->Fill(mom,nSigma);
-    }
-    TH2 *h=(TH2*)theList->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) ) continue;
-
-    // The TPC pid cut removes the light nuclei (>5 sigma from proton line)
-    //||        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  )
-    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
-  //
-  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 + TRD out
-    if (!( (status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||
-        !( (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||
-//         !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  ) || //removes light nuclei. So it is out for the moment
-        !( (status & AliVTrack::kTRDout  ) == AliVTrack::kTRDout  )) 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 likelihoods[AliPID::kSPECIES];
-    if(fPIDResponse->ComputeTRDProbability(track, AliPID::kSPECIES, likelihoods) != AliPIDResponse::kDetPidOk) continue;
-    Int_t ntracklets = 0;
-    Double_t momentum = -1.;
-    for(Int_t itl = 0; itl < 6; itl++)
-      if(track->GetTRDmomentum(itl) > 0.){
-        ntracklets++;
-        if(momentum < 0) momentum = track->GetTRDmomentum(itl);
-    } 
-    for(Int_t ispecie = 0; ispecie < AliPID::kSPECIES; ispecie++){
-      TH2F *hLike = (TH2F *)fListQAtrd->At(ntracklets*AliPID::kSPECIES+ispecie);
-      if (hLike) hLike->Fill(momentum,likelihoods[ispecie]);
-    }
-  }
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTOFqa()
-{
-  //
-  // Fill TOF information
-  //
-  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){
-      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()/1000.;
-      h->Fill(mom,sig);
-    }
-
-    Int_t mask = fPIDResponse->GetTOFResponse().GetStartTimeMask(mom);
-    ((TH1F*)fListQAtof->FindObject("hStartTimeMask_TOF"))->Fill((Double_t)(mask+0.5));
-
-    if (mom >= 0.75 && mom <= 1.25 ) {
-      Double_t nsigma= fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)AliPID::kPion);
-      if (mask == 0) {
-       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-Fill"))->Fill(nsigma);
-      } else if (mask == 1) {
-       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-TOF"))->Fill(nsigma);
-      } else if ( (mask == 2) || (mask == 4) || (mask == 6) ) {
-       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-T0"))->Fill(nsigma);
-      } else {
-       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-Best"))->Fill(nsigma);
-      }
-    }
-
-    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
-  //
-
-  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
-    if (!( (status & AliVTrack::kEMCALmatch) == AliVTrack::kEMCALmatch) ) continue;
-
-    Double_t pt=track->Pt();
-   
-    //EMCAL nSigma (only for electrons at the moment)
-    TH2 *h=(TH2*)fListQAemcal->At(0);
-    if (!h) continue;
-    Double_t nSigma=fPIDResponse->NumberOfSigmasEMCAL(track, (AliPID::EParticleType)0);
-    h->Fill(pt,nSigma);
-    
+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 selection\r
+    if (!( ( (status & AliVTrack::kITSrefit)==AliVTrack::kITSrefit ) ||\r
+          ! ( (status & AliVTrack::kITSpid  )==AliVTrack::kITSpid   ) )) continue;\r
+    Double_t mom=track->P();\r
+    \r
+    TList *theList = 0x0;\r
+    if(( (status & AliVTrack::kTPCin)==AliVTrack::kTPCin )){\r
+      //ITS+TPC tracks\r
+      theList=fListQAits;\r
+    }else{\r
+      if(!( (status & AliVTrack::kITSpureSA)==AliVTrack::kITSpureSA )){ \r
+       //ITS Standalone tracks\r
+       theList=fListQAitsSA;\r
+      }else{\r
+       //ITS Pure Standalone tracks\r
+       theList=fListQAitsPureSA;\r
+      }\r
+    }\r
+    \r
+    \r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+      TH2 *h=(TH2*)theList->At(ispecie);\r
+      if (!h) continue;\r
+      Double_t nSigma=fPIDResponse->NumberOfSigmasITS(track, (AliPID::EParticleType)ispecie);\r
+      h->Fill(mom,nSigma);\r
+    }\r
+    TH2 *h=(TH2*)theList->At(AliPID::kSPECIES);\r
+    if (h) {\r
+      Double_t sig=track->GetITSsignal();\r
+      h->Fill(mom,sig);\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) ) continue;\r
+\r
+    // The TPC pid cut removes the light nuclei (>5 sigma from proton line)\r
+    //||        !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  )\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
+  AliVEvent *event=InputEvent();\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 + TRD out\r
+    if (!( (status & AliVTrack::kTPCrefit) == AliVTrack::kTPCrefit) ||\r
+        !( (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit) ||\r
+//         !( (status & AliVTrack::kTPCpid  ) == AliVTrack::kTPCpid  ) || //removes light nuclei. So it is out for the moment\r
+        !( (status & AliVTrack::kTRDout  ) == AliVTrack::kTRDout  )) 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 likelihoods[AliPID::kSPECIES];\r
+    if(fPIDResponse->ComputeTRDProbability(track, AliPID::kSPECIES, likelihoods) != AliPIDResponse::kDetPidOk) continue;\r
+    Int_t ntracklets = 0;\r
+    Double_t momentum = -1.;\r
+    for(Int_t itl = 0; itl < 6; itl++)\r
+      if(track->GetTRDmomentum(itl) > 0.){\r
+        ntracklets++;\r
+        if(momentum < 0) momentum = track->GetTRDmomentum(itl);\r
+    } \r
+    for(Int_t ispecie = 0; ispecie < AliPID::kSPECIES; ispecie++){\r
+      TH2F *hLike = (TH2F *)fListQAtrd->At(ntracklets*AliPID::kSPECIES+ispecie);\r
+      if (hLike) hLike->Fill(momentum,likelihoods[ispecie]);\r
+    }\r
+  }\r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTOFqa()\r
+{\r
+  //\r
+  // Fill TOF information\r
+  //\r
+  AliVEvent *event=InputEvent();\r
+\r
+  Int_t ntracks=event->GetNumberOfTracks();\r
+  Int_t tracksAtTof = 0;\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
+    // TPC refit + ITS refit +\r
+    // TOF out + TOFpid +\r
+    // kTIME\r
+    // (we don't use kTOFmismatch because it depends on TPC....)\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
+    tracksAtTof++;\r
+\r
+    Double_t mom=track->P();\r
+\r
+    for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\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->FindObject("hSigP_TOF");\r
+    if (h) {\r
+      Double_t sig=track->GetTOFsignal()/1000.;\r
+      h->Fill(mom,sig);\r
+    }\r
+\r
+    Int_t mask = fPIDResponse->GetTOFResponse().GetStartTimeMask(mom);\r
+    ((TH1F*)fListQAtof->FindObject("hStartTimeMask_TOF"))->Fill((Double_t)(mask+0.5));\r
+\r
+    if (mom >= 0.75 && mom <= 1.25 ) {\r
+      Double_t nsigma= fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)AliPID::kPion);\r
+      if (mask == 0) {\r
+       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-Fill"))->Fill(nsigma);\r
+      } else if (mask == 1) {\r
+       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-TOF"))->Fill(nsigma);\r
+      } else if ( (mask == 2) || (mask == 4) || (mask == 6) ) {\r
+       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-T0"))->Fill(nsigma);\r
+      } else {\r
+       ((TH1F*)fListQAtof->FindObject("hNsigma_TOF_Pion_T0-Best"))->Fill(nsigma);\r
+      }\r
+    }\r
+\r
+    Double_t res = (Double_t)fPIDResponse->GetTOFResponse().GetStartTimeRes(mom);\r
+    ((TH1F*)fListQAtof->FindObject("hStartTimeRes_TOF"))->Fill(res);\r
+\r
+    AliESDEvent *esd = dynamic_cast<AliESDEvent *>(event);\r
+    if (esd) {\r
+      Double_t startTime = esd->GetT0TOF(0);\r
+      if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeAC_T0"))->Fill(startTime);\r
+      else {\r
+        startTime = esd->GetT0TOF(1);\r
+        if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeA_T0"))->Fill(startTime);\r
+        startTime = esd->GetT0TOF(2);\r
+        if (startTime < 90000) ((TH1F*)fListQAtof->FindObject("hStartTimeC_T0"))->Fill(startTime);\r
+      }\r
+    }\r
+  }\r
+  if (tracksAtTof > 0) {\r
+    ((TH1F* )fListQAtof->FindObject("hnTracksAt_TOF"))->Fill(tracksAtTof);\r
+    Int_t mask = fPIDResponse->GetTOFResponse().GetStartTimeMask(5.);\r
+    if (mask & 0x1) ((TH1F*)fListQAtof->FindObject("hT0MakerEff"))->Fill(tracksAtTof);\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
+  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
+    if (!( (status & AliVTrack::kEMCALmatch) == AliVTrack::kEMCALmatch) ) continue;\r
+\r
+    Double_t pt=track->Pt();\r
+   \r
+    //EMCAL nSigma (only for electrons at the moment)\r
+    TH2 *h=(TH2*)fListQAemcal->At(0);\r
+    if (!h) continue;\r
+    Double_t nSigma=fPIDResponse->NumberOfSigmasEMCAL(track, (AliPID::EParticleType)0);\r
+    h->Fill(pt,nSigma);\r
+    \r
   }\r
 \r
    //EMCAL signal (E/p vs. pT) for electrons from V0\r
@@ -625,31 +625,31 @@ void AliAnalysisTaskPIDqa::FillEMCALqa()
     Double_t pt=track->Pt();\r
 \r
     TH2 *h=(TH2*)fListQAemcal->At(1);\r
-    if (h) {
-
-      Int_t nMatchClus = track->GetEMCALcluster();
-      Double_t mom     = track->P();
-      Double_t eop     = -1.;
-
-      if(nMatchClus > -1){
-    
-        AliVCluster *matchedClus = (AliVCluster*)event->GetCaloCluster(nMatchClus);
-
-        if(matchedClus){
-
-          // matched cluster is EMCAL
-          if(matchedClus->IsEMCAL()){
-
-            Double_t fClsE       = matchedClus->E();
-            eop                  = fClsE/mom;
-
-            h->Fill(pt,eop);
-
-          }
-        }
-      }
-    }
-  }
+    if (h) {\r
+\r
+      Int_t nMatchClus = track->GetEMCALcluster();\r
+      Double_t mom     = track->P();\r
+      Double_t eop     = -1.;\r
+\r
+      if(nMatchClus > -1){\r
+    \r
+        AliVCluster *matchedClus = (AliVCluster*)event->GetCaloCluster(nMatchClus);\r
+\r
+        if(matchedClus){\r
+\r
+          // matched cluster is EMCAL\r
+          if(matchedClus->IsEMCAL()){\r
+\r
+            Double_t fClsE       = matchedClus->E();\r
+            eop                  = fClsE/mom;\r
+\r
+            h->Fill(pt,eop);\r
+\r
+          }\r
+        }\r
+      }\r
+    }\r
+  }\r
 \r
    //EMCAL signal (E/p vs. pT) for pions from V0\r
   for(Int_t itrack = 0; itrack < fV0pions->GetEntries(); itrack++){\r
@@ -734,361 +734,361 @@ void AliAnalysisTaskPIDqa::FillEMCALqa()
     }\r
   }\r
 \r
-}
-
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillHMPIDqa()
-{
-  //
-  // Fill PID qa histograms for the HMPID
-  //
-  
-  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) ) 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 ckovAngle = track->GetHMPIDsignal();
-    
-    TH1F *hThetavsMom = (TH1F*)fListQAhmpid->At(0);;
-    
-    hThetavsMom->Fill(mom,ckovAngle);    
-  
-  }
-}
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::FillTOFHMPIDqa()
-{
-  //
-  // Fill PID qa histograms for the HMPID
-  //
-  
-  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::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 ckovAngle = track->GetHMPIDsignal();
-    
-    Double_t nSigmaTOF[3]; 
-    TH1F *h[3];
-    
-    for (Int_t ispecie=2; ispecie<AliPID::kSPECIES; ++ispecie){
-      //TOF nSigma
-      nSigmaTOF[ispecie]=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);
-      h[ispecie-2] = (TH1F*)fListQAtofhmpid->At(ispecie-2);}
-      
-    if(TMath::Abs(nSigmaTOF[0])<2)                                                              h[0]->Fill(mom,ckovAngle);
-    
-    if(TMath::Abs(nSigmaTOF[1])<2 && TMath::Abs(nSigmaTOF[0])>3)                                h[1]->Fill(mom,ckovAngle);
-
-    if(TMath::Abs(nSigmaTOF[2])<2 && TMath::Abs(nSigmaTOF[1])>3 && TMath::Abs(nSigmaTOF[0])>3)  h[2]->Fill(mom,ckovAngle);
-      
-  }
-  
-}
-
-//______________________________________________________________________________
-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 ) || //removes light nuclei, so it is out for the moment
-        !((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);
-
-      //EMCAL after TOF and TPC cut
-      h=(TH2*)fListQAtpctof->At(ispecie+2*AliPID::kSPECIES);
-      if (h && TMath::Abs(nSigmaTOF)<3. && TMath::Abs(nSigmaTPC)<3. ){
-
-       Int_t nMatchClus = track->GetEMCALcluster();
-       Double_t pt      = track->Pt();
-       Double_t eop     = -1.;
-       
-       if(nMatchClus > -1){
-         
-         AliVCluster *matchedClus = (AliVCluster*)event->GetCaloCluster(nMatchClus);
-         
-         if(matchedClus){
-           
-           // matched cluster is EMCAL
-           if(matchedClus->IsEMCAL()){
-             
-             Double_t fClsE       = matchedClus->E();
-             eop                  = fClsE/mom;
-
-             h->Fill(pt,eop);
-             
-           }
-         }
-       }
-      }
-    }
-  }
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupITSqa()
-{
-  //
-  // Create the ITS qa objects
-  //
-  
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  
-  //ITS+TPC tracks
-  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);
-
-  //ITS Standalone tracks
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaPSA = new TH2F(Form("hNsigmaP_ITSSA_%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);
-    fListQAitsSA->Add(hNsigmaPSA);
-  }
-  TH2F *hSigSA = new TH2F("hSigP_ITSSA",
-                         "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",
-                         vX->GetNrows()-1,vX->GetMatrixArray(),
-                         300,0,300);
-  fListQAitsSA->Add(hSigSA);
-  
-  //ITS Pure Standalone tracks
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *hNsigmaPPureSA = new TH2F(Form("hNsigmaP_ITSPureSA_%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);
-    fListQAitsPureSA->Add(hNsigmaPPureSA);
-  }
-  TH2F *hSigPureSA = new TH2F("hSigP_ITSPureSA",
-                             "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",
-                             vX->GetNrows()-1,vX->GetMatrixArray(),
-                             300,0,300);
-  fListQAitsPureSA->Add(hSigPureSA);
-  
-  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
-  //
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  for(Int_t itl = 0; itl < 6; ++itl){
-    for(Int_t ispecie = 0; ispecie < AliPID::kSPECIES; ispecie++){
-      TH2F *hLikeP = new TH2F(Form("hLikeP_TRD_%dtls_%s", itl, AliPID::ParticleName(ispecie)),
-                              Form("TRD Likelihood to be %s %s for tracks having %d %s; p (GeV/c); TRD %s Likelihood", ispecie == 0 ? "an" : "a", AliPID::ParticleName(ispecie), itl+1, itl == 0 ? "tracklet" : "tracklets", AliPID::ParticleName(ispecie)),
-                              vX->GetNrows()-1, vX->GetMatrixArray(),
-                              100, 0., 1.);
-      fListQAtrd->Add(hLikeP);
-    }
-  }
-  delete vX;
-}
-
-//______________________________________________________________________________
-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);
-  }
-
-  // for Kaons PID we differentiate on Time Zero
-  TH1F *hnSigT0Fill = new TH1F("hNsigma_TOF_Pion_T0-Fill","TOF n#sigma (Pion) T0-FILL [0.75-1.25. GeV/c]",200,-10,10);
-  fListQAtof->Add(hnSigT0Fill);
-  TH1F *hnSigT0T0 = new TH1F("hNsigma_TOF_Pion_T0-T0","TOF n#sigma (Pion) T0-T0 [0.75-1.25 GeV/c]",200,-10,10);
-  fListQAtof->Add(hnSigT0T0);
-  TH1F *hnSigT0TOF = new TH1F("hNsigma_TOF_Pion_T0-TOF","TOF n#sigma (Pion) T0-TOF [0.75-1.25 GeV/c]",200,-10,10);
-  fListQAtof->Add(hnSigT0TOF);
-  TH1F *hnSigT0Best = new TH1F("hNsigma_TOF_Pion_T0-Best","TOF n#sigma (Pion) T0-Best [0.75-1.25 GeV/c]",200,-10,10);
-  fListQAtof->Add(hnSigT0Best);
-
-  TH2F *hSig = new TH2F("hSigP_TOF",
-                        "TOF signal vs. p;p [GeV]; TOF signal [ns]",
-                        vX->GetNrows()-1,vX->GetMatrixArray(),
-                        300,0,30);
-
-  delete vX;
-  
-  fListQAtof->Add(hSig);
-
-  TH1F *hStartTimeMaskTOF = new TH1F("hStartTimeMask_TOF","StartTime mask",8,0,8);
-  fListQAtof->Add(hStartTimeMaskTOF);
-  TH1F *hStartTimeResTOF = new TH1F("hStartTimeRes_TOF","StartTime resolution [ps]",100,0,500);
-  fListQAtof->Add(hStartTimeResTOF);
-
-  TH1F *hnTracksAtTOF = new TH1F("hnTracksAt_TOF","Matched tracks at TOF",20,0,20);
-  fListQAtof->Add(hnTracksAtTOF);
-  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 *hStartTimeAT0 = new TH1F("hStartTimeA_T0","StartTime from T0A [ps]",1000,-1000,1000);
-  fListQAtof->Add(hStartTimeAT0);
-  TH1F *hStartTimeCT0 = new TH1F("hStartTimeC_T0","StartTime from T0C [ps]",1000,-1000,1000);
-  fListQAtof->Add(hStartTimeCT0);
-  TH1F *hStartTimeACT0 = new TH1F("hStartTimeAC_T0","StartTime from T0AC [ps]",1000,-1000,1000);;
-  fListQAtof->Add(hStartTimeACT0);
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupEMCALqa()
-{
-  //
-  // Create the EMCAL qa objects
-  //
-
-  TVectorD *vX=MakeLogBinning(200,.1,30);
-  
-  TH2F *hNsigmaPt = new TH2F(Form("hNsigmaPt_EMCAL_%s",AliPID::ParticleName(0)),
-                            Form("EMCAL n#sigma %s vs. p_{T};p_{T} [GeV]; n#sigma",AliPID::ParticleName(0)),
-                            vX->GetNrows()-1,vX->GetMatrixArray(),
-                            200,-10,10);
-  fListQAemcal->Add(hNsigmaPt);  
-  
+}\r
+\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillHMPIDqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the HMPID\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) ) 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->P();\r
+    Double_t ckovAngle = track->GetHMPIDsignal();\r
+    \r
+    TH1F *hThetavsMom = (TH1F*)fListQAhmpid->At(0);;\r
+    \r
+    hThetavsMom->Fill(mom,ckovAngle);    \r
+  \r
+  }\r
+}\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::FillTOFHMPIDqa()\r
+{\r
+  //\r
+  // Fill PID qa histograms for the HMPID\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
+    Double_t mom = track->P();\r
+    Double_t ckovAngle = track->GetHMPIDsignal();\r
+    \r
+    Double_t nSigmaTOF[3]; \r
+    TH1F *h[3];\r
+    \r
+    for (Int_t ispecie=2; ispecie<5; ++ispecie){\r
+      //TOF nSigma\r
+      nSigmaTOF[ispecie-2]=fPIDResponse->NumberOfSigmasTOF(track, (AliPID::EParticleType)ispecie);\r
+      h[ispecie-2] = (TH1F*)fListQAtofhmpid->At(ispecie-2);}\r
+      \r
+    if(TMath::Abs(nSigmaTOF[0])<2)                                                              h[0]->Fill(mom,ckovAngle);\r
+    \r
+    if(TMath::Abs(nSigmaTOF[1])<2 && TMath::Abs(nSigmaTOF[0])>3)                                h[1]->Fill(mom,ckovAngle);\r
+\r
+    if(TMath::Abs(nSigmaTOF[2])<2 && TMath::Abs(nSigmaTOF[1])>3 && TMath::Abs(nSigmaTOF[0])>3)  h[2]->Fill(mom,ckovAngle);\r
+      \r
+  }\r
+  \r
+}\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 ) || //removes light nuclei, so it is out for the moment\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
+\r
+       Int_t nMatchClus = track->GetEMCALcluster();\r
+       Double_t pt      = track->Pt();\r
+       Double_t eop     = -1.;\r
+       \r
+       if(nMatchClus > -1){\r
+         \r
+         AliVCluster *matchedClus = (AliVCluster*)event->GetCaloCluster(nMatchClus);\r
+         \r
+         if(matchedClus){\r
+           \r
+           // matched cluster is EMCAL\r
+           if(matchedClus->IsEMCAL()){\r
+             \r
+             Double_t fClsE       = matchedClus->E();\r
+             eop                  = fClsE/mom;\r
+\r
+             h->Fill(pt,eop);\r
\r
+             \r
+           }\r
+         }\r
+       }\r
+      }\r
+    }\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
+  //ITS+TPC tracks\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
+  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
+  //ITS Standalone tracks\r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaPSA = new TH2F(Form("hNsigmaP_ITSSA_%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
+    fListQAitsSA->Add(hNsigmaPSA);\r
+  }\r
+  TH2F *hSigSA = new TH2F("hSigP_ITSSA",\r
+                         "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",\r
+                         vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                         300,0,300);\r
+  fListQAitsSA->Add(hSigSA);\r
+  \r
+  //ITS Pure Standalone tracks\r
+  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){\r
+    TH2F *hNsigmaPPureSA = new TH2F(Form("hNsigmaP_ITSPureSA_%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
+    fListQAitsPureSA->Add(hNsigmaPPureSA);\r
+  }\r
+  TH2F *hSigPureSA = new TH2F("hSigP_ITSPureSA",\r
+                             "ITS signal vs. p;p [GeV]; ITS signal [arb. units]",\r
+                             vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                             300,0,300);\r
+  fListQAitsPureSA->Add(hSigPureSA);\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
+  TVectorD *vX=MakeLogBinning(200,.1,30);\r
+  for(Int_t itl = 0; itl < 6; ++itl){\r
+    for(Int_t ispecie = 0; ispecie < AliPID::kSPECIES; ispecie++){\r
+      TH2F *hLikeP = new TH2F(Form("hLikeP_TRD_%dtls_%s", itl, AliPID::ParticleName(ispecie)),\r
+                              Form("TRD Likelihood to be %s %s for tracks having %d %s; p (GeV/c); TRD %s Likelihood", ispecie == 0 ? "an" : "a", AliPID::ParticleName(ispecie), itl+1, itl == 0 ? "tracklet" : "tracklets", AliPID::ParticleName(ispecie)),\r
+                              vX->GetNrows()-1, vX->GetMatrixArray(),\r
+                              100, 0., 1.);\r
+      fListQAtrd->Add(hLikeP);\r
+    }\r
+  }\r
+  delete vX;\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
+  // for Kaons PID we differentiate on Time Zero\r
+  TH1F *hnSigT0Fill = new TH1F("hNsigma_TOF_Pion_T0-Fill","TOF n#sigma (Pion) T0-FILL [0.75-1.25. GeV/c]",200,-10,10);\r
+  fListQAtof->Add(hnSigT0Fill);\r
+  TH1F *hnSigT0T0 = new TH1F("hNsigma_TOF_Pion_T0-T0","TOF n#sigma (Pion) T0-T0 [0.75-1.25 GeV/c]",200,-10,10);\r
+  fListQAtof->Add(hnSigT0T0);\r
+  TH1F *hnSigT0TOF = new TH1F("hNsigma_TOF_Pion_T0-TOF","TOF n#sigma (Pion) T0-TOF [0.75-1.25 GeV/c]",200,-10,10);\r
+  fListQAtof->Add(hnSigT0TOF);\r
+  TH1F *hnSigT0Best = new TH1F("hNsigma_TOF_Pion_T0-Best","TOF n#sigma (Pion) T0-Best [0.75-1.25 GeV/c]",200,-10,10);\r
+  fListQAtof->Add(hnSigT0Best);\r
+\r
+  TH2F *hSig = new TH2F("hSigP_TOF",\r
+                        "TOF signal vs. p;p [GeV]; TOF signal [ns]",\r
+                        vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                        300,0,30);\r
+\r
+  delete vX;\r
+  \r
+  fListQAtof->Add(hSig);\r
+\r
+  TH1F *hStartTimeMaskTOF = new TH1F("hStartTimeMask_TOF","StartTime mask",8,0,8);\r
+  fListQAtof->Add(hStartTimeMaskTOF);\r
+  TH1F *hStartTimeResTOF = new TH1F("hStartTimeRes_TOF","StartTime resolution [ps]",100,0,500);\r
+  fListQAtof->Add(hStartTimeResTOF);\r
+\r
+  TH1F *hnTracksAtTOF = new TH1F("hnTracksAt_TOF","Matched tracks at TOF",20,0,20);\r
+  fListQAtof->Add(hnTracksAtTOF);\r
+  TH1F *hT0MakerEff = new TH1F("hT0MakerEff","Events with T0-TOF vs nTracks",20,0,20);\r
+  fListQAtof->Add(hT0MakerEff);\r
+\r
+  // this in principle should stay on a T0 PID QA, but are just the data prepared for TOF use\r
+  TH1F *hStartTimeAT0 = new TH1F("hStartTimeA_T0","StartTime from T0A [ps]",1000,-1000,1000);\r
+  fListQAtof->Add(hStartTimeAT0);\r
+  TH1F *hStartTimeCT0 = new TH1F("hStartTimeC_T0","StartTime from T0C [ps]",1000,-1000,1000);\r
+  fListQAtof->Add(hStartTimeCT0);\r
+  TH1F *hStartTimeACT0 = new TH1F("hStartTimeAC_T0","StartTime from T0AC [ps]",1000,-1000,1000);;\r
+  fListQAtof->Add(hStartTimeACT0);\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
+                            Form("EMCAL n#sigma %s vs. p_{T};p_{T} [GeV]; n#sigma",AliPID::ParticleName(0)),\r
+                            vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                            200,-10,10);\r
+  fListQAemcal->Add(hNsigmaPt);  \r
+  \r
 \r
   TH2F *hSigPtEle = new TH2F("hSigPt_EMCAL_Ele",\r
                         "EMCAL signal (E/p) vs. p_{T} for electrons;p_{T} [GeV]; EMCAL signal (E/p) [arb. units]",\r
@@ -1110,82 +1110,82 @@ void AliAnalysisTaskPIDqa::SetupEMCALqa()
 \r
   TH2F *hSigPtAntiProtons = new TH2F("hSigPt_EMCAL_Antiprotons",\r
                         "EMCAL signal (E/p) vs. p_{T} for antiprotons;p_{T} [GeV]; EMCAL signal (E/p) [arb. units]",\r
-                        vX->GetNrows()-1,vX->GetMatrixArray(),
-                        200,0,2);
+                        vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                        200,0,2);\r
   fListQAemcal->Add(hSigPtAntiProtons);\r
-
-  delete vX;  
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupHMPIDqa()
-{
-  //
-  // Create the HMPID qa objects
-  //
-  
-  TH2F *hCkovAnglevsMom   = new TH2F("hCkovAnglevsMom",  "Cherenkov angle vs momnetum",500,0,5.,500,0,1);
-  fListQAhmpid->Add(hCkovAnglevsMom);
-  
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPIDqa::SetupTOFHMPIDqa()
-{
-  //
-  // Create the HMPID qa objects
-  //
-  
-  TH2F *hCkovAnglevsMomPion   = new TH2F("hCkovAnglevsMom_pion",  "Cherenkov angle vs momnetum for pions",500,0,5.,500,0,1);
-  fListQAtofhmpid->Add(hCkovAnglevsMomPion);
-  
-  TH2F *hCkovAnglevsMomKaon   = new TH2F("hCkovAnglevsMom_kaon",  "Cherenkov angle vs momnetum for kaons",500,0,5.,500,0,1);
-  fListQAtofhmpid->Add(hCkovAnglevsMomKaon);
-  
-  TH2F *hCkovAnglevsMomProton = new TH2F("hCkovAnglevsMom_proton","Cherenkov angle vs momnetum for protons",500,0,5.,500,0,1);
-  fListQAtofhmpid->Add(hCkovAnglevsMomProton);
-  
-  
-}  
-
-//______________________________________________________________________________
-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);
-  }
-
-  //EMCAL signal after TOF and TPC cut
-  for (Int_t ispecie=0; ispecie<AliPID::kSPECIES; ++ispecie){
-    TH2F *heopPt = new TH2F(Form("heopPt_TOF_TPC_%s",AliPID::ParticleName(ispecie)),
-                           Form("EMCAL signal (E/p) %s vs. p_{T};p_{T} [GeV]; EMCAL signal (E/p) [arb. units]",AliPID::ParticleName(ispecie)),
-                           vX->GetNrows()-1,vX->GetMatrixArray(),
-                           200,0,2);
-    fListQAtpctof->Add(heopPt);
-  }
-
-  delete vX;
-}
+\r
+  delete vX;  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupHMPIDqa()\r
+{\r
+  //\r
+  // Create the HMPID qa objects\r
+  //\r
+  \r
+  TH2F *hCkovAnglevsMom   = new TH2F("hCkovAnglevsMom",  "Cherenkov angle vs momnetum",500,0,5.,500,0,1);\r
+  fListQAhmpid->Add(hCkovAnglevsMom);\r
+  \r
+}\r
+\r
+//______________________________________________________________________________\r
+void AliAnalysisTaskPIDqa::SetupTOFHMPIDqa()\r
+{\r
+  //\r
+  // Create the HMPID qa objects\r
+  //\r
+  \r
+  TH2F *hCkovAnglevsMomPion   = new TH2F("hCkovAnglevsMom_pion",  "Cherenkov angle vs momnetum for pions",500,0,5.,500,0,1);\r
+  fListQAtofhmpid->Add(hCkovAnglevsMomPion);\r
+  \r
+  TH2F *hCkovAnglevsMomKaon   = new TH2F("hCkovAnglevsMom_kaon",  "Cherenkov angle vs momnetum for kaons",500,0,5.,500,0,1);\r
+  fListQAtofhmpid->Add(hCkovAnglevsMomKaon);\r
+  \r
+  TH2F *hCkovAnglevsMomProton = new TH2F("hCkovAnglevsMom_proton","Cherenkov angle vs momnetum for protons",500,0,5.,500,0,1);\r
+  fListQAtofhmpid->Add(hCkovAnglevsMomProton);\r
+  \r
+  \r
+}  \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
+                           Form("EMCAL signal (E/p) %s vs. p_{T};p_{T} [GeV]; EMCAL signal (E/p) [arb. units]",AliPID::ParticleName(ispecie)),\r
+                           vX->GetNrows()-1,vX->GetMatrixArray(),\r
+                           200,0,2);\r
+    fListQAtpctof->Add(heopPt);\r
+  }\r
+\r
+  delete vX;\r
+}\r
 //______________________________________________________________________________\r
 void AliAnalysisTaskPIDqa::SetupV0qa()\r
 {\r
@@ -1197,83 +1197,83 @@ void AliAnalysisTaskPIDqa::SetupV0qa()
   fListQAV0->Add(hArmenteros);\r
  \r
 }\r
-
-//______________________________________________________________________________
-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;
-}
-
+\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
+\r
index 421a31e..2403a74 100644 (file)
@@ -54,8 +54,8 @@ AliESDv0KineCuts::AliESDv0KineCuts() :
   , fGcutInvMass(0.05)\r
   , fK0cutChi2NDF(10)\r
   , fLcutChi2NDF(10)\r
-  , fUseExternalVertex(kFALSE)
-  , fDeleteVertex(kFALSE)
+  , fUseExternalVertex(kFALSE)\r
+  , fDeleteVertex(kFALSE)\r
 {\r
   //\r
   // Default constructor\r
@@ -126,8 +126,8 @@ AliESDv0KineCuts::AliESDv0KineCuts(const AliESDv0KineCuts &ref):
   , fGcutInvMass(0.05)\r
   , fK0cutChi2NDF(10)\r
   , fLcutChi2NDF(10)\r
-  , fUseExternalVertex(kFALSE)
-  , fDeleteVertex(kFALSE)
+  , fUseExternalVertex(kFALSE)\r
+  , fDeleteVertex(kFALSE)\r
 {\r
   //\r
   // Copy operator\r
@@ -160,8 +160,8 @@ void AliESDv0KineCuts::Copy(TObject &ref) const {
   target.fTPCchi2perCls = fTPCchi2perCls;\r
   target.fTPCclsRatio = fTPCclsRatio;\r
   target.fNoKinks = fNoKinks;\r
-  target.fUseExternalVertex = fUseExternalVertex;  //added december 2nd 2011
-  target.fDeleteVertex = fDeleteVertex;  //added december 2nd 2011
+  target.fUseExternalVertex = fUseExternalVertex;  //added december 2nd 2011\r
+  target.fDeleteVertex = fDeleteVertex;  //added december 2nd 2011\r
 \r
   // default gamma cuts values\r
   target.fGcutChi2NDF = fGcutChi2NDF;\r
@@ -954,17 +954,17 @@ void  AliESDv0KineCuts::SetEvent(AliESDEvent* const event){
     AliErrorClass("Invalid input event pointer");\r
     return;\r
   }\r
-if (fUseExternalVertex) return;
-else{
-       if(fPrimaryVertex && fDeleteVertex){
-               delete  fPrimaryVertex;
-               fPrimaryVertex=0x0;
-               }
-       fPrimaryVertex = new AliKFVertex(*(event->GetPrimaryVertex()));
-       fDeleteVertex=kTRUE;
-       }
-
-
+if (fUseExternalVertex) return;\r
+else{\r
+       if(fPrimaryVertex && fDeleteVertex){\r
+               delete  fPrimaryVertex;\r
+               fPrimaryVertex=0x0;\r
+               }\r
+       fPrimaryVertex = new AliKFVertex(*(fEvent->GetPrimaryVertex()));\r
+       fDeleteVertex=kTRUE;\r
+       }\r
+\r
+\r
 \r
 }\r
 //____________________________________________________________________\r
@@ -979,43 +979,43 @@ void  AliESDv0KineCuts::SetEvent(AliVEvent* const event){
     return;\r
   }\r
 \r
-if (fUseExternalVertex) return;
-else{
-       if(fPrimaryVertex && fDeleteVertex){
-               delete  fPrimaryVertex;
-               fPrimaryVertex=0x0;
-               }
-       fPrimaryVertex = new AliKFVertex(*(event->GetPrimaryVertex()));
-       fDeleteVertex=kTRUE;
+if (fUseExternalVertex) return;\r
+else{\r
+       if(fPrimaryVertex && fDeleteVertex){\r
+               delete  fPrimaryVertex;\r
+               fPrimaryVertex=0x0;\r
+               }\r
+       fPrimaryVertex = new AliKFVertex(*(event->GetPrimaryVertex()));\r
+       fDeleteVertex=kTRUE;\r
+}\r
+\r
+}\r
+\r
+\r
+//________________________________________________________________\r
+void    AliESDv0KineCuts::UseExternalVertex(Bool_t use_external){\r
+       //\r
+       // Reenable primary Vertex from ESD event\r
+       //\r
+       if (use_external) fUseExternalVertex =kTRUE;\r
+       else fUseExternalVertex =kFALSE;\r
 }\r
-
-}
-
-
-//________________________________________________________________
-void    AliESDv0KineCuts::UseExternalVertex(Bool_t use_external){
-       //
-       // Reenable primary Vertex from ESD event
-       //
-       if (use_external) fUseExternalVertex =kTRUE;
-       else fUseExternalVertex =kFALSE;
-}
-
-
-
-
+\r
+\r
+\r
+\r
 //________________________________________________________________\r
 void AliESDv0KineCuts::SetPrimaryVertex(AliKFVertex* const v){\r
   //\r
   // set the primary vertex of the event\r
   //\r
-       if(fPrimaryVertex && fDeleteVertex){   
-               delete  fPrimaryVertex;
-               fPrimaryVertex =0x0;
-               fDeleteVertex = kFALSE;
-               }  
-  fUseExternalVertex=kTRUE; 
-  fPrimaryVertex = v; // set primary Vertex
+       if(fPrimaryVertex && fDeleteVertex){   \r
+               delete  fPrimaryVertex;\r
+               fPrimaryVertex =0x0;\r
+               fDeleteVertex = kFALSE;\r
+               }  \r
+  fUseExternalVertex=kTRUE; \r
+  fPrimaryVertex = v; // set primary Vertex\r
   if(!fPrimaryVertex){\r
     AliErrorClass("Failed to initialize the primary vertex");\r
     return;\r
index be68ab1..3800dec 100644 (file)
@@ -463,13 +463,13 @@ void AliTPCTenderSupply::SetRecoInfo()
   if (!esdIH) return;
   TTree *tree= (TTree*)esdIH->GetTree();
   TFile *file= (TFile*)tree->GetCurrentFile();
-  TString fileName(file->GetName());
-  
   if (!file) {
     AliError("Current file not found, cannot set reconstruction information");
     return;
   }
   
+  TString fileName(file->GetName());
+  
   Int_t run=fTender->GetRun();
   
   
@@ -527,6 +527,10 @@ void AliTPCTenderSupply::SetParametrisation()
     AliInfo(Form("Using pid response objects: %s",pidCDB->GetId().ToString().Data()));
   }
 
+  if (!fArrPidResponseMaster){
+    AliError("No valid PidResponse master found in OCDB");
+    return;
+  }
   //data type
   TString datatype="DATA";
   TString period=fLHCperiod;