ChargedParticles: Add histograms for DCA and TOF
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2012 16:19:55 +0000 (16:19 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2012 16:19:55 +0000 (16:19 +0000)
Photon: Add eta-phi histogram for out of BC=0 clusters
Isolation: Add histogram to check tracks in cone and out of BC=0 tracks in cone
Correlation: Add histograms to check tracks out of BC=0
AddTask: Update recent developments

PWGGA/CaloTrackCorrelations/AliAnaChargedParticles.cxx
PWGGA/CaloTrackCorrelations/AliAnaChargedParticles.h
PWGGA/CaloTrackCorrelations/AliAnaParticleHadronCorrelation.cxx
PWGGA/CaloTrackCorrelations/AliAnaParticleHadronCorrelation.h
PWGGA/CaloTrackCorrelations/AliAnaParticleIsolation.cxx
PWGGA/CaloTrackCorrelations/AliAnaParticleIsolation.h
PWGGA/CaloTrackCorrelations/AliAnaPhoton.cxx
PWGGA/CaloTrackCorrelations/AliAnaPhoton.h
PWGGA/CaloTrackCorrelations/macros/AddTaskCaloTrackCorr.C

index c9d2e76..1a1779f 100755 (executable)
 #include "AliFiducialCut.h"
 #include "AliVTrack.h"
 #include "AliAODMCParticle.h"
+#include "AliAODTrack.h"
+#include "AliAODEvent.h"
+#include "AliESDEvent.h"
 
 ClassImp(AliAnaChargedParticles)
   
 //__________________________________________________
   AliAnaChargedParticles::AliAnaChargedParticles() :
     AliAnaCaloTrackCorrBaseClass(),
-    fPdg(0), 
-    fhNtracks(0),     fhPt(0),
-    fhPhiNeg(0),      fhEtaNeg(0), 
-    fhPhiPos(0),      fhEtaPos(0), 
-    fhEtaPhiPos(0),   fhEtaPhiNeg(0),
+    fPdg(0),           fFillPileUpHistograms(0),
+    fhNtracks(0),      fhPt(0),
+    fhPhiNeg(0),       fhEtaNeg(0), 
+    fhPhiPos(0),       fhEtaPos(0), 
+    fhEtaPhiPos(0),    fhEtaPhiNeg(0),
     //MC
-    fhPtPion(0),      fhPhiPion(0),      fhEtaPion(0),
-    fhPtProton(0),    fhPhiProton(0),    fhEtaProton(0),
-    fhPtElectron(0),  fhPhiElectron(0),  fhEtaElectron(0),
-    fhPtKaon(0),      fhPhiKaon(0),      fhEtaKaon(0),
-    fhPtUnknown(0),   fhPhiUnknown(0),   fhEtaUnknown(0),
-    fhTOFSignal(0),   fhTOFSignalPtCut(0),
-    fhPtTOFSignal(0), fhPtTOFStatus0(0), fhEtaPhiTOFStatus0(0)
+    fhPtPion(0),       fhPhiPion(0),         fhEtaPion(0),
+    fhPtProton(0),     fhPhiProton(0),       fhEtaProton(0),
+    fhPtElectron(0),   fhPhiElectron(0),     fhEtaElectron(0),
+    fhPtKaon(0),       fhPhiKaon(0),         fhEtaKaon(0),
+    fhPtUnknown(0),    fhPhiUnknown(0),      fhEtaUnknown(0),
+    fhTOFSignal(0),    fhTOFSignalPtCut(0),  fhTOFSignalBCOK(0),
+    fhPtTOFSignal(0),  fhPtTOFStatus0(0),    fhEtaPhiTOFStatus0(0),
+    fhEtaPhiTOFBC0(0), fhEtaPhiTOFBCPlus(0), fhEtaPhiTOFBCMinus(0),
+    fhEtaPhiTOFBC0PileUpSPD(0),
+    fhEtaPhiTOFBCPlusPileUpSPD(0),
+    fhEtaPhiTOFBCMinusPileUpSPD(0)
 {
   //Default Ctor
 
-  for(Int_t i = 0; i < 7; i++) fhPtTOFSignalPileUp[i] = 0;
+  for(Int_t i = 0; i < 7; i++)
+  {
+    fhPtPileUp         [i] = 0;
+    fhPtTOFSignalPileUp[i] = 0;
+  }
+  
+  for(Int_t i = 0; i < 3; i++)
+  {
+    fhPtDCA               [i] = 0 ;
+    //fhPtDCAVtxOutBC0      [i] = 0 ;
+    fhPtDCAPileUp         [i] = 0 ;
+    //fhPtDCAVtxOutBC0PileUp[i] = 0 ;
+    
+    fhPtDCATOFBC0         [i] = 0 ;
+    fhPtDCAPileUpTOFBC0   [i] = 0 ;
+
+    fhPtDCANoTOFHit               [i] = 0 ;
+    //fhPtDCAVtxOutBC0NoTOFHit      [i] = 0 ;
+    fhPtDCAPileUpNoTOFHit         [i] = 0 ;
+    //fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = 0 ;
+  }
   
   //Initialize parameters
   InitParameters();
@@ -120,33 +147,82 @@ TList *  AliAnaChargedParticles::GetCreateOutputObjects()
   fhEtaPhiNeg->SetYTitle("#phi (rad)");  
   outputContainer->Add(fhEtaPhiNeg);
   
+  fhProductionVertexBC      = new TH1F("hProductionVertexBC", "tracks production vertex bunch crossing ", 18 , -9 , 9 ) ;
+  fhProductionVertexBC->SetYTitle("# tracks");
+  fhProductionVertexBC->SetXTitle("Bunch crossing");
+  outputContainer->Add(fhProductionVertexBC);
+
   Int_t ntofbins = 1000;
   Int_t mintof = -500;
   Int_t maxtof =  500;
-
+  
   fhTOFSignal  = new TH1F ("hTOFSignal","TOF signal", ntofbins,mintof,maxtof);
-  fhTOFSignal->SetXTitle("TOF signal #times (ns?)");
+  fhTOFSignal->SetXTitle("TOF signal (ns)");
   outputContainer->Add(fhTOFSignal);
 
+  fhTOFSignalBCOK  = new TH1F ("hTOFSignalBCOK","TOF signal", ntofbins,mintof,maxtof);
+  fhTOFSignalBCOK->SetXTitle("TOF signal (ns)");
+  outputContainer->Add(fhTOFSignalBCOK);
+  
   fhTOFSignalPtCut  = new TH1F ("hTOFSignalPtCut","TOF signal", ntofbins,mintof,maxtof);
-  fhTOFSignalPtCut->SetXTitle("TOF signal (ns?)");
+  fhTOFSignalPtCut->SetXTitle("TOF signal (ns)");
   outputContainer->Add(fhTOFSignalPtCut);
 
   fhPtTOFSignal  = new TH2F ("hPtTOFSignal","TOF signal", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
-  fhPtTOFSignal->SetYTitle("TOF signal (ns?)");
+  fhPtTOFSignal->SetYTitle("TOF signal (ns)");
   fhPtTOFSignal->SetXTitle("p_{T} (GeV/c)");
   outputContainer->Add(fhPtTOFSignal);
-  
-  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
-  
-  for(Int_t i = 0 ; i < 7 ; i++)
-  {
-    fhPtTOFSignalPileUp[i]  = new TH2F(Form("hPtTOFSignalPileUp%s",pileUpName[i].Data()),
-                                       Form("Track TOF vs p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()),
-                                       nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
-    fhPtTOFSignalPileUp[i]->SetXTitle("p_{T} (GeV/c)");
-    fhPtTOFSignalPileUp[i]->SetXTitle("TOF signal (ns?)");
-    outputContainer->Add(fhPtTOFSignalPileUp[i]);
+
+  if(fFillPileUpHistograms)
+  {    
+    TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
+    
+    for(Int_t i = 0 ; i < 7 ; i++)
+    {
+      fhPtPileUp[i]  = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
+                                Form("Track p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()),
+                                nptbins,ptmin,ptmax);
+      fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhPtPileUp[i]);
+            
+      fhPtTOFSignalPileUp[i]  = new TH2F(Form("hPtTOFSignalPileUp%s",pileUpName[i].Data()),
+                                         Form("Track TOF vs p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()),
+                                         nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
+      fhPtTOFSignalPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+      fhPtTOFSignalPileUp[i]->SetXTitle("TOF signal (ns)");
+      outputContainer->Add(fhPtTOFSignalPileUp[i]);
+    }
+    fhEtaPhiTOFBC0  = new TH2F ("hEtaPhiTOFBC0","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBC0->SetXTitle("#eta ");
+    fhEtaPhiTOFBC0->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBC0);
+    
+    fhEtaPhiTOFBCPlus  = new TH2F ("hEtaPhiTOFBCPlus","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBCPlus->SetXTitle("#eta ");
+    fhEtaPhiTOFBCPlus->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBCPlus);
+    
+    fhEtaPhiTOFBCMinus  = new TH2F ("hEtaPhiTOFBCMinus","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBCMinus->SetXTitle("#eta ");
+    fhEtaPhiTOFBCMinus->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBCMinus);
+
+    fhEtaPhiTOFBC0PileUpSPD  = new TH2F ("hEtaPhiTOFBC0PileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBC0PileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiTOFBC0PileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBC0PileUpSPD);
+    
+    fhEtaPhiTOFBCPlusPileUpSPD  = new TH2F ("hEtaPhiTOFBCPlusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBCPlusPileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiTOFBCPlusPileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBCPlusPileUpSPD);
+    
+    fhEtaPhiTOFBCMinusPileUpSPD  = new TH2F ("hEtaPhiTOFBCMinusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiTOFBCMinusPileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiTOFBCMinusPileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiTOFBCMinusPileUpSPD);
+    
   }
   
   fhPtTOFStatus0  = new TH1F ("hPtTOFStatus0","p_T distribution of tracks not hitting TOF", nptbins,ptmin,ptmax);
@@ -154,11 +230,94 @@ TList *  AliAnaChargedParticles::GetCreateOutputObjects()
   outputContainer->Add(fhPtTOFStatus0);
   
   
-  fhEtaPhiTOFStatus0  = new TH2F ("hEtaPhiTOFStatus0","pt/eta/phi for tracks without hit on TOF",netabins,etamin,etamax, nphibins,phimin,phimax);
+  fhEtaPhiTOFStatus0  = new TH2F ("hEtaPhiTOFStatus0","eta-phi for tracks without hit on TOF",netabins,etamin,etamax, nphibins,phimin,phimax);
   fhEtaPhiTOFStatus0->SetXTitle("#eta ");
   fhEtaPhiTOFStatus0->SetYTitle("#phi (rad)");
   outputContainer->Add(fhEtaPhiTOFStatus0);
 
+  TString dcaName[] = {"xy","z","Cons"} ;
+  Int_t ndcabins = 800;
+  Int_t mindca = -4;
+  Int_t maxdca =  4;
+  
+  for(Int_t i = 0 ; i < 3 ; i++)
+  {
+    
+    fhPtDCA[i]  = new TH2F(Form("hPtDCA%s",dcaName[i].Data()),
+                           Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()),
+                           nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+    fhPtDCA[i]->SetXTitle("p_{T} (GeV/c)");
+    fhPtDCA[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+    outputContainer->Add(fhPtDCA[i]);
+    
+    fhPtDCATOFBC0[i]  = new TH2F(Form("hPtDCA%sTOFBC0",dcaName[i].Data()),
+                           Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()),
+                           nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+    fhPtDCATOFBC0[i]->SetXTitle("p_{T} (GeV/c)");
+    fhPtDCATOFBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+    outputContainer->Add(fhPtDCATOFBC0[i]);
+
+    fhPtDCANoTOFHit[i]  = new TH2F(Form("hPtDCA%sNoTOFHit",dcaName[i].Data()),
+                           Form("Track (no TOF hit) DCA%s vs p_{T} distribution",dcaName[i].Data()),
+                           nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+    fhPtDCANoTOFHit[i]->SetXTitle("p_{T} (GeV/c)");
+    fhPtDCANoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+    outputContainer->Add(fhPtDCANoTOFHit[i]);
+
+//    fhPtDCAVtxOutBC0[i]  = new TH2F(Form("hPtDCA%sVtxOutBC0",dcaName[i].Data()),
+//                           Form("Track DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()),
+//                           nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+//    fhPtDCAVtxOutBC0[i]->SetXTitle("p_{T} (GeV/c)");
+//    fhPtDCAVtxOutBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+//    outputContainer->Add(fhPtDCAVtxOutBC0[i]);
+//    
+//    fhPtDCAVtxOutBC0NoTOFHit[i]  = new TH2F(Form("hPtDCA%sVtxOutBC0NoTOFHit",dcaName[i].Data()),
+//                                   Form("Track (no TOF hit) DCA%s vs p_{T} distribution, vertex with BC!=0",dcaName[i].Data()),
+//                                   nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+//    fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle("p_{T} (GeV/c)");
+//    fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+//    outputContainer->Add(fhPtDCAVtxOutBC0NoTOFHit[i]);
+    
+    if(fFillPileUpHistograms)
+    {
+      fhPtDCAPileUp[i]  = new TH2F(Form("hPtDCA%sPileUp",dcaName[i].Data()),
+                             Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up",dcaName[i].Data()),
+                             nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+      fhPtDCAPileUp[i]->SetXTitle("p_{T} (GeV/c)");
+      fhPtDCAPileUp[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+      outputContainer->Add(fhPtDCAPileUp[i]);
+      
+      fhPtDCAPileUpTOFBC0[i]  = new TH2F(Form("hPtDCA%sPileUpTOFBC0",dcaName[i].Data()),
+                                   Form("Track DCA%s vs p_{T} distribution",dcaName[i].Data()),
+                                   nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+      fhPtDCAPileUpTOFBC0[i]->SetXTitle("p_{T} (GeV/c)");
+      fhPtDCAPileUpTOFBC0[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+      outputContainer->Add(fhPtDCAPileUpTOFBC0[i]);
+      
+      fhPtDCAPileUpNoTOFHit[i]  = new TH2F(Form("hPtDCA%sPileUpNoTOFHit",dcaName[i].Data()),
+                                     Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()),
+                                     nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+      fhPtDCAPileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)");
+      fhPtDCAPileUpNoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+      outputContainer->Add(fhPtDCAPileUpNoTOFHit[i]);
+      
+//      fhPtDCAVtxOutBC0PileUp[i]  = new TH2F(Form("hPtDCA%sPileUpVtxOutBC0",dcaName[i].Data()),
+//                                   Form("Track DCA%s vs p_{T} distribution, SPD Pile-Up",dcaName[i].Data()),
+//                                   nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+//      fhPtDCAVtxOutBC0PileUp[i]->SetXTitle("p_{T} (GeV/c)");
+//      fhPtDCAVtxOutBC0PileUp[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+//      outputContainer->Add(fhPtDCAVtxOutBC0PileUp[i]);
+//      
+//      fhPtDCAVtxOutBC0PileUpNoTOFHit[i]  = new TH2F(Form("hPtDCA%sVtxOutBC0PileUpNoTOFHit",dcaName[i].Data()),
+//                                           Form("Track (no TOF hit) DCA%s vs p_{T} distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()),
+//                                           nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
+//      fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle("p_{T} (GeV/c)");
+//      fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle(Form("DCA_{%s}",dcaName[i].Data()));
+//      outputContainer->Add(fhPtDCAVtxOutBC0PileUpNoTOFHit[i]);
+    }
+  }
+
+  
   
   if(IsDataMC()){
     
@@ -282,6 +441,11 @@ void  AliAnaChargedParticles::MakeAnalysisFillAOD()
   if(GetDebug() > 0)
     printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - In CTS aod entries %d\n", ntracks);
   
+  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (GetReader()->GetInputEvent());
+  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (GetReader()->GetInputEvent());
+  
+  Double_t bz = GetReader()->GetInputEvent()->GetMagneticField();
+
   //Fill AODParticle with CTS aods
   TVector3 p3;
   Int_t evtIndex = 0;
@@ -289,17 +453,151 @@ void  AliAnaChargedParticles::MakeAnalysisFillAOD()
     
     AliVTrack * track =  (AliVTrack*) (GetCTSTracks()->At(i));
     
-     //Fill AODParticle after some selection       
+     //Fill AODParticle after some selection
     Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
     p3.SetXYZ(mom[0],mom[1],mom[2]);
     
     //TOF
     ULong_t status = track->GetStatus();
-    Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) && ( (status & AliVTrack::kTIME) == AliVTrack::kTIME );
+    Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ;
     Double32_t tof = track->GetTOFsignal()*1e-3;
     //if( tof < 0) printf("TOF Signal %e, status %d, pt %f\n", tof,status,status2,p3.Pt());
     
-    if(okTOF)
+    Double_t dcaCons = -999;
+    Int_t vtxBC = -999;
+    if     (esdevent) vtxBC = esdevent->GetPrimaryVertex()->GetBC();
+    else if(aodevent) vtxBC = aodevent->GetPrimaryVertex()->GetBC();
+    
+    if(vtxBC!=AliVTrack::kTOFBCNA)printf("BC primary %d",vtxBC);
+    
+    AliAODTrack * aodTrack = dynamic_cast<AliAODTrack*>(track);
+    if(aodTrack)
+    {
+      dcaCons = aodTrack->DCA();
+      vtxBC   = aodTrack->GetProdVertex()->GetBC();
+    }
+
+    if(vtxBC!=AliVTrack::kTOFBCNA) printf(" - production %d\n",vtxBC);
+
+    fhProductionVertexBC->Fill(vtxBC);
+    
+    Double_t dca[2]   = {1e6,1e6};
+    Double_t covar[3] = {1e6,1e6,1e6};
+    track->PropagateToDCA(GetReader()->GetInputEvent()->GetPrimaryVertex(),bz,100.,dca,covar);
+    
+    if(dcaCons == -999)
+    {
+      fhPtDCA[0]->Fill(p3.Pt(), dca[0]);
+      fhPtDCA[1]->Fill(p3.Pt(), dca[1]);
+    }
+    else fhPtDCA[2]->Fill(p3.Pt(), dcaCons);
+    
+//    if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
+//    {
+//      if(dcaCons == -999)
+//      {
+//        fhPtDCAVtxOutBC0[0]->Fill(p3.Pt(), dca[0]);
+//        fhPtDCAVtxOutBC0[1]->Fill(p3.Pt(), dca[1]);
+//      }
+//      else
+//        fhPtDCAVtxOutBC0[2]->Fill(p3.Pt(), dcaCons);
+//    }
+    
+    if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD())
+    {
+      if(dcaCons == -999)
+      {
+        fhPtDCAPileUp[0]->Fill(p3.Pt(), dca[0]);
+        fhPtDCAPileUp[1]->Fill(p3.Pt(), dca[1]);
+      }
+      else
+        fhPtDCAPileUp[2]->Fill(p3.Pt(), dcaCons);
+      
+//      if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
+//      {
+//        if(dcaCons == -999)
+//        {
+//          fhPtDCAVtxOutBC0PileUp[0]->Fill(p3.Pt(), dca[0]);
+//          fhPtDCAVtxOutBC0PileUp[1]->Fill(p3.Pt(), dca[1]);
+//        }
+//        else fhPtDCAVtxOutBC0PileUp[2]->Fill(p3.Pt(), dcaCons);
+//      }
+    }
+
+    if(!okTOF)
+    {
+      if(dcaCons == -999)
+      {
+        fhPtDCANoTOFHit[0]->Fill(p3.Pt(), dca[0]);
+        fhPtDCANoTOFHit[1]->Fill(p3.Pt(), dca[1]);
+      }
+      else
+        fhPtDCANoTOFHit[2]->Fill(p3.Pt(), dcaCons);
+      
+//      if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
+//      {
+//        if(dcaCons == -999)
+//        {
+//          fhPtDCAVtxOutBC0NoTOFHit[0]->Fill(p3.Pt(), dca[0]);
+//          fhPtDCAVtxOutBC0NoTOFHit[1]->Fill(p3.Pt(), dca[1]);
+//        }
+//        else
+//          fhPtDCAVtxOutBC0NoTOFHit[2]->Fill(p3.Pt(), dcaCons);
+//      }
+      
+      if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD())
+      {
+        if(dcaCons == -999)
+        {
+          fhPtDCAPileUpNoTOFHit[0]->Fill(p3.Pt(), dca[0]);
+          fhPtDCAPileUpNoTOFHit[1]->Fill(p3.Pt(), dca[1]);
+        }
+        else
+          fhPtDCAPileUpNoTOFHit[2]->Fill(p3.Pt(), dcaCons);
+        
+//        if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
+//        {
+//          if(dcaCons == -999)
+//          {
+//            fhPtDCAVtxOutBC0PileUpNoTOFHit[0]->Fill(p3.Pt(), dca[0]);
+//            fhPtDCAVtxOutBC0PileUpNoTOFHit[1]->Fill(p3.Pt(), dca[1]);
+//          }
+//          else
+//            fhPtDCAVtxOutBC0PileUpNoTOFHit[2]->Fill(p3.Pt(), dcaCons);
+//        }
+      }
+    }
+    
+    //printf("track pT %2.2f, DCA Cons %f, DCA1 %f, DCA2 %f, TOFBC %d, oktof %d, tof %f\n",
+    //      p3.Pt(),dcaCons,dca[0],dca[1],track->GetTOFBunchCrossing(bz),okTOF, tof);
+    
+    Int_t trackBC = track->GetTOFBunchCrossing(bz);
+    
+    if(okTOF && trackBC==0)
+    {
+      fhTOFSignalBCOK->Fill(tof);
+      
+      if(dcaCons == -999)
+      {
+        fhPtDCATOFBC0[0]->Fill(p3.Pt(), dca[0]);
+        fhPtDCATOFBC0[1]->Fill(p3.Pt(), dca[1]);
+      }
+      else
+        fhPtDCATOFBC0[2]->Fill(p3.Pt(), dcaCons);
+      
+      if(fFillPileUpHistograms && GetReader()->IsPileUpFromSPD())
+      {
+        if(dcaCons == -999)
+        {
+          fhPtDCAPileUpTOFBC0[0]->Fill(p3.Pt(), dca[0]);
+          fhPtDCAPileUpTOFBC0[1]->Fill(p3.Pt(), dca[1]);
+        }
+        else
+          fhPtDCAPileUpTOFBC0[2]->Fill(p3.Pt(), dcaCons);
+      }
+    }
+    
+    if(okTOF && fFillPileUpHistograms)
     {
       fhTOFSignal  ->Fill(tof);
       fhPtTOFSignal->Fill(p3.Pt(), tof);
@@ -311,8 +609,13 @@ void  AliAnaChargedParticles::MakeAnalysisFillAOD()
       if(GetReader()->IsPileUpFromSPDAndNotEMCal())    fhPtTOFSignalPileUp[4]->Fill(p3.Pt(), tof);
       if(GetReader()->IsPileUpFromEMCalAndNotSPD())    fhPtTOFSignalPileUp[5]->Fill(p3.Pt(), tof);
       if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalPileUp[6]->Fill(p3.Pt(), tof);
+      
+      if      (trackBC ==0)  { fhEtaPhiTOFBC0    ->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBC0PileUpSPD    ->Fill(track->Eta(),track->Phi()); }
+      else if (trackBC < 0)  { fhEtaPhiTOFBCPlus ->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCPlusPileUpSPD ->Fill(track->Eta(),track->Phi()); }
+      else if (trackBC > 0)  { fhEtaPhiTOFBCMinus->Fill(track->Eta(),track->Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiTOFBCMinusPileUpSPD->Fill(track->Eta(),track->Phi()); }
+
     }
-    
+        
     Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,"CTS") ;
     
     if(GetDebug() > 1) 
@@ -371,6 +674,7 @@ void  AliAnaChargedParticles::MakeAnalysisFillHistograms()
   if(GetDebug() > 0) 
     printf("AliAnaChargedParticles::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
   
+  
   for(Int_t iaod = 0; iaod < naod ; iaod++){
     AliAODPWG4Particle* tr =  (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
         
@@ -387,6 +691,18 @@ void  AliAnaChargedParticles::MakeAnalysisFillHistograms()
       fhEtaPhiNeg->Fill(tr->Eta(),tr->Phi());
     }
     
+    if(fFillPileUpHistograms)
+    {
+      if(GetReader()->IsPileUpFromSPD())               {fhPtPileUp[0]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromEMCal())             {fhPtPileUp[1]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromSPDOrEMCal())        {fhPtPileUp[2]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromSPDAndEMCal())       {fhPtPileUp[3]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromSPDAndNotEMCal())    {fhPtPileUp[4]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromEMCalAndNotSPD())    {fhPtPileUp[5]->Fill(tr->Pt());}
+      if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(tr->Pt());}
+    }
+
+    
     if(IsDataMC())
     {
       //Play with the MC stack if available            
index ec82480..512830b 100755 (executable)
@@ -37,14 +37,19 @@ class AliAnaChargedParticles : public AliAnaCaloTrackCorrBaseClass {
   
   Int_t   GetPdgOfSelectedCharged()  const  { return fPdg ; }
   void    SelectChargedWithPdg( Int_t pdg ) { fPdg = pdg  ; }
-    
- private:
   
-  Int_t  fPdg ; //identified particle id
+  void    SwitchOnFillPileUpHistograms()    { fFillPileUpHistograms = kTRUE  ; }
+  void    SwitchOffFillPileUpHistograms()   { fFillPileUpHistograms = kFALSE ; }
+  
+ private:
   
-  //Histograms 
+  Int_t  fPdg ;                  // identified particle id
+  Bool_t fFillPileUpHistograms;  // Fill pile-up related histograms
+
+  //Histograms
   TH1F * fhNtracks;     //! track multiplicity distribution
   TH1F * fhPt;          //! pT distribution
+  TH1F * fhPtPileUp[7]; //! pT distribution, pile-up defined events
   TH2F * fhPhiNeg;      //! phi distribution vs pT, negative
   TH2F * fhEtaNeg;      //! eta distribution vs pT, negative
   TH2F * fhPhiPos;      //! phi distribution vs pT, positive
@@ -74,17 +79,39 @@ class AliAnaChargedParticles : public AliAnaCaloTrackCorrBaseClass {
   TH2F * fhEtaUnknown;  //! eta distribution vs pT
   
   // TOF
-  TH1F * fhTOFSignal;        //! TOF signal, good status
-  TH1F * fhTOFSignalPtCut;   //! TOF signal, good status, pt and acceptance cut
-  TH2F * fhPtTOFSignal;      //! TOF signal vs track pT, good status
-  TH2F * fhPtTOFSignalPileUp[7]; //! TOF signal vs track pT, good status, pile-up
-  TH1F * fhPtTOFStatus0;     //! pT of tracks not passing TOF status selection
-  TH2F * fhEtaPhiTOFStatus0; //! eta/phi of tracks not passing TOF status selection
+  TH1F * fhTOFSignal;                    //! TOF signal
+  TH1F * fhTOFSignalPtCut;               //! TOF signal pt and acceptance cut
+  TH1F * fhTOFSignalBCOK;                //! TOF signal pt and acceptance cut
+  TH2F * fhPtTOFSignal;                  //! TOF signal vs track pT, good status
+  TH2F * fhPtTOFSignalPileUp[7];         //! TOF signal vs track pT, good status, pile-up
+  TH1F * fhPtTOFStatus0;                 //! pT of tracks not passing TOF status selection
+  TH2F * fhEtaPhiTOFStatus0;             //! eta/phi of tracks not passing TOF status selection
+  TH2F * fhEtaPhiTOFBC0;                 //! eta/phi of tracks passing TOF status selection, tracks in BC=0
+  TH2F * fhEtaPhiTOFBCPlus;              //! eta/phi of tracks passing TOF status selection, tracks in BC>0
+  TH2F * fhEtaPhiTOFBCMinus;             //! eta/phi of tracks passing TOF status selection, tracks in BC<0
+  TH2F * fhEtaPhiTOFBC0PileUpSPD;        //! eta/phi of tracks passing TOF status selection, tracks in BC=0, pile-up spd
+  TH2F * fhEtaPhiTOFBCPlusPileUpSPD;     //! eta/phi of tracks passing TOF status selection, tracks in BC>0, pile-up spd
+  TH2F * fhEtaPhiTOFBCMinusPileUpSPD;    //! eta/phi of tracks passing TOF status selection, tracks in BC<0, pile-up spd
+  TH1F * fhProductionVertexBC;           //!  check BC of production vertex
 
+  TH2F * fhPtDCA[3];                     //! DCA (xy,z,constrained) of all tracks
+  //TH2F * fhPtDCAVtxOutBC0[3];            //! DCA (xy,z,constrained) of all tracks, vertex BC!=0
+  TH2F * fhPtDCAPileUp[3];               //! DCA (xy,z,constrained) of all tracks, SPD pile-up
+  //TH2F * fhPtDCAVtxOutBC0PileUp[3];      //! DCA (xy,z,constrained) of all tracks, vertex BC!=0, SPD pile-up
+
+  TH2F * fhPtDCATOFBC0[3];               //! DCA (xy,z,constrained) of all tracks, hit in TOF and BC=0
+  TH2F * fhPtDCAPileUpTOFBC0[3];         //! DCA (xy,z,constrained) of all tracks, hit in TOF and BC=0
+
+  TH2F * fhPtDCANoTOFHit[3];                //! DCA (xy,z,constrained) of all tracks, no hit in TOF
+  //TH2F * fhPtDCAVtxOutBC0NoTOFHit[3];       //! DCA (xy,z,constrained) of all tracks, vertex BC!=0, no hit in TOF
+  TH2F * fhPtDCAPileUpNoTOFHit[3];          //! DCA (xy,z,constrained) of all tracks, SPD pile-up, no hit in TOF
+  //TH2F * fhPtDCAVtxOutBC0PileUpNoTOFHit[3]; //! DCA (xy,z,constrained) of all tracks, vertex BC!=0, SPD pile-up, no hit in TOF
+  
+  
   AliAnaChargedParticles(              const AliAnaChargedParticles & ch) ; // cpy ctor
   AliAnaChargedParticles & operator = (const AliAnaChargedParticles & ch) ; // cpy assignment
   
-  ClassDef(AliAnaChargedParticles,4)
+  ClassDef(AliAnaChargedParticles,5)
 
 } ;
 
index 1011385..0f4a6b1 100755 (executable)
@@ -101,10 +101,14 @@ ClassImp(AliAnaParticleHadronCorrelation)
     fhDeltaPhiChargedPtA3GeV(0),    fhDeltaEtaChargedPtA3GeV(0),
     //Pile-Up
     fhDeltaPhiChargedPileUp(),      fhDeltaEtaChargedPileUp(),
-    fhXEChargedPileUp(),            fhXEUeChargedPileUp(),      
+    fhDeltaPhiChargedPtA3GeVPileUp(), fhDeltaEtaChargedPtA3GeVPileUp(),
+    fhXEChargedPileUp(),            fhXEUeChargedPileUp(),
     fhZTChargedPileUp(),            fhZTUeChargedPileUp(), 
     fhPtTrigChargedPileUp(),
-    fhDeltaPhiChargedPtA3GeVPileUp(), fhDeltaEtaChargedPtA3GeVPileUp(),
+    fhDeltaPhiChargedOtherBC(),     fhDeltaPhiChargedPtA3GeVOtherBC(),
+    fhXEChargedOtherBC(),           fhXEUeChargedOtherBC(),
+    fhZTChargedOtherBC(),           fhZTUeChargedOtherBC(),
+    fhPtTrigChargedOtherBC(),
     fhDeltaPhiUeLeftCharged(0),     fhDeltaPhiUeRightCharged(0),
     fhDeltaPhiUeLeftUpCharged(0),   fhDeltaPhiUeRightUpCharged(0),
     fhDeltaPhiUeLeftDownCharged(0), fhDeltaPhiUeRightDownCharged(0),
@@ -235,11 +239,11 @@ AliAnaParticleHadronCorrelation::~AliAnaParticleHadronCorrelation()
 }
 
 //______________________________________________________________________________________________________________________________________________________
-void AliAnaParticleHadronCorrelation::FillChargedAngularCorrelationHistograms(const Float_t ptAssoc,  const Float_t ptTrig,   const Int_t   bin,
-                                                                              const Float_t phiAssoc, const Float_t phiTrig,  Float_t &     deltaPhi,
+void AliAnaParticleHadronCorrelation::FillChargedAngularCorrelationHistograms(const Float_t ptAssoc,  const Float_t ptTrig,      const Int_t   bin,
+                                                                              const Float_t phiAssoc, const Float_t phiTrig,     Float_t &     deltaPhi,
                                                                               const Float_t etaAssoc, const Float_t etaTrig,  
-                                                                              const Bool_t  decay,    const Float_t hmpidSignal, const Int_t nTracks,
-                                                                              const Int_t   mcTag)
+                                                                              const Bool_t  decay,    const Float_t hmpidSignal, const Bool_t  outTOF,
+                                                                              const Int_t nTracks,       const Int_t   mcTag)
 {
   // Fill angular correlation related histograms
   
@@ -268,6 +272,12 @@ void AliAnaParticleHadronCorrelation::FillChargedAngularCorrelationHistograms(co
   
   if(fFillPileUpHistograms)
   {
+    if(outTOF)
+    {
+       fhDeltaPhiChargedOtherBC->Fill(ptTrig ,deltaPhi) ;
+      if(ptAssoc > 3 ) fhDeltaPhiChargedPtA3GeVOtherBC->Fill(ptTrig ,deltaPhi) ;
+    }
+    
     if(GetReader()->IsPileUpFromSPD())               { fhDeltaEtaChargedPileUp[0]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[0]->Fill(ptTrig ,deltaPhi) ; }
     if(GetReader()->IsPileUpFromEMCal())             { fhDeltaEtaChargedPileUp[1]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[1]->Fill(ptTrig ,deltaPhi) ; }
     if(GetReader()->IsPileUpFromSPDOrEMCal())        { fhDeltaEtaChargedPileUp[2]->Fill(ptTrig ,deltaEta) ; fhDeltaPhiChargedPileUp[2]->Fill(ptTrig ,deltaPhi) ; }
@@ -449,7 +459,7 @@ void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(con
                                                                              const Float_t pout,
                                                                              const Int_t   nTracks,  const Int_t   charge,
                                                                              const Int_t   bin,      const Bool_t  decay,
-                                                                             const Int_t   mcTag)
+                                                                             const Bool_t outTOF,    const Int_t   mcTag)
 
 {
   // Fill mostly momentum imbalance related histograms
@@ -464,13 +474,20 @@ void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(con
   // Pile up studies
   if(fFillPileUpHistograms) 
   {
-    if(GetReader()->IsPileUpFromSPD())                { fhXEChargedPileUp[0]->Fill(ptTrig ,xE); fhZTChargedPileUp[0]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[0]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromEMCal())              { fhXEChargedPileUp[1]->Fill(ptTrig ,xE); fhZTChargedPileUp[1]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[1]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromSPDOrEMCal())         { fhXEChargedPileUp[2]->Fill(ptTrig ,xE); fhZTChargedPileUp[2]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[2]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromSPDAndEMCal())        { fhXEChargedPileUp[3]->Fill(ptTrig ,xE); fhZTChargedPileUp[3]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[3]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromSPDAndNotEMCal())     { fhXEChargedPileUp[4]->Fill(ptTrig ,xE); fhZTChargedPileUp[4]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[4]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromEMCalAndNotSPD())     { fhXEChargedPileUp[5]->Fill(ptTrig ,xE); fhZTChargedPileUp[5]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[5]->Fill(ptTrig,ptAssoc); }
-    if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())  { fhXEChargedPileUp[6]->Fill(ptTrig ,xE); fhZTChargedPileUp[6]->Fill(ptTrig,zT);fhPtTrigChargedPileUp[6]->Fill(ptTrig,ptAssoc); }
+    if(outTOF)
+    {
+      fhXEChargedOtherBC    ->Fill(ptTrig,xE);
+      fhZTChargedOtherBC    ->Fill(ptTrig,zT);
+      fhPtTrigChargedOtherBC->Fill(ptTrig,ptAssoc);
+    }
+    
+    if(GetReader()->IsPileUpFromSPD())                { fhXEChargedPileUp[0]->Fill(ptTrig,xE); fhZTChargedPileUp[0]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[0]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromEMCal())              { fhXEChargedPileUp[1]->Fill(ptTrig,xE); fhZTChargedPileUp[1]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[1]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromSPDOrEMCal())         { fhXEChargedPileUp[2]->Fill(ptTrig,xE); fhZTChargedPileUp[2]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[2]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromSPDAndEMCal())        { fhXEChargedPileUp[3]->Fill(ptTrig,xE); fhZTChargedPileUp[3]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[3]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromSPDAndNotEMCal())     { fhXEChargedPileUp[4]->Fill(ptTrig,xE); fhZTChargedPileUp[4]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[4]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromEMCalAndNotSPD())     { fhXEChargedPileUp[5]->Fill(ptTrig,xE); fhZTChargedPileUp[5]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[5]->Fill(ptTrig,ptAssoc); }
+    if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())  { fhXEChargedPileUp[6]->Fill(ptTrig,xE); fhZTChargedPileUp[6]->Fill(ptTrig,zT); fhPtTrigChargedPileUp[6]->Fill(ptTrig,ptAssoc); }
   }
   
   if(IsDataMC())
@@ -524,7 +541,7 @@ void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(con
 
 //_______________________________________________________________________________________________________________________
 void AliAnaParticleHadronCorrelation::FillChargedUnderlyingEventHistograms(const Float_t ptTrig,   const Float_t ptAssoc,
-                                                                           const Float_t deltaPhi, const Int_t nTracks)
+                                                                           const Float_t deltaPhi, const Int_t nTracks, const Bool_t outTOF)
 {
   // Fill underlying event histograms
   
@@ -546,6 +563,13 @@ void AliAnaParticleHadronCorrelation::FillChargedUnderlyingEventHistograms(const
   
   if(fFillPileUpHistograms)
   {
+    
+    if(outTOF)
+    {
+      fhXEUeChargedOtherBC->Fill(ptTrig,uexE);
+      fhZTUeChargedOtherBC->Fill(ptTrig,uezT);
+    }
+    
     if(GetReader()->IsPileUpFromSPD())               { fhXEUeChargedPileUp[0]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[0]->Fill(ptTrig,uezT);}
     if(GetReader()->IsPileUpFromEMCal())             { fhXEUeChargedPileUp[1]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[1]->Fill(ptTrig,uezT);}
     if(GetReader()->IsPileUpFromSPDOrEMCal())        { fhXEUeChargedPileUp[2]->Fill(ptTrig,uexE); fhZTUeChargedPileUp[2]->Fill(ptTrig,uezT);}
@@ -2661,7 +2685,8 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
   Float_t ptTrig  = aodParticle->Pt();  
   Bool_t   decay  = aodParticle->IsTagged();
   Int_t    mcTag  = aodParticle->GetTag();
-  
+  Double_t bz     = GetReader()->GetInputEvent()->GetMagneticField();
+
   Float_t pt       = -100. ;
   Float_t zT       = -100. ; 
   Float_t xE       = -100. ; 
@@ -2774,10 +2799,18 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
       
       //printf("assoc Bin = %d, vZ bin  = %d, bin = %d \n", assocBin,GetEventVzBin(),bin);
       
+      ULong_t status = track->GetStatus();
+      Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
+      //Double32_t tof = track->GetTOFsignal()*1e-3;
+      Int_t trackBC = track->GetTOFBunchCrossing(bz);
+
+      Bool_t outTOF = kFALSE;
+      if(okTOF && trackBC!=0) outTOF = kTRUE;
+      
       // Azimuthal Angle
       // calculate deltaPhi for later, shift when needed
       FillChargedAngularCorrelationHistograms(pt,  ptTrig,  bin, phi, phiTrig,  deltaPhi,
-                                              eta, etaTrig, decay, track->GetHMPIDsignal(),nTracks,mcTag);
+                                              eta, etaTrig, decay, track->GetHMPIDsignal(),outTOF,nTracks,mcTag);
       
       // Imbalance zT/xE/pOut
       zT = pt/ptTrig ;
@@ -2796,13 +2829,13 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
       {
         
         FillChargedMomentumImbalanceHistograms(ptTrig, pt, xE, hbpXE, zT, hbpZT, pout, 
-                                               nTracks, track->Charge(), bin, decay,mcTag);
+                                               nTracks, track->Charge(), bin, decay,outTOF,mcTag);
         
       } 
-      if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) ) 
+      if ( (deltaPhi > fUeDeltaPhiMinCut) && (deltaPhi < fUeDeltaPhiMaxCut) )
       { //UE study
         
-        FillChargedUnderlyingEventHistograms(ptTrig, pt, deltaPhi, nTracks);
+        FillChargedUnderlyingEventHistograms(ptTrig, pt, deltaPhi, nTracks,outTOF);
 
         fhUePart->Fill(ptTrig);
         
index 6fa9e30..04deb10 100755 (executable)
@@ -57,11 +57,11 @@ class AliAnaParticleHadronCorrelation : public AliAnaCaloTrackCorrBaseClass {
   
   // Filling histogram methods
   
-  void         FillChargedAngularCorrelationHistograms  (const Float_t ptAssoc,  const Float_t ptTrig,   const Int_t   assocBin,
-                                                         const Float_t phiAssoc, const Float_t phiTrig,  Float_t &     deltaPhi,
+  void         FillChargedAngularCorrelationHistograms  (const Float_t ptAssoc,  const Float_t ptTrig,      const Int_t   assocBin,
+                                                         const Float_t phiAssoc, const Float_t phiTrig,     Float_t &     deltaPhi,
                                                          const Float_t etaAssoc, const Float_t etaTrig,  
-                                                         const Bool_t  decay,    const Float_t hmpidSignal,const Int_t nTracks,
-                                                         const Int_t   mcTag);
+                                                         const Bool_t  decay,    const Float_t hmpidSignal, const Bool_t outTOF,
+                                                         const Int_t nTracks,    const Int_t   mcTag);
   
   void         FillChargedEventMixPool();
   
@@ -73,10 +73,11 @@ class AliAnaParticleHadronCorrelation : public AliAnaCaloTrackCorrBaseClass {
                                                          const Float_t xE,       const Float_t hbpXE, 
                                                          const Float_t zT,       const Float_t hbpZT, 
                                                          const Float_t pout,     const Int_t   nTracks,  const Int_t charge,
-                                                         const Int_t   assocBin, const Bool_t  decay,    const Int_t mcTag );
+                                                         const Int_t   assocBin, const Bool_t  decay,
+                                                         const Bool_t outTOF,    const Int_t mcTag );
   
   void         FillChargedUnderlyingEventHistograms     (const Float_t ptTrig,   const Float_t ptAssoc, 
-                                                         const Float_t deltaPhi, const Int_t nTracks);
+                                                         const Float_t deltaPhi, const Int_t nTracks,    const Bool_t outTOF);
   
   void         FillChargedUnderlyingEventSidesHistograms(const Float_t ptTrig,   const Float_t ptAssoc, 
                                                          const Float_t deltaPhi);
@@ -273,13 +274,22 @@ class AliAnaParticleHadronCorrelation : public AliAnaCaloTrackCorrBaseClass {
   // Events tagged as pileup by SDD,EMCal, or combination
   TH2F *       fhDeltaPhiChargedPileUp[7]  ;    //! Difference of charged particle phi and trigger particle  phi as function of  trigger particle pT
   TH2F *       fhDeltaEtaChargedPileUp[7]  ;    //! Difference of charged particle eta and trigger particle  eta as function of  trigger particle pT
+  TH2F *       fhDeltaPhiChargedPtA3GeVPileUp[7] ; //! Difference of charged particle phi and trigger particle  phi as function of  trigger particle pT, pTa > 3 GeV
+  TH2F *       fhDeltaEtaChargedPtA3GeVPileUp[7] ; //! Difference of charged particle eta and trigger particle  eta as function of  trigger particle pT, pTa > 3 GeV
   TH2F *       fhXEChargedPileUp[7]  ;          //! Trigger particle -charged hadron momentum imbalance histogram
   TH2F *       fhXEUeChargedPileUp[7]  ;        //! Trigger particle -charged hadron momentum imbalance histogram
   TH2F *       fhZTChargedPileUp[7]  ;          //! Trigger particle -charged hadron momentum imbalance histogram
   TH2F *       fhZTUeChargedPileUp[7]  ;        //! Trigger particle -charged hadron momentum imbalance histogram
   TH2F *       fhPtTrigChargedPileUp[7] ;       //! trigger and correlated particl pt, to be used for mean value for kt
-  TH2F *       fhDeltaPhiChargedPtA3GeVPileUp[7] ; //! Difference of charged particle phi and trigger particle  phi as function of  trigger particle pT, pTa > 3 GeV
-  TH2F *       fhDeltaEtaChargedPtA3GeVPileUp[7] ; //! Difference of charged particle eta and trigger particle  eta as function of  trigger particle pT, pTa > 3 GeV
+  
+  TH2F *       fhDeltaPhiChargedOtherBC  ;       //! Difference of charged particle phi and trigger particle  phi as function of  trigger particle pT
+  TH2F *       fhDeltaPhiChargedPtA3GeVOtherBC ; //! Difference of charged particle phi and trigger particle  phi as function of  trigger particle pT, pTa > 3 GeV
+  TH2F *       fhXEChargedOtherBC  ;             //! Trigger particle -charged hadron momentum imbalance histogram
+  TH2F *       fhXEUeChargedOtherBC  ;           //! Trigger particle -charged hadron momentum imbalance histogram
+  TH2F *       fhZTChargedOtherBC  ;             //! Trigger particle -charged hadron momentum imbalance histogram
+  TH2F *       fhZTUeChargedOtherBC  ;           //! Trigger particle -charged hadron momentum imbalance histogram
+  TH2F *       fhPtTrigChargedOtherBC ;          //! trigger and correlated particl pt, to be used for mean value for kt
+
   
   //if several UE calculation is on, most useful for jet-jet events contribution
   TH2F *       fhDeltaPhiUeLeftCharged  ;      //! Difference of charged particle from underlying events phi and trigger particle  phi as function of charged particle pT
index 18b34bf..9eef5eb 100755 (executable)
@@ -64,7 +64,8 @@ fhEtaPhiNoIso(0),
 fhENoIso(0),                      fhPtNoIso(0),                    fhPtNLocMaxNoIso(0),                     
 fhPtDecayIso(0),                  fhPtDecayNoIso(0),
 fhEtaPhiDecayIso(0),              fhEtaPhiDecayNoIso(0), 
-fhConeSumPt(0),                   fhPtInCone(0),                   
+fhConeSumPt(0),                   fhPtInCone(0),
+fhPtTrackInCone(0),               fhPtTrackInConeOtherBC(0),       fhPtTrackInConeOtherBCPileUpSPD(0),
 fhPtInConePileUp(),               fhPtInConeCent(0),
 fhFRConeSumPt(0),                 fhPtInFRCone(0),                 fhPhiUEConeSumPt(0),
 fhEtaUEConeSumPt(0),              fhEtaBand(0),                    fhPhiBand(0),
@@ -801,14 +802,36 @@ TList *  AliAnaParticleIsolation::GetCreateOutputObjects()
     outputContainer->Add(fhConeSumPt) ;
     
     fhPtInCone  = new TH2F("hPtInCone",
-                           Form("p_{T} in isolation cone for R = %2.2f",r),
+                           Form("p_{T} of clusters and tracks in isolation cone for R = %2.2f",r),
                            nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
     fhPtInCone->SetYTitle("p_{T in cone} (GeV/c)");
     fhPtInCone->SetXTitle("p_{T} (GeV/c)");
     outputContainer->Add(fhPtInCone) ;
     
+    fhPtTrackInCone  = new TH2F("hPtTrackInCone",
+                           Form("p_{T} of tracks in isolation cone for R = %2.2f",r),
+                           nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
+    fhPtTrackInCone->SetYTitle("p_{T in cone} (GeV/c)");
+    fhPtTrackInCone->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhPtTrackInCone) ;
+    
     if(fFillPileUpHistograms)
     {
+      fhPtTrackInConeOtherBC  = new TH2F("hPtTrackInConeOtherBC",
+                                         Form("p_{T} of tracks in isolation cone for R = %2.2f, TOF from BC!=0",r),
+                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
+      fhPtTrackInConeOtherBC->SetYTitle("p_{T in cone} (GeV/c)");
+      fhPtTrackInConeOtherBC->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhPtTrackInConeOtherBC) ;
+      
+      fhPtTrackInConeOtherBCPileUpSPD  = new TH2F("hPtTrackInConeOtherBCPileUpSPD",
+                                         Form("p_{T} of tracks in isolation cone for R = %2.2f, TOF from BC!=0, pile-up from SPD",r),
+                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
+      fhPtTrackInConeOtherBCPileUpSPD->SetYTitle("p_{T in cone} (GeV/c)");
+      fhPtTrackInConeOtherBCPileUpSPD->SetXTitle("p_{T} (GeV/c)");
+      outputContainer->Add(fhPtTrackInConeOtherBCPileUpSPD) ;
+
+      
       for (Int_t i = 0; i < 7 ; i++)
       {
         fhPtInConePileUp[i]  = new TH2F(Form("hPtInConePileUp%s",pileUpName[i].Data()),
@@ -1778,6 +1801,8 @@ void  AliAnaParticleIsolation::MakeAnalysisFillHistograms()
   Float_t etaUEptsum = 0 ;
   Float_t phiUEptsum = 0 ;
   
+  Double_t bz = GetReader()->GetInputEvent()->GetMagneticField();
+
   //Loop on stored AOD 
   Int_t naod = GetInputAODBranch()->GetEntriesFast();
   if(GetDebug() > 0) printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Histo aod branch entries %d\n", naod);
@@ -1893,10 +1918,19 @@ void  AliAnaParticleIsolation::MakeAnalysisFillHistograms()
       {
         AliVTrack* track = (AliVTrack *) reftracks->At(itrack);
         Float_t pTtrack = track->Pt();
-        fhPtInCone->Fill(pt,pTtrack);
+        fhPtInCone     ->Fill(pt,pTtrack);
+        fhPtTrackInCone->Fill(pt,pTtrack);
         if(fFillPileUpHistograms)
         {
-          if(GetReader()->IsPileUpFromSPD())               fhPtInConePileUp[0]->Fill(pt,pTtrack);
+          ULong_t status = track->GetStatus();
+          Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
+          //Double32_t tof = track->GetTOFsignal()*1e-3;
+          Int_t trackBC = track->GetTOFBunchCrossing(bz);
+
+          if( okTOF && trackBC!=0 )fhPtTrackInConeOtherBC->Fill(pt,pTtrack);
+
+          if(GetReader()->IsPileUpFromSPD())             { fhPtInConePileUp[0]->Fill(pt,pTtrack);
+            if(okTOF && trackBC!=0 )           fhPtTrackInConeOtherBCPileUpSPD->Fill(pt,pTtrack); }
           if(GetReader()->IsPileUpFromEMCal())             fhPtInConePileUp[1]->Fill(pt,pTtrack);
           if(GetReader()->IsPileUpFromSPDOrEMCal())        fhPtInConePileUp[2]->Fill(pt,pTtrack);
           if(GetReader()->IsPileUpFromSPDAndEMCal())       fhPtInConePileUp[3]->Fill(pt,pTtrack);
index 2991e41..08a7a59 100755 (executable)
@@ -152,7 +152,10 @@ class AliAnaParticleIsolation : public AliAnaCaloTrackCorrBaseClass {
   TH2F *   fhEtaPhiDecayIso ;                     //! eta vs phi of isolated Pi0 decay particles
   TH2F *   fhEtaPhiDecayNoIso ;                   //! eta vs phi of not isolated leading Pi0 decay particles
   TH2F *   fhConeSumPt ;                          //! Sum Pt in the cone
-  TH2F *   fhPtInCone ;                           //! Particle Pt in the cone
+  TH2F *   fhPtInCone ;                           //! Cluster/track Pt in the cone
+  TH2F *   fhPtTrackInCone ;                      //! Track Pt in the cone
+  TH2F *   fhPtTrackInConeOtherBC ;               //! Track Pt in the cone, tracks out of main BC Time window
+  TH2F *   fhPtTrackInConeOtherBCPileUpSPD ;      //! Track Pt in the cone, tracks out of main BC Time window
   TH2F *   fhPtInConePileUp[7] ;                  //! Particle Pt in the cone, if event is from pile-up (SPD method)
   TH2F *   fhPtInConeCent ;                       //! Particle Pt in the cone versus centrality
   TH2F *   fhFRConeSumPt ;                        //! Sum Pt in the forward region cone (phi +90)
index 09eb245..c24b013 100755 (executable)
@@ -103,7 +103,11 @@ AliAnaPhoton::AliAnaPhoton() :
     fhTimeNPileUpVertSPD(0),              fhTimeNPileUpVertTrack(0),
     fhTimeNPileUpVertContributors(0),
     fhTimePileUpMainVertexZDistance(0),   fhTimePileUpMainVertexZDiamond(0),
-    fhClusterMultSPDPileUp(),             fhClusterMultNoPileUp()
+    fhClusterMultSPDPileUp(),             fhClusterMultNoPileUp(),
+    fhEtaPhiBC0(0),  fhEtaPhiBCPlus(0),   fhEtaPhiBCMinus(0),
+    fhEtaPhiBC0PileUpSPD(0),
+    fhEtaPhiBCPlusPileUpSPD(0),
+    fhEtaPhiBCMinusPileUpSPD(0)
  {
   //default ctor
   
@@ -235,7 +239,6 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, const TLorentzVector mo
 
   if(fFillPileUpHistograms)
   {
-    
     // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
     AliVCaloCells* cells = 0;
     if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
@@ -356,7 +359,10 @@ Bool_t  AliAnaPhoton::ClusterSelected(AliVCluster* calo, const TLorentzVector mo
     if(GetReader()->IsPileUpFromSPDAndNotEMCal())    {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ecluster,frac);}
     if(GetReader()->IsPileUpFromEMCalAndNotSPD())    {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ecluster,frac);}
     if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ecluster,frac);}
-        
+    
+    if(tmax > -25 && tmax < 25) {fhEtaPhiBC0    ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD    ->Fill(mom.Eta(),mom.Phi()); }
+    else if (tmax > 25)         {fhEtaPhiBCPlus ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
+    else if (tmax <-25)         {fhEtaPhiBCMinus->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(mom.Eta(),mom.Phi()); }
   }
   
   //.......................................
@@ -1473,6 +1479,7 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
     fhEtaPhi05Photon->SetXTitle("#eta");
     outputContainer->Add(fhEtaPhi05Photon) ;
   }
+
   
   fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
                        nptbins,ptmin,ptmax,10,0,10); 
@@ -2047,6 +2054,36 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
 
     }
     
+    fhEtaPhiBC0  = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBC0->SetXTitle("#eta ");
+    fhEtaPhiBC0->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBC0);
+    
+    fhEtaPhiBCPlus  = new TH2F ("hEtaPhiBCPlus","eta-phi for clusters tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBCPlus->SetXTitle("#eta ");
+    fhEtaPhiBCPlus->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBCPlus);
+    
+    fhEtaPhiBCMinus  = new TH2F ("hEtaPhiBCMinus","eta-phi for clusters tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBCMinus->SetXTitle("#eta ");
+    fhEtaPhiBCMinus->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBCMinus);
+    
+    fhEtaPhiBC0PileUpSPD  = new TH2F ("hEtaPhiBC0PileUpSPD","eta-phi for clusters tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBC0PileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiBC0PileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBC0PileUpSPD);
+    
+    fhEtaPhiBCPlusPileUpSPD  = new TH2F ("hEtaPhiBCPlusPileUpSPD","eta-phi for clusters tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBCPlusPileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiBCPlusPileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBCPlusPileUpSPD);
+    
+    fhEtaPhiBCMinusPileUpSPD  = new TH2F ("hEtaPhiBCMinusPileUpSPD","eta-phi for clusters tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
+    fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
+    fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
+    outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
+
     fhTimeENoCut  = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
     fhTimeENoCut->SetXTitle("E (GeV)");
     fhTimeENoCut->SetYTitle("time (ns)");
index 072fe6f..1eef089 100755 (executable)
@@ -153,6 +153,8 @@ class AliAnaPhoton : public AliAnaCaloTrackCorrBaseClass {
   TH2F * fhEtaPhiPhoton  ;               //! Pseudorapidity vs Phi of identified  photon for transerse momentum > 0.5
   TH2F * fhEtaPhi05Photon  ;             //! Pseudorapidity vs Phi of identified  photon for transerse momentum < 0.5
   
+  
+  
   //Shower shape
   TH2F * fhNLocMax;                       //! number of maxima in selected clusters
 
@@ -306,7 +308,13 @@ class AliAnaPhoton : public AliAnaCaloTrackCorrBaseClass {
   TH2F * fhTimePileUpMainVertexZDiamond;        //! time of cluster vs difference of z diamond and pile-up vertex 
   TH2F * fhClusterMultSPDPileUp[4];             //! E max cluster vs event cluster multiplicity, for tmax-tdiff cuts, pile up event
   TH2F * fhClusterMultNoPileUp[4];              //! E max cluster vs event cluster multiplicity, for tmax-tdiff cuts, not pile up event
-  
+  TH2F * fhEtaPhiBC0;                           //! eta/phi of clusters in BC=0
+  TH2F * fhEtaPhiBCPlus;                        //! eta/phi of clusters in BC>0
+  TH2F * fhEtaPhiBCMinus;                       //! eta/phi of clusters in BC<0
+  TH2F * fhEtaPhiBC0PileUpSPD;                  //! eta/phi of clusters in BC=0, SPD pile-up
+  TH2F * fhEtaPhiBCPlusPileUpSPD;               //! eta/phi of clusters in BC>0, SPD pile-up
+  TH2F * fhEtaPhiBCMinusPileUpSPD;              //! eta/phi of clusters in BC<0, SPD pile-up
+
   AliAnaPhoton(              const AliAnaPhoton & g) ; // cpy ctor
   AliAnaPhoton & operator = (const AliAnaPhoton & g) ; // cpy assignment
   
index 32c9ba5..7cf3081 100644 (file)
@@ -309,15 +309,23 @@ AliCaloTrackReader * ConfigureReader()
   // Time cuts
   if(kSimulation) 
   {
-    reader->SetEMCALTimeCut(-1000,1000); // Open time cut
+    reader->SwitchOffUseTrackTimeCut();
     reader->SwitchOffUseParametrizedTimeCut();
+    reader->SwitchOffUseEMCALTimeCut();
+    reader->SetEMCALTimeCut(-1000,1000); // Open time cut
   }
   else
   {
     if(kCalibT)
     { 
-      //reader->SetEMCALTimeCut(-20,20); 
+      printf("Set time cut parameters for run %d\n",kRunNumber);
+      reader->SwitchOnUseEMCALTimeCut();
       reader->SwitchOnUseParametrizedTimeCut();
+      
+      //Absolute window
+      reader->SetEMCALTimeCut(-20,20);
+      
+      //Parametrization
       if     (kRunNumber >= 151636 && kRunNumber <= 155384 )
       {
         printf("Set time parameters for LHC11c");
@@ -330,11 +338,15 @@ AliCaloTrackReader * ConfigureReader()
         reader->SetEMCALParametrizedMinTimeCut(0,-5);  reader->SetEMCALParametrizedMinTimeCut(1,-1 );  reader->SetEMCALParametrizedMinTimeCut(2, 3.5 ); reader->SetEMCALParametrizedMinTimeCut(3, 1.  );   
         reader->SetEMCALParametrizedMaxTimeCut(0, 5);  reader->SetEMCALParametrizedMaxTimeCut(1, 50);  reader->SetEMCALParametrizedMaxTimeCut(2, 0.45); reader->SetEMCALParametrizedMaxTimeCut(3, 1.25);   
       }
-      else reader->SetEMCALTimeCut(-20,20);
-      
+      else
+      {
+        reader->SwitchOffUseParametrizedTimeCut();
+      }
     }
     else
     {
+      reader->SwitchOffUseParametrizedTimeCut();
+      reader->SwitchOffUseEMCALTimeCut();
       reader->SetEMCALTimeCut(-1000,1000); // Open time cut
     }
   }
@@ -354,7 +366,8 @@ AliCaloTrackReader * ConfigureReader()
   else if(kInputDataType=="AOD")
   {
     reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
-    reader->SetTrackFilterMask(128);           // Filter bit, not mask, use if off hybrid
+    //reader->SwitchOnTrackHitSPDSelection();    // Check that the track has at least a hit on the SPD, not much sense to use for hybrid or TPC only tracks
+    //reader->SetTrackFilterMask(128);           // Filter bit, not mask, use if off hybrid
   }
   
   // Calorimeter
@@ -784,6 +797,7 @@ AliAnaChargedParticles* ConfigureChargedAnalysis()
   ana->SetMinPt(0.5);
   ana->SwitchOnFiducialCut();
   ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
+  ana->SwitchOffFillPileUpHistograms();
 
   // Input / output delta AOD settings
   
@@ -904,10 +918,7 @@ AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
     ana->SetInputAODName(Form("%s%s%s",particle.Data(),opt.Data(),kName.Data()));
   
   if(analysis == AliAnaPi0EbE::kIMCaloTracks) ana->SetInputAODGammaConvName("PhotonsCTS");
-  
-  // NLM cut, used in all, exclude clusters with more than 2 maxima
-  ana->SetNLMCut(1, 2) ;
-  
+    
   if(analysis!=AliAnaPi0EbE::kSSCalo)
   {
     AliNeutralMesonSelection *nms = ana->GetNeutralMesonSelection();
@@ -931,11 +942,15 @@ AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
     ana->SetMinEnergy(5); 
     ana->SetMaxEnergy(200.);   
     ana->SetTimeCut(-1000,1000); // Open time cut
+    
+    // NLM cut, used in all, exclude clusters with more than 2 maxima
+    ana->SetNLMCut(1, 2) ;
+    
     AliCaloPID* caloPID = ana->GetCaloPID();
     caloPID->SetPi0MassRange(0.10, 0.18);
     caloPID->SetEtaMassRange(0.40, 0.60);
     caloPID->SetPhotonMassRange(0.00, 0.08);
-    caloPID->SetClusterSplittingM02Cut(0.3,3); // Do the selection in the analysis class and not in the PID method to fill SS histograms
+    caloPID->SetClusterSplittingM02Cut(0.3,5); // Do the selection in the analysis class and not in the PID method to fill SS histograms
   }
   
   ana->SwitchOffSelectedClusterHistoFill(); 
@@ -1086,7 +1101,7 @@ AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon",
 
 //___________________________________________________________________________________
 AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle, 
-                                                                    Int_t bIsolated,                                                                    
+                                                                    Bool_t bIsolated,
                                                                     Int_t  partInCone = AliIsolationCut::kOnlyCharged,
                                                                     Int_t  thresType  = AliIsolationCut::kSumPtFracIC,
                                                                     Float_t cone = 0.3,
@@ -1152,8 +1167,13 @@ AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString part
   ana->SwitchOffNearSideLeading(); // Select trigger leading particle of all the particles at +-90 degrees, default
   
   // Mixing with own pool
-  if(kMix)ana->SwitchOnOwnMix();
-  else    ana->SwitchOffOwnMix();
+  if(kMix)
+  {
+    ana->SwitchOnOwnMix();
+    ana->SwitchOnFillNeutralInMixedEvent();
+  }
+  else
+    ana->SwitchOffOwnMix();
   
   ana->SetNZvertBin(20);
   
@@ -1203,7 +1223,7 @@ AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString part
   // If trigger is photon, check if it was tagged as decay previously
   if(particle!="Hadron" )
   {
-    if(particle=="Pi0" || particle =="Eta") 
+    if(particle.Contains("Pi0") || particle.Contains("Eta"))
     {
       ana->SwitchOffPi0TriggerDecayCorr();
       ana->SwitchOffDecayTriggerDecayCorr();
@@ -1291,7 +1311,7 @@ AliAnaCalorimeterQA* ConfigureQAAnalysis()
   ana->SwitchOffStudyClustersAsymmetry();
   ana->SwitchOffStudyWeight();
   ana->SwitchOnFillAllTrackMatchingHistogram();
-  ana->SwitchOffFillAllCellTimeHisto() ;
+  ana->SwitchOnFillAllCellTimeHisto() ;
 
   if(kCalorimeter=="EMCAL")
   {
@@ -1393,8 +1413,8 @@ void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges)
   
 }
 
-//_________________
-Int_t SetTriggerMaskFromName()
+//_____________________________
+UInt_t SetTriggerMaskFromName()
 {
   if(kTrig=="EMC7")
   {