Add new DijetHadron task from Taiyo
authormvl <marco.van.leeuwen@cern.ch>
Wed, 8 Oct 2014 09:42:58 +0000 (11:42 +0200)
committermvl <marco.van.leeuwen@cern.ch>
Thu, 9 Oct 2014 19:48:56 +0000 (21:48 +0200)
PWGJE/CMakelibPWGJEEMCALJetTasks.pkg
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.cxx [new file with mode: 0644]
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.h [new file with mode: 0644]
PWGJE/EMCALJetTasks/macros/AddTaskDijetHadron.C [new file with mode: 0644]
PWGJE/PWGJEEMCALJetTasksLinkDef.h

index a3bec4e..fb302c7 100644 (file)
@@ -56,6 +56,7 @@ set ( SRCS
  EMCALJetTasks/UserTasks/AliAnalysisTaskChargedJetsPA.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskDcalDijetPerf.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskDeltaPtJEmb.cxx        
+ EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalBadCells.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetBase.cxx
  EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalDiJetAna.cxx
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.cxx
new file mode 100644 (file)
index 0000000..511e31e
--- /dev/null
@@ -0,0 +1,3052 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, 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.                  *
+ **************************************************************************/
+//
+// Analysis task for Dijet-hadron correlations
+//
+// Author: T.Kobayashi
+// I refer to macro written by S.Aiola.
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TH3F.h>
+#include <TCanvas.h>
+#include <TChain.h>
+#include <TFormula.h>
+#include <TH1.h>
+#include <TH2.h>
+#include <TH3.h>
+#include <TProfile2D.h>
+#include <THnSparse.h>
+#include <TROOT.h>
+#include <TTree.h>
+#include <TArrayI.h>
+#include <TClonesArray.h>
+#include <TRandom3.h>
+#include <TFile.h>
+#include <TF1.h>
+#include <TLorentzVector.h>
+#include <TParameter.h>
+#include <TList.h>
+
+#include "AliAODEvent.h"
+#include "AliAODInputHandler.h"
+#include "AliAnalysisManager.h"
+#include "AliAnalysisTask.h"
+#include "AliCentrality.h"
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+#include "AliVParticle.h"
+#include "AliVCluster.h"
+#include "AliVTrack.h"
+#include "AliEmcalJet.h"
+#include "AliInputEventHandler.h"
+#include "AliMCEvent.h"
+#include "AliStack.h"
+#include "AliGenEventHeader.h"
+#include "AliGenPythiaEventHeader.h"
+#include "AliLog.h"
+#include "AliRhoParameter.h"
+#include "AliNamedArrayI.h"
+#include "AliNamedString.h"
+#include "AliJetContainer.h"
+#include "AliParticleContainer.h"
+#include "AliClusterContainer.h"
+
+#include "AliEmcalJet.h"
+
+#include <iostream>
+using std::cout;
+using std::cerr;
+using std::endl;
+
+const Double_t pi = TMath::Pi();
+//const Double_t areaCut[4] = {0.1, 0.23, 0.4, 0.63};
+
+#include "AliAnalysisTaskDijetHadron.h"
+
+ClassImp(AliAnalysisTaskDijetHadron)
+
+//________________________________________________________________________
+  AliAnalysisTaskDijetHadron::AliAnalysisTaskDijetHadron() : 
+    AliAnalysisTaskEmcalJet("AliAnalysisTaskDijetHadron", kTRUE),
+    fMCJetPtThreshold(1),
+    fMinRC2LJ(-1),
+    fRCperEvent(-1),
+    //fPtHardBinName(0x0),
+    //fPtHardBin(-1),
+    //fhPtHardBins(0x0),
+    fConeRadius(0.2),
+    fConeMinEta(-0.9),
+    fConeMaxEta(0.9),
+    fConeMinPhi(0),
+    fConeMaxPhi(TMath::Pi()*2),
+    fJetsCont(0),
+    fTracksCont(0),
+    fCaloClustersCont(0),
+    fMCJetsCont(0),
+    fMCTracksCont(0),
+    fMCCaloClustersCont(0),
+    fEmbJetsCont(0),
+    fEmbTracksCont(0),
+    fEmbCaloClustersCont(0),
+    //fRandTracksCont(0),
+    //fRandCaloClustersCont(0),
+    fHistRCPhiEta(0), 
+    fHistRCPt(0),
+    fHistRCPtExLJ(0),
+    fHistRCPtExPartialLJ(0), 
+    //fHistRCPtRand(0),
+    fHistRhoVSRCPt(0),
+    fHistDeltaPtRCvsEP(0),
+    fHistDeltaPtRCExLJ(0),
+    fHistDeltaPtRCExPartialLJ(0),
+    //fHistDeltaPtRCRand(0),
+    fHistEmbJetsPtArea(0),
+    fHistEmbJetsCorrPtArea(0),
+    fHistEmbPartPtvsJetPt(0),
+    fHistEmbPartPtvsJetCorrPt(0),
+    fHistJetPtvsJetCorrPt(0),
+    fHistDistLeadPart2JetAxis(0),
+    fHistEmbBkgArea(0),
+    fHistRhoVSEmbBkg(0),
+    fHistDeltaPtEmbArea(0),
+    fHistDeltaPtEmbvsEP(0),
+    fHistRCPtExLJVSDPhiLJ(0),
+    fHistRCPtExPartialLJVSDPhiLJ(0),
+    fHistEmbJetsPhiEta(0),
+    fHistLeadPartPhiEta(0),
+    fCent_V0(0),
+    fVertex_z_cut(0),
+    fJetBG_rho(0),
+    fJetBG_rho_Cent(0),
+    fTrackPt_PbPb(0),
+    fTrackPhi_PbPb(0),
+    fTrackEta_PbPb(0),
+    fTrack_Phi_Eta_PbPb(0),
+    fTrackPt_MC(0),
+    fTrackPhi_MC(0),
+    fTrackEta_MC(0),
+    fTrack_Phi_Eta_MC(0),
+    fTrackPt_EMB(0),
+    fTrackPhi_EMB(0),
+    fTrackEta_EMB(0),
+    fTrack_Phi_Eta_EMB(0),
+    fJetPt_PbPb(),
+    fJetPhi_PbPb(),
+    fJetEta_PbPb(),
+    fJet_Phi_Eta_PbPb(),
+    fJetPt_BG_PbPb(),
+    fJet1Pt_PbPb(),
+    fJet2Pt_PbPb(),
+    fJet1Pt_BG_PbPb(),
+    fJet2Pt_BG_PbPb(),
+    fJetDeltaPhi_PbPb(),
+    fJetDeltaEta_PbPb(),
+    fJetDeltaEP_PbPb(),
+    fJet1SelectPt_BG_PbPb(),
+    fJet2SelectPt_BG_PbPb(),
+    fAj_PbPb(),
+    fJetPt_MC(),
+    fJetPhi_MC(),
+    fJetEta_MC(),
+    fJet_Phi_Eta_MC(),
+    fJet1Pt_MC(),
+    fJet2Pt_MC(),
+    fJetDeltaPhi_MC(),
+    fJetDeltaEta_MC(),
+    fJetDeltaEP_MC(),
+    fAj_MC(),
+    fJetPt_EMB(),
+    fJetPhi_EMB(),
+    fJetEta_EMB(),
+    fJet_Phi_Eta_EMB(),
+    fJetPt_BG_EMB(),
+    fJetDeltaPt(),
+    fJet1Pt_EMB(),
+    fJet2Pt_EMB(),
+    fJet1Pt_BG_EMB(),
+    fJet2Pt_BG_EMB(),
+    fJet1DeltaPt(),
+    fJet2DeltaPt(),
+    fJetDeltaPhi_EMB(),
+    fJetDeltaEta_EMB(),
+    fJetDeltaEP_EMB(),
+    fJet1SelectPt_BG_EMB(),
+    fJet2SelectPt_BG_EMB(),
+    fJet1SelectDeltaPt(),
+    fJet2SelectDeltaPt(),
+    fAj_EMB(),
+    fHJetDeltaPhi_Aj0_PbPb(),
+    fHJetDeltaPhi_Aj1_PbPb(),
+    fHJetDeltaPhi_Aj2_PbPb(),
+    fHJetDeltaPhi_Aj3_PbPb(),
+    fHJetDeltaPhi_Aj4_PbPb(),
+    fHJetPt_Aj0_PbPb(),
+    fHJetPt_Aj1_PbPb(),
+    fHJetPt_Aj2_PbPb(),
+    fHJetPt_Aj3_PbPb(),
+    fHJetPt_Aj4_PbPb(),
+    fHJetDeltaPhi_Aj0_MC(),
+    fHJetDeltaPhi_Aj1_MC(),
+    fHJetDeltaPhi_Aj2_MC(),
+    fHJetDeltaPhi_Aj3_MC(),
+    fHJetDeltaPhi_Aj4_MC(),
+    fHJetPt_Aj0_MC(),
+    fHJetPt_Aj1_MC(),
+    fHJetPt_Aj2_MC(),
+    fHJetPt_Aj3_MC(),
+    fHJetPt_Aj4_MC(),
+    fHJetDeltaPhi_Aj0_EMB(),
+    fHJetDeltaPhi_Aj1_EMB(),
+    fHJetDeltaPhi_Aj2_EMB(),
+    fHJetDeltaPhi_Aj3_EMB(),
+    fHJetDeltaPhi_Aj4_EMB(),
+    fHJetPt_Aj0_EMB(),
+    fHJetPt_Aj1_EMB(),
+    fHJetPt_Aj2_EMB(),
+    fHJetPt_Aj3_EMB(),
+    fHJetPt_Aj4_EMB(),
+    fHJetDeltaPhiasEP_Aj0_PbPb(),
+    fHJetDeltaPhiasEP_Aj1_PbPb(),
+    fHJetDeltaPhiasEP_Aj2_PbPb(),
+    fHJetDeltaPhiasEP_Aj3_PbPb(),
+    fHJetDeltaPhiasEP_Aj4_PbPb(),
+    fHJetPtasEP_Aj0_PbPb(),
+    fHJetPtasEP_Aj1_PbPb(),
+    fHJetPtasEP_Aj2_PbPb(),
+    fHJetPtasEP_Aj3_PbPb(),
+    fHJetPtasEP_Aj4_PbPb(),
+    fHJetDeltaPhiasEP_Aj0_MC(),
+    fHJetDeltaPhiasEP_Aj1_MC(),
+    fHJetDeltaPhiasEP_Aj2_MC(),
+    fHJetDeltaPhiasEP_Aj3_MC(),
+    fHJetDeltaPhiasEP_Aj4_MC(),
+    fHJetPtasEP_Aj0_MC(),
+    fHJetPtasEP_Aj1_MC(),
+    fHJetPtasEP_Aj2_MC(),
+    fHJetPtasEP_Aj3_MC(),
+    fHJetPtasEP_Aj4_MC(),
+    fHJetDeltaPhiasEP_Aj0_EMB(),
+    fHJetDeltaPhiasEP_Aj1_EMB(),
+    fHJetDeltaPhiasEP_Aj2_EMB(),
+    fHJetDeltaPhiasEP_Aj3_EMB(),
+    fHJetDeltaPhiasEP_Aj4_EMB(),
+    fHJetPtasEP_Aj0_EMB(),
+    fHJetPtasEP_Aj1_EMB(),
+    fHJetPtasEP_Aj2_EMB(),
+    fHJetPtasEP_Aj3_EMB(),
+    fHJetPtasEP_Aj4_EMB(),
+    fEvent(0),
+    fCentrality(0)
+
+{
+  // Default constructor.
+
+  fHistRCPt = 0;
+  fHistRCPtExLJ = 0;
+  fHistRCPtExPartialLJ = 0;
+  //fHistRCPtRand = 0;
+  fHistRhoVSRCPt = 0;
+  fHistDeltaPtRCvsEP = 0;
+  fHistDeltaPtRCExLJ = 0;
+  fHistDeltaPtRCExPartialLJ = 0;
+  //fHistDeltaPtRCRand = 0;
+  fHistEmbJetsPtArea = 0;
+  fHistEmbJetsCorrPtArea = 0;
+  fHistEmbPartPtvsJetPt = 0;
+  fHistEmbPartPtvsJetCorrPt = 0;
+  fHistJetPtvsJetCorrPt = 0;
+  fHistDistLeadPart2JetAxis = 0;
+  fHistEmbBkgArea = 0;
+  fHistRhoVSEmbBkg = 0;
+  fHistDeltaPtEmbArea = 0;
+  fHistDeltaPtEmbvsEP = 0;
+  fCent_V0 = 0;
+  fVertex_z_cut = 0;
+  fJetBG_rho = 0;
+  fJetBG_rho_Cent = 0;
+  fTrackPt_PbPb = 0;
+  fTrackPhi_PbPb = 0;
+  fTrackEta_PbPb = 0;
+  fTrack_Phi_Eta_PbPb = 0;
+  fTrackPt_MC = 0;
+  fTrackPhi_MC = 0;
+  fTrackEta_MC = 0;
+  fTrack_Phi_Eta_MC = 0;
+  fTrackPt_EMB = 0;
+  fTrackPhi_EMB = 0;
+  fTrackEta_EMB = 0;
+  fTrack_Phi_Eta_EMB = 0;
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      fJetPt_PbPb[i][j] = 0;
+      fJetPhi_PbPb[i][j] = 0;
+      fJetEta_PbPb[i][j] = 0;
+      fJet_Phi_Eta_PbPb[i][j] = 0;
+      fJetPt_BG_PbPb[i][j] = 0;
+
+      fJetPt_MC[i][j] = 0;
+      fJetPhi_MC[i][j] = 0;
+      fJetEta_MC[i][j] = 0;
+      fJet_Phi_Eta_MC[i][j] = 0;
+
+      fJetPt_EMB[i][j] = 0;
+      fJetPhi_EMB[i][j] = 0;
+      fJetEta_EMB[i][j] = 0;
+      fJet_Phi_Eta_EMB[i][j] = 0;
+      fJetPt_BG_EMB[i][j] = 0;
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < k+1; l++) {
+         fJet1Pt_PbPb[i][j][k][l] = 0;
+         fJet2Pt_PbPb[i][j][k][l] = 0;
+         fJet1Pt_BG_PbPb[i][j][k][l] = 0;
+         fJet2Pt_BG_PbPb[i][j][k][l] = 0;
+         fJetDeltaPhi_PbPb[i][j][k][l] = 0;
+         fJetDeltaEta_PbPb[i][j][k][l] = 0;
+         fJetDeltaEP_PbPb[i][j][k][l] = 0;
+         fJet1SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fJet2SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fAj_PbPb[i][j][k][l] = 0;
+
+         fJet1Pt_MC[i][j][k][l] = 0;
+         fJet2Pt_MC[i][j][k][l] = 0;
+         fJetDeltaPhi_MC[i][j][k][l] = 0;
+         fJetDeltaEta_MC[i][j][k][l] = 0;
+         fJetDeltaEP_MC[i][j][k][l] = 0;
+         fAj_MC[i][j][k][l] = 0;
+
+         fJet1Pt_EMB[i][j][k][l] = 0;
+         fJet2Pt_EMB[i][j][k][l] = 0;
+         fJet1Pt_BG_EMB[i][j][k][l] = 0;
+         fJet2Pt_BG_EMB[i][j][k][l] = 0;
+         fJet1DeltaPt[i][j][k][l] = 0;
+         fJet2DeltaPt[i][j][k][l] = 0;
+         fJetDeltaPhi_EMB[i][j][k][l] = 0;
+         fJetDeltaEta_EMB[i][j][k][l] = 0;
+         fJetDeltaEP_EMB[i][j][k][l] = 0;
+         fJet1SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet2SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet1SelectDeltaPt[i][j][k][l] = 0;
+         fJet2SelectDeltaPt[i][j][k][l] = 0;
+         fAj_EMB[i][j][k][l] = 0;
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           fHJetDeltaPhi_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhi_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhi_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 4; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           fHJetDeltaPhiasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+  SetMakeGeneralHistograms(kTRUE);
+}
+
+//________________________________________________________________________
+AliAnalysisTaskDijetHadron::AliAnalysisTaskDijetHadron(const char *name) : 
+  AliAnalysisTaskEmcalJet(name, kTRUE),
+  fMCJetPtThreshold(1),
+  fMinRC2LJ(-1),
+  fRCperEvent(-1),
+  //fPtHardBinName(0x0),
+  //fPtHardBin(-1),
+  //fhPtHardBins(0x0),
+  fConeRadius(0.2),
+  fConeMinEta(-0.9),
+  fConeMaxEta(0.9),
+  fConeMinPhi(0),
+  fConeMaxPhi(TMath::Pi()*2),
+  fJetsCont(0),
+  fTracksCont(0),
+  fCaloClustersCont(0),
+  fMCJetsCont(0),
+  fMCTracksCont(0),
+  fMCCaloClustersCont(0),
+  fEmbJetsCont(0),
+  fEmbTracksCont(0),
+  fEmbCaloClustersCont(0),
+  //fRandTracksCont(0),
+  //fRandCaloClustersCont(0),
+  fHistRCPhiEta(0), 
+  fHistRCPt(0),
+  fHistRCPtExLJ(0),
+  fHistRCPtExPartialLJ(0), 
+  //fHistRCPtRand(0),
+  fHistRhoVSRCPt(0),
+  fHistDeltaPtRCvsEP(0),
+  fHistDeltaPtRCExLJ(0),
+  fHistDeltaPtRCExPartialLJ(0),
+  //fHistDeltaPtRCRand(0),
+  fHistEmbJetsPtArea(0),
+  fHistEmbJetsCorrPtArea(0),
+  fHistEmbPartPtvsJetPt(0),
+  fHistEmbPartPtvsJetCorrPt(0),
+  fHistJetPtvsJetCorrPt(0),
+  fHistDistLeadPart2JetAxis(0),
+  fHistEmbBkgArea(0),
+  fHistRhoVSEmbBkg(0),
+  fHistDeltaPtEmbArea(0),
+  fHistDeltaPtEmbvsEP(0),
+  fHistRCPtExLJVSDPhiLJ(0),
+  fHistRCPtExPartialLJVSDPhiLJ(0),
+  fHistEmbJetsPhiEta(0),
+  fHistLeadPartPhiEta(0),
+  fCent_V0(0),
+  fVertex_z_cut(0),
+  fJetBG_rho(0),
+  fJetBG_rho_Cent(0),
+  fTrackPt_PbPb(0),
+  fTrackPhi_PbPb(0),
+  fTrackEta_PbPb(0),
+  fTrack_Phi_Eta_PbPb(0),
+  fTrackPt_MC(0),
+  fTrackPhi_MC(0),
+  fTrackEta_MC(0),
+  fTrack_Phi_Eta_MC(0),
+  fTrackPt_EMB(0),
+  fTrackPhi_EMB(0),
+  fTrackEta_EMB(0),
+  fTrack_Phi_Eta_EMB(0),
+  fJetPt_PbPb(),
+  fJetPhi_PbPb(),
+  fJetEta_PbPb(),
+  fJet_Phi_Eta_PbPb(),
+  fJetPt_BG_PbPb(),
+  fJet1Pt_PbPb(),
+  fJet2Pt_PbPb(),
+  fJet1Pt_BG_PbPb(),
+  fJet2Pt_BG_PbPb(),
+  fJetDeltaPhi_PbPb(),
+  fJetDeltaEta_PbPb(),
+  fJetDeltaEP_PbPb(),
+  fJet1SelectPt_BG_PbPb(),
+  fJet2SelectPt_BG_PbPb(),
+  fAj_PbPb(),
+  fJetPt_MC(),
+  fJetPhi_MC(),
+  fJetEta_MC(),
+  fJet_Phi_Eta_MC(),
+  fJet1Pt_MC(),
+  fJet2Pt_MC(),
+  fJetDeltaPhi_MC(),
+  fJetDeltaEta_MC(),
+  fJetDeltaEP_MC(),
+  fAj_MC(),
+  fJetPt_EMB(),
+  fJetPhi_EMB(),
+  fJetEta_EMB(),
+  fJet_Phi_Eta_EMB(),
+  fJetPt_BG_EMB(),
+  fJetDeltaPt(),
+  fJet1Pt_EMB(),
+  fJet2Pt_EMB(),
+  fJet1Pt_BG_EMB(),
+  fJet2Pt_BG_EMB(),
+  fJet1DeltaPt(),
+  fJet2DeltaPt(),
+  fJetDeltaPhi_EMB(),
+  fJetDeltaEta_EMB(),
+  fJetDeltaEP_EMB(),
+  fJet1SelectPt_BG_EMB(),
+  fJet2SelectPt_BG_EMB(),
+  fJet1SelectDeltaPt(),
+  fJet2SelectDeltaPt(),
+  fAj_EMB(),
+  fHJetDeltaPhi_Aj0_PbPb(),
+  fHJetDeltaPhi_Aj1_PbPb(),
+  fHJetDeltaPhi_Aj2_PbPb(),
+  fHJetDeltaPhi_Aj3_PbPb(),
+  fHJetDeltaPhi_Aj4_PbPb(),
+  fHJetPt_Aj0_PbPb(),
+  fHJetPt_Aj1_PbPb(),
+  fHJetPt_Aj2_PbPb(),
+  fHJetPt_Aj3_PbPb(),
+  fHJetPt_Aj4_PbPb(),
+  fHJetDeltaPhi_Aj0_MC(),
+  fHJetDeltaPhi_Aj1_MC(),
+  fHJetDeltaPhi_Aj2_MC(),
+  fHJetDeltaPhi_Aj3_MC(),
+  fHJetDeltaPhi_Aj4_MC(),
+  fHJetPt_Aj0_MC(),
+  fHJetPt_Aj1_MC(),
+  fHJetPt_Aj2_MC(),
+  fHJetPt_Aj3_MC(),
+  fHJetPt_Aj4_MC(),
+  fHJetDeltaPhi_Aj0_EMB(),
+  fHJetDeltaPhi_Aj1_EMB(),
+  fHJetDeltaPhi_Aj2_EMB(),
+  fHJetDeltaPhi_Aj3_EMB(),
+  fHJetDeltaPhi_Aj4_EMB(),
+  fHJetPt_Aj0_EMB(),
+  fHJetPt_Aj1_EMB(),
+  fHJetPt_Aj2_EMB(),
+  fHJetPt_Aj3_EMB(),
+  fHJetPt_Aj4_EMB(),
+  fHJetDeltaPhiasEP_Aj0_PbPb(),
+  fHJetDeltaPhiasEP_Aj1_PbPb(),
+  fHJetDeltaPhiasEP_Aj2_PbPb(),
+  fHJetDeltaPhiasEP_Aj3_PbPb(),
+  fHJetDeltaPhiasEP_Aj4_PbPb(),
+  fHJetPtasEP_Aj0_PbPb(),
+  fHJetPtasEP_Aj1_PbPb(),
+  fHJetPtasEP_Aj2_PbPb(),
+  fHJetPtasEP_Aj3_PbPb(),
+  fHJetPtasEP_Aj4_PbPb(),
+  fHJetDeltaPhiasEP_Aj0_MC(),
+  fHJetDeltaPhiasEP_Aj1_MC(),
+  fHJetDeltaPhiasEP_Aj2_MC(),
+  fHJetDeltaPhiasEP_Aj3_MC(),
+  fHJetDeltaPhiasEP_Aj4_MC(),
+  fHJetPtasEP_Aj0_MC(),
+  fHJetPtasEP_Aj1_MC(),
+  fHJetPtasEP_Aj2_MC(),
+  fHJetPtasEP_Aj3_MC(),
+  fHJetPtasEP_Aj4_MC(),
+  fHJetDeltaPhiasEP_Aj0_EMB(),
+  fHJetDeltaPhiasEP_Aj1_EMB(),
+  fHJetDeltaPhiasEP_Aj2_EMB(),
+  fHJetDeltaPhiasEP_Aj3_EMB(),
+  fHJetDeltaPhiasEP_Aj4_EMB(),
+  fHJetPtasEP_Aj0_EMB(),
+  fHJetPtasEP_Aj1_EMB(),
+  fHJetPtasEP_Aj2_EMB(),
+  fHJetPtasEP_Aj3_EMB(),
+  fHJetPtasEP_Aj4_EMB(),
+  fEvent(0),
+  fCentrality(0)
+{
+  // Standard constructor.
+
+  fHistRCPt = 0;
+  fHistRCPtExLJ = 0;
+  fHistRCPtExPartialLJ = 0;
+  //fHistRCPtRand = 0;
+  fHistRhoVSRCPt = 0;
+  fHistDeltaPtRCvsEP = 0;
+  fHistDeltaPtRCExLJ = 0;
+  fHistDeltaPtRCExPartialLJ = 0;
+  //fHistDeltaPtRCRand = 0;
+  fHistEmbJetsPtArea = 0;
+  fHistEmbJetsCorrPtArea = 0;
+  fHistEmbPartPtvsJetPt = 0;
+  fHistEmbPartPtvsJetCorrPt = 0;
+  fHistJetPtvsJetCorrPt = 0;
+  fHistDistLeadPart2JetAxis = 0;
+  fHistEmbBkgArea = 0;
+  fHistRhoVSEmbBkg = 0;
+  fHistDeltaPtEmbArea = 0;
+  fHistDeltaPtEmbvsEP = 0;
+  fCent_V0 = 0;
+  fVertex_z_cut = 0;
+  fJetBG_rho = 0;
+  fJetBG_rho_Cent = 0;
+  fTrackPt_PbPb = 0;
+  fTrackPhi_PbPb = 0;
+  fTrackEta_PbPb = 0;
+  fTrack_Phi_Eta_PbPb = 0;
+  fTrackPt_MC = 0;
+  fTrackPhi_MC = 0;
+  fTrackEta_MC = 0;
+  fTrack_Phi_Eta_MC = 0;
+  fTrackPt_EMB = 0;
+  fTrackPhi_EMB = 0;
+  fTrackEta_EMB = 0;
+  fTrack_Phi_Eta_EMB = 0;
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      fJetPt_PbPb[i][j] = 0;
+      fJetPhi_PbPb[i][j] = 0;
+      fJetEta_PbPb[i][j] = 0;
+      fJet_Phi_Eta_PbPb[i][j] = 0;
+      fJetPt_BG_PbPb[i][j] = 0;
+
+      fJetPt_MC[i][j] = 0;
+      fJetPhi_MC[i][j] = 0;
+      fJetEta_MC[i][j] = 0;
+      fJet_Phi_Eta_MC[i][j] = 0;
+
+      fJetPt_EMB[i][j] = 0;
+      fJetPhi_EMB[i][j] = 0;
+      fJetEta_EMB[i][j] = 0;
+      fJet_Phi_Eta_EMB[i][j] = 0;
+      fJetPt_BG_EMB[i][j] = 0;
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < k+1; l++) {
+         fJet1Pt_PbPb[i][j][k][l] = 0;
+         fJet2Pt_PbPb[i][j][k][l] = 0;
+         fJet1Pt_BG_PbPb[i][j][k][l] = 0;
+         fJet2Pt_BG_PbPb[i][j][k][l] = 0;
+         fJetDeltaPhi_PbPb[i][j][k][l] = 0;
+         fJetDeltaEta_PbPb[i][j][k][l] = 0;
+         fJetDeltaEP_PbPb[i][j][k][l] = 0;
+         fJet1SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fJet2SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fAj_PbPb[i][j][k][l] = 0;
+
+         fJet1Pt_MC[i][j][k][l] = 0;
+         fJet2Pt_MC[i][j][k][l] = 0;
+         fJetDeltaPhi_MC[i][j][k][l] = 0;
+         fJetDeltaEta_MC[i][j][k][l] = 0;
+         fJetDeltaEP_MC[i][j][k][l] = 0;
+         fAj_MC[i][j][k][l] = 0;
+
+         fJet1Pt_EMB[i][j][k][l] = 0;
+         fJet2Pt_EMB[i][j][k][l] = 0;
+         fJet1Pt_BG_EMB[i][j][k][l] = 0;
+         fJet2Pt_BG_EMB[i][j][k][l] = 0;
+         fJet1DeltaPt[i][j][k][l] = 0;
+         fJet2DeltaPt[i][j][k][l] = 0;
+         fJetDeltaPhi_EMB[i][j][k][l] = 0;
+         fJetDeltaEta_EMB[i][j][k][l] = 0;
+         fJetDeltaEP_EMB[i][j][k][l] = 0;
+         fJet1SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet2SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet1SelectDeltaPt[i][j][k][l] = 0;
+         fJet2SelectDeltaPt[i][j][k][l] = 0;
+         fAj_EMB[i][j][k][l] = 0;
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           fHJetDeltaPhi_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhi_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhi_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 4; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           fHJetDeltaPhiasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+  SetMakeGeneralHistograms(kTRUE);
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::AllocateHistogramArrays()
+{
+  fHistRCPt = new TH1*[fNcentBins];
+  fHistRCPtExLJ = new TH1*[fNcentBins];
+  fHistRCPtExPartialLJ = new TH1*[fNcentBins];
+  //fHistRCPtRand = new TH1*[fNcentBins];
+  fHistRhoVSRCPt = new TH2*[fNcentBins];
+  fHistDeltaPtRCvsEP = new TH2*[fNcentBins];
+  fHistDeltaPtRCExLJ = new TH1*[fNcentBins];
+  fHistDeltaPtRCExPartialLJ = new TH1*[fNcentBins];
+  //fHistDeltaPtRCRand = new TH1*[fNcentBins];
+  fHistEmbJetsPtArea = new TH3*[fNcentBins];
+  fHistEmbJetsCorrPtArea = new TH3*[fNcentBins];
+  fHistEmbPartPtvsJetPt = new TH2*[fNcentBins];
+  fHistEmbPartPtvsJetCorrPt = new TH2*[fNcentBins];
+  fHistJetPtvsJetCorrPt = new TH2*[fNcentBins];
+  fHistDistLeadPart2JetAxis = new TH1*[fNcentBins];
+  fHistEmbBkgArea = new TH2*[fNcentBins];
+  fHistRhoVSEmbBkg = new TH2*[fNcentBins];
+  fHistDeltaPtEmbArea = new TH2*[fNcentBins];
+  fHistDeltaPtEmbvsEP = new TH2*[fNcentBins];
+  fTrackPt_PbPb = new TH1*[fNcentBins];
+  fTrackPhi_PbPb = new TH1*[fNcentBins];
+  fTrackEta_PbPb = new TH1*[fNcentBins];
+  fTrack_Phi_Eta_PbPb = new TH2*[fNcentBins];
+  fTrackPt_MC = new TH1*[fNcentBins];
+  fTrackPhi_MC = new TH1*[fNcentBins];
+  fTrackEta_MC = new TH1*[fNcentBins];
+  fTrack_Phi_Eta_MC = new TH2*[fNcentBins];
+  fTrackPt_EMB = new TH1*[fNcentBins];
+  fTrackPhi_EMB = new TH1*[fNcentBins];
+  fTrackEta_EMB = new TH1*[fNcentBins];
+  fTrack_Phi_Eta_EMB = new TH2*[fNcentBins];
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    fHistRCPt[i] = 0;
+    fHistRCPtExLJ[i] = 0;
+    fHistRCPtExPartialLJ[i] = 0;
+    //fHistRCPtRand[i] = 0;
+    fHistRhoVSRCPt[i] = 0;
+    fHistDeltaPtRCvsEP[i] = 0;
+    fHistDeltaPtRCExLJ[i] = 0;
+    fHistDeltaPtRCExPartialLJ[i] = 0;
+    //fHistDeltaPtRCRand[i] = 0;
+    fHistEmbJetsPtArea[i] = 0;
+    fHistEmbJetsCorrPtArea[i] = 0;
+    fHistEmbPartPtvsJetPt[i] = 0;
+    fHistEmbPartPtvsJetCorrPt[i] = 0;
+    fHistJetPtvsJetCorrPt[i] = 0;
+    fHistDistLeadPart2JetAxis[i] = 0;
+    fHistEmbBkgArea[i] = 0;
+    fHistRhoVSEmbBkg[i] = 0;
+    fHistDeltaPtEmbArea[i] = 0;
+    fHistDeltaPtEmbvsEP[i] = 0;
+    fTrackPt_PbPb[i] = 0;
+    fTrackPhi_PbPb[i] = 0;
+    fTrackEta_PbPb[i] = 0;
+    fTrack_Phi_Eta_PbPb[i] = 0;
+    fTrackPt_MC[i] = 0;
+    fTrackPhi_MC[i] = 0;
+    fTrackEta_MC[i] = 0;
+    fTrack_Phi_Eta_MC[i] = 0;
+    fTrackPt_EMB[i] = 0;
+    fTrackPhi_EMB[i] = 0;
+    fTrackEta_EMB[i] = 0;
+    fTrack_Phi_Eta_EMB[i] = 0;
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      fJetPt_PbPb[i][j] = 0;
+      fJetPhi_PbPb[i][j] = 0;
+      fJetEta_PbPb[i][j] = 0;
+      fJet_Phi_Eta_PbPb[i][j] = 0;
+      fJetPt_BG_PbPb[i][j] = 0;
+
+      fJetPt_MC[i][j] = 0;
+      fJetPhi_MC[i][j] = 0;
+      fJetEta_MC[i][j] = 0;
+      fJet_Phi_Eta_MC[i][j] = 0;
+
+      fJetPt_EMB[i][j] = 0;
+      fJetPhi_EMB[i][j] = 0;
+      fJetEta_EMB[i][j] = 0;
+      fJet_Phi_Eta_EMB[i][j] = 0;
+      fJetPt_BG_EMB[i][j] = 0;
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < k+1; l++) {
+         fJet1Pt_PbPb[i][j][k][l] = 0;
+         fJet2Pt_PbPb[i][j][k][l] = 0;
+         fJet1Pt_BG_PbPb[i][j][k][l] = 0;
+         fJet2Pt_BG_PbPb[i][j][k][l] = 0;
+         fJetDeltaPhi_PbPb[i][j][k][l] = 0;
+         fJetDeltaEta_PbPb[i][j][k][l] = 0;
+         fJetDeltaEP_PbPb[i][j][k][l] = 0;
+         fJet1SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fJet2SelectPt_BG_PbPb[i][j][k][l] = 0;
+         fAj_PbPb[i][j][k][l] = 0;
+
+         fJet1Pt_MC[i][j][k][l] = 0;
+         fJet2Pt_MC[i][j][k][l] = 0;
+         fJetDeltaPhi_MC[i][j][k][l] = 0;
+         fJetDeltaEta_MC[i][j][k][l] = 0;
+         fJetDeltaEP_MC[i][j][k][l] = 0;
+         fAj_MC[i][j][k][l] = 0;
+
+         fJet1Pt_EMB[i][j][k][l] = 0;
+         fJet2Pt_EMB[i][j][k][l] = 0;
+         fJet1Pt_BG_EMB[i][j][k][l] = 0;
+         fJet2Pt_BG_EMB[i][j][k][l] = 0;
+         fJet1DeltaPt[i][j][k][l] = 0;
+         fJet2DeltaPt[i][j][k][l] = 0;
+         fJetDeltaPhi_EMB[i][j][k][l] = 0;
+         fJetDeltaEta_EMB[i][j][k][l] = 0;
+         fJetDeltaEP_EMB[i][j][k][l] = 0;
+         fJet1SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet2SelectPt_BG_EMB[i][j][k][l] = 0;
+         fJet1SelectDeltaPt[i][j][k][l] = 0;
+         fJet2SelectDeltaPt[i][j][k][l] = 0;
+         fAj_EMB[i][j][k][l] = 0;
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           fHJetDeltaPhi_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_PbPb[i][j][k][l][m] = 0;
+
+
+           fHJetDeltaPhi_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhi_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhi_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPt_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPt_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 4; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+
+           fHJetDeltaPhiasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_PbPb[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_PbPb[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_MC[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_MC[i][j][k][l][m] = 0;
+
+           fHJetDeltaPhiasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetDeltaPhiasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+           fHJetPtasEP_Aj0_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj1_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj2_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj3_EMB[i][j][k][l][m] = 0;
+           fHJetPtasEP_Aj4_EMB[i][j][k][l][m] = 0;
+
+         }
+       }
+      }
+    }
+  }
+
+
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::UserCreateOutputObjects()
+{
+  // Create user output.
+
+  AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
+
+  AllocateHistogramArrays();
+
+  fJetsCont = GetJetContainer("Jets");
+  fTracksCont = GetParticleContainer("Tracks");
+  fCaloClustersCont = GetClusterContainer("CaloClusters");
+  fMCJetsCont = GetJetContainer("MCJets");
+  fMCTracksCont = GetParticleContainer("MCTracks");
+  fMCCaloClustersCont = GetClusterContainer("MCCaloClusters");
+  fEmbJetsCont = GetJetContainer("EmbJets");
+  fEmbTracksCont = GetParticleContainer("EmbTracks");
+  fEmbCaloClustersCont = GetClusterContainer("EmbCaloClusters");
+  //fRandTracksCont = GetParticleContainer("RandTracks");
+  //fRandCaloClustersCont = GetClusterContainer("RandCaloClusters");
+
+  if (fTracksCont || fCaloClustersCont) {
+    fHistRCPhiEta = new TH2F("fHistRCPhiEta","fHistRCPhiEta", 100, -1, 1, 201, 0, TMath::Pi() * 2.01);
+    fHistRCPhiEta->GetXaxis()->SetTitle("#eta");
+    fHistRCPhiEta->GetYaxis()->SetTitle("#phi");
+    fOutput->Add(fHistRCPhiEta);
+
+    if (fJetsCont) {
+      fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinBinPt, fMaxBinPt, 128, -1.6, 4.8);
+      fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
+      fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi");
+      fOutput->Add(fHistRCPtExLJVSDPhiLJ);
+
+      fHistRCPtExPartialLJVSDPhiLJ = new TH2F("fHistRCPtExPartialLJVSDPhiLJ","fHistRCPtExPartialLJVSDPhiLJ", fNbins, fMinBinPt, fMaxBinPt, 128, -1.6, 4.8);
+      fHistRCPtExPartialLJVSDPhiLJ->GetXaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
+      fHistRCPtExPartialLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi");
+      fOutput->Add(fHistRCPtExPartialLJVSDPhiLJ);
+    }
+  }
+
+  if (fEmbJetsCont) {
+    fHistEmbJetsPhiEta = new TH2F("fHistEmbJetsPhiEta","fHistEmbJetsPhiEta", 100, -1, 1, 201, 0, TMath::Pi() * 2.01);
+    fHistEmbJetsPhiEta->GetXaxis()->SetTitle("#eta");
+    fHistEmbJetsPhiEta->GetYaxis()->SetTitle("#phi");
+    fOutput->Add(fHistEmbJetsPhiEta);
+    
+    fHistLeadPartPhiEta = new TH2F("fHistLeadPartPhiEta","fHistLeadPartPhiEta", 100, -1, 1, 201, 0, TMath::Pi() * 2.01);
+    fHistLeadPartPhiEta->GetXaxis()->SetTitle("#eta");
+    fHistLeadPartPhiEta->GetYaxis()->SetTitle("#phi");
+    fOutput->Add(fHistLeadPartPhiEta);
+  }
+
+  TString histname;
+
+  const Int_t nbinsZ = 12;
+  Double_t binsZ[nbinsZ+1] = {0,1,2,3,4,5,6,7,8,9,10,20,1000};
+
+  Double_t *binsPt       = GenerateFixedBinArray(fNbins, fMinBinPt, fMaxBinPt);
+  Double_t *binsCorrPt   = GenerateFixedBinArray(fNbins*2, -fMaxBinPt, fMaxBinPt);
+  Double_t *binsArea     = GenerateFixedBinArray(50, 0, 2);
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    if (fTracksCont || fCaloClustersCont) {
+      histname = "fHistRCPt_";
+      histname += i;
+      fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
+      fHistRCPt[i]->GetXaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
+      fHistRCPt[i]->GetYaxis()->SetTitle("counts");
+      fOutput->Add(fHistRCPt[i]);
+
+      histname = "fHistRhoVSRCPt_";
+      histname += i;
+      fHistRhoVSRCPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
+      fHistRhoVSRCPt[i]->GetXaxis()->SetTitle("A#rho (GeV/#it{c})");
+      fHistRhoVSRCPt[i]->GetYaxis()->SetTitle("#it{p}_{T} (GeV/#it{c})");
+      fOutput->Add(fHistRhoVSRCPt[i]);
+
+      histname = "fHistDeltaPtRCvsEP_";
+      histname += i;
+      fHistDeltaPtRCvsEP[i] = new TH2F(histname.Data(), histname.Data(), 101, 0, TMath::Pi()*1.01, fNbins * 2, -fMaxBinPt, fMaxBinPt);
+      fHistDeltaPtRCvsEP[i]->GetXaxis()->SetTitle("#phi_{RC} - #psi_{RP}");
+      fHistDeltaPtRCvsEP[i]->GetYaxis()->SetTitle("#delta#it{p}_{T}^{RC} (GeV/#it{c})");
+      fHistDeltaPtRCvsEP[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistDeltaPtRCvsEP[i]);
+      
+      if (fJetsCont) {
+       histname = "fHistRCPtExLJ_";
+       histname += i;
+       fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
+       fHistRCPtExLJ[i]->GetXaxis()->SetTitle("#it{p}_{T}^{RC} (GeV/#it{c})");
+       fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts");
+       fOutput->Add(fHistRCPtExLJ[i]);
+
+       histname = "fHistDeltaPtRCExLJ_";
+       histname += i;
+       fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
+       fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#delta#it{p}_{T}^{RC} (GeV/#it{c})");
+       fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts");
+       fOutput->Add(fHistDeltaPtRCExLJ[i]);
+
+        histname = "fHistRCPtExPartialLJ_";
+        histname += i;
+        fHistRCPtExPartialLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
+        fHistRCPtExPartialLJ[i]->GetXaxis()->SetTitle("#it{p}_{T}^{RC} (GeV/#it{c})");
+        fHistRCPtExPartialLJ[i]->GetYaxis()->SetTitle("counts");
+        fOutput->Add(fHistRCPtExPartialLJ[i]);
+
+        histname = "fHistDeltaPtRCExPartialLJ_";
+        histname += i;
+        fHistDeltaPtRCExPartialLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
+        fHistDeltaPtRCExPartialLJ[i]->GetXaxis()->SetTitle("#delta#it{p}_{T}^{RC} (GeV/#it{c})");
+        fHistDeltaPtRCExPartialLJ[i]->GetYaxis()->SetTitle("counts");
+        fOutput->Add(fHistDeltaPtRCExPartialLJ[i]);
+      }
+    }
+
+    /*if (fRandTracksCont || fRandCaloClustersCont) {
+      histname = "fHistRCPtRand_";
+      histname += i;
+      fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
+      fHistRCPtRand[i]->GetXaxis()->SetTitle("#it{p}_{T}^{RC} (GeV/#it{c})");
+      fHistRCPtRand[i]->GetYaxis()->SetTitle("counts");
+      fOutput->Add(fHistRCPtRand[i]);
+
+      histname = "fHistDeltaPtRCRand_";
+      histname += i;
+      fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
+      fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#delta#it{p}_{T}^{RC} (GeV/#it{c})");
+      fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts");
+      fOutput->Add(fHistDeltaPtRCRand[i]);
+      }*/
+
+    if (fEmbJetsCont) {
+      histname = "fHistEmbJetsPtArea_";
+      histname += i;
+      fHistEmbJetsPtArea[i] = new TH3F(histname.Data(), histname.Data(), 50, binsArea, fNbins, binsPt, nbinsZ, binsZ);
+      fHistEmbJetsPtArea[i]->GetXaxis()->SetTitle("area");
+      fHistEmbJetsPtArea[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb,raw} (GeV/#it{c})");
+      fOutput->Add(fHistEmbJetsPtArea[i]);
+
+      histname = "fHistEmbJetsCorrPtArea_";
+      histname += i;
+      fHistEmbJetsCorrPtArea[i] = new TH3F(histname.Data(), histname.Data(), 50, binsArea, fNbins * 2, binsCorrPt, nbinsZ, binsZ);
+      fHistEmbJetsCorrPtArea[i]->GetXaxis()->SetTitle("area");
+      fHistEmbJetsCorrPtArea[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb,corr} (GeV/#it{c})");
+      fOutput->Add(fHistEmbJetsCorrPtArea[i]);
+
+      histname = "fHistEmbPartPtvsJetPt_";
+      histname += i;
+      fHistEmbPartPtvsJetPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
+      fHistEmbPartPtvsJetPt[i]->GetXaxis()->SetTitle("#sum#it{p}_{T,const}^{emb} (GeV/#it{c})");
+      fHistEmbPartPtvsJetPt[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb} (GeV/#it{c})");
+      fHistEmbPartPtvsJetPt[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistEmbPartPtvsJetPt[i]);
+
+      histname = "fHistEmbPartPtvsJetCorrPt_";
+      histname += i;
+      fHistEmbPartPtvsJetCorrPt[i] = new TH2F(histname.Data(), histname.Data(), 
+                                             fNbins, fMinBinPt, fMaxBinPt, fNbins*2, -fMaxBinPt, fMaxBinPt);
+      fHistEmbPartPtvsJetCorrPt[i]->GetXaxis()->SetTitle("#sum#it{p}_{T,const}^{emb} (GeV/#it{c})");
+      fHistEmbPartPtvsJetCorrPt[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb} - A#rho (GeV/#it{c})");
+      fHistEmbPartPtvsJetCorrPt[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistEmbPartPtvsJetCorrPt[i]);
+
+      histname = "fHistJetPtvsJetCorrPt_";
+      histname += i;
+      fHistJetPtvsJetCorrPt[i] = new TH2F(histname.Data(), histname.Data(), 
+                                         fNbins, fMinBinPt, fMaxBinPt, fNbins*2, -fMaxBinPt, fMaxBinPt);
+      fHistJetPtvsJetCorrPt[i]->GetXaxis()->SetTitle("#it{p}_{T,jet}^{emb} (GeV/#it{c})");
+      fHistJetPtvsJetCorrPt[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb} - A#rho (GeV/#it{c})");
+      fHistJetPtvsJetCorrPt[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistJetPtvsJetCorrPt[i]);
+
+      histname = "fHistDistLeadPart2JetAxis_";
+      histname += i;
+      fHistDistLeadPart2JetAxis[i] = new TH1F(histname.Data(), histname.Data(), 50, 0, 0.5);
+      fHistDistLeadPart2JetAxis[i]->GetXaxis()->SetTitle("distance");
+      fHistDistLeadPart2JetAxis[i]->GetYaxis()->SetTitle("counts");
+      fOutput->Add(fHistDistLeadPart2JetAxis[i]);
+
+      histname = "fHistEmbBkgArea_";
+      histname += i;
+      fHistEmbBkgArea[i] = new TH2F(histname.Data(), histname.Data(), 50, 0, 2, fNbins, fMinBinPt, fMaxBinPt);
+      fHistEmbBkgArea[i]->GetXaxis()->SetTitle("area");
+      fHistEmbBkgArea[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb} - #sum#it{p}_{T,const}^{emb} (GeV/#it{c})");
+      fOutput->Add(fHistEmbBkgArea[i]);
+
+      histname = "fHistRhoVSEmbBkg_";
+      histname += i;
+      fHistRhoVSEmbBkg[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
+      fHistRhoVSEmbBkg[i]->GetXaxis()->SetTitle("A#rho (GeV/#it{c})");
+      fHistRhoVSEmbBkg[i]->GetYaxis()->SetTitle("#it{p}_{T,jet}^{emb} - #sum#it{p}_{T,const}^{emb} (GeV/#it{c})");
+      fOutput->Add(fHistRhoVSEmbBkg[i]);
+      
+      histname = "fHistDeltaPtEmbArea_";
+      histname += i;
+      fHistDeltaPtEmbArea[i] = new TH2F(histname.Data(), histname.Data(), 
+                                       50, 0, 2, fNbins * 2, -fMaxBinPt, fMaxBinPt);
+      fHistDeltaPtEmbArea[i]->GetXaxis()->SetTitle("area");
+      fHistDeltaPtEmbArea[i]->GetYaxis()->SetTitle("#delta#it{p}_{T}^{emb} (GeV/#it{c})");
+      fHistDeltaPtEmbArea[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistDeltaPtEmbArea[i]);
+
+      histname = "fHistDeltaPtEmbvsEP_";
+      histname += i;
+      fHistDeltaPtEmbvsEP[i] = new TH2F(histname.Data(), histname.Data(), 101, 0, TMath::Pi()*1.01, fNbins * 2, -fMaxBinPt, fMaxBinPt);
+      fHistDeltaPtEmbvsEP[i]->GetXaxis()->SetTitle("#phi_{jet} - #Psi_{EP}");
+      fHistDeltaPtEmbvsEP[i]->GetYaxis()->SetTitle("#delta#it{p}_{T}^{emb} (GeV/#it{c})");
+      fHistDeltaPtEmbvsEP[i]->GetZaxis()->SetTitle("counts");
+      fOutput->Add(fHistDeltaPtEmbvsEP[i]);
+    }
+  }
+
+  //User Task
+  fCent_V0  = new TH1F("fCent_V0", "Centrality (all) by V0M", 103,-2,101);
+  fOutput->Add(fCent_V0);
+  fVertex_z_cut = new TH1F("fVertex_z_cut", "SPD vertex z (cut)", 120,-30,30);
+  fOutput->Add(fVertex_z_cut);
+  fJetBG_rho = new TH1F("fJetBG_rho","fJetBG_rho",300,0,300);
+  fOutput->Add(fJetBG_rho);
+  fJetBG_rho_Cent = new TH2F("fJetBG_rho_Cent","fJetBG_rho_Cent",100,0,100,300,0,300);
+  fOutput->Add(fJetBG_rho_Cent);
+  //fhPtHardBins = new TH1F("fhPtHardBins","Number of events in each pT hard bin",11,0,11);
+  //fOutput->Add(fhPtHardBins);
+
+  // Track histograms...
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    //PbPb
+    fTrackPt_PbPb[i]     = new TH1F(Form("fTrackPt_PbPb[%d]",i),Form("fTrackPt_PbPb[%d]",i),100,-80,120);
+    fOutput->Add(fTrackPt_PbPb[i]);
+    fTrackPhi_PbPb[i]     = new TH1F(Form("fTrackPhi_PbPb[%d]",i),Form("fTrackPhi_PbPb[%d]",i),40,0.0,2.*pi);
+    fOutput->Add(fTrackPhi_PbPb[i]);
+    fTrackEta_PbPb[i]     = new TH1F(Form("fTrackEta_PbPb[%d]",i),Form("fTrackEta_PbPb[%d]",i),40,-1.,1.);
+    fOutput->Add(fTrackEta_PbPb[i]);
+    fTrack_Phi_Eta_PbPb[i]     = new TH2F(Form("fTrack_Phi_Eta_PbPb[%d]",i),Form("fTrack_Phi_Eta_PbPb[%d]",i),40,0.0,2.*pi,40,-1.,1.);
+    fOutput->Add(fTrack_Phi_Eta_PbPb[i]);
+
+    //MC
+    fTrackPt_MC[i]     = new TH1F(Form("fTrackPt_MC[%d]",i),Form("fTrackPt_MC[%d]",i),100,-80,120);
+    fOutput->Add(fTrackPt_MC[i]);
+    fTrackPhi_MC[i]     = new TH1F(Form("fTrackPhi_MC[%d]",i),Form("fTrackPhi_MC[%d]",i),40,0.0,2.*pi);
+    fOutput->Add(fTrackPhi_MC[i]);
+    fTrackEta_MC[i]     = new TH1F(Form("fTrackEta_MC[%d]",i),Form("fTrackEta_MC[%d]",i),40,-1.,1.);
+    fOutput->Add(fTrackEta_MC[i]);
+    fTrack_Phi_Eta_MC[i]     = new TH2F(Form("fTrack_Phi_Eta_MC[%d]",i),Form("fTrack_Phi_Eta_MC[%d]",i),40,0.0,2.*pi,40,-1.,1.);
+    fOutput->Add(fTrack_Phi_Eta_MC[i]);
+
+    //EMB
+    fTrackPt_EMB[i]     = new TH1F(Form("fTrackPt_EMB[%d]",i),Form("fTrackPt_EMB[%d]",i),100,-80,120);
+    fOutput->Add(fTrackPt_EMB[i]);
+    fTrackPhi_EMB[i]     = new TH1F(Form("fTrackPhi_EMB[%d]",i),Form("fTrackPhi_EMB[%d]",i),40,0.0,2.*pi);
+    fOutput->Add(fTrackPhi_EMB[i]);
+    fTrackEta_EMB[i]     = new TH1F(Form("fTrackEta_EMB[%d]",i),Form("fTrackEta_EMB[%d]",i),40,-1.,1.);
+    fOutput->Add(fTrackEta_EMB[i]);
+    fTrack_Phi_Eta_EMB[i]     = new TH2F(Form("fTrack_Phi_Eta_EMB[%d]",i),Form("fTrack_Phi_Eta_EMB[%d]",i),40,0.0,2.*pi,40,-1.,1.);
+    fOutput->Add(fTrack_Phi_Eta_EMB[i]);
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      //Jet Histgrams...
+      //PbPb
+      fJetPt_PbPb[i][j] = new TH1F(Form("fJetPt_PbPb[%d][%d]",i,j),Form("fJetPt_PbPb[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetPt_PbPb[i][j]);
+      fJetPhi_PbPb[i][j] = new TH1F(Form("fJetPhi_PbPb[%d][%d]",i,j),Form("fJetPhi_PbPb[%d][%d]",i,j),40,0.0, 2*pi);
+      fOutput->Add(fJetPhi_PbPb[i][j]);
+      fJetEta_PbPb[i][j] = new TH1F(Form("fJetEta_PbPb[%d][%d]",i,j),Form("fJetEta_PbPb[%d][%d]",i,j),40,-1.,1.);
+      fOutput->Add(fJetEta_PbPb[i][j]);
+      fJet_Phi_Eta_PbPb[i][j] = new TH2F(Form("fJet_Phi_Eta_PbPb[%d][%d]",i,j),Form("fJet_Phi_Eta_PbPb[%d][%d]",i,j),40,0.0, 2*pi,40,-1.,1.);
+      fOutput->Add(fJet_Phi_Eta_PbPb[i][j]);
+      fJetPt_BG_PbPb[i][j] = new TH1F(Form("fJetPt_BG_PbPb[%d][%d]",i,j),Form("fJetPt_BG_PbPb[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetPt_BG_PbPb[i][j]);
+
+      //MC
+      fJetPt_MC[i][j] = new TH1F(Form("fJetPt_MC[%d][%d]",i,j),Form("fJetPt_MC[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetPt_MC[i][j]);
+      fJetPhi_MC[i][j] = new TH1F(Form("fJetPhi_MC[%d][%d]",i,j),Form("fJetPhi_MC[%d][%d]",i,j),40,0.0, 2*pi);
+      fOutput->Add(fJetPhi_MC[i][j]);
+      fJetEta_MC[i][j] = new TH1F(Form("fJetEta_MC[%d][%d]",i,j),Form("fJetEta_MC[%d][%d]",i,j),40,-1.,1.);
+      fOutput->Add(fJetEta_MC[i][j]);
+      fJet_Phi_Eta_MC[i][j] = new TH2F(Form("fJet_Phi_Eta_MC[%d][%d]",i,j),Form("fJet_Phi_Eta_MC[%d][%d]",i,j),40,0.0, 2*pi,40,-1.,1.);
+      fOutput->Add(fJet_Phi_Eta_MC[i][j]);
+
+      //EMB
+      fJetPt_EMB[i][j] = new TH1F(Form("fJetPt_EMB[%d][%d]",i,j),Form("fJetPt_EMB[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetPt_EMB[i][j]);
+      fJetPhi_EMB[i][j] = new TH1F(Form("fJetPhi_EMB[%d][%d]",i,j),Form("fJetPhi_EMB[%d][%d]",i,j),40,0.0, 2*pi);
+      fOutput->Add(fJetPhi_EMB[i][j]);
+      fJetEta_EMB[i][j] = new TH1F(Form("fJetEta_EMB[%d][%d]",i,j),Form("fJetEta_EMB[%d][%d]",i,j),40,-1.,1.);
+      fOutput->Add(fJetEta_EMB[i][j]);
+      fJet_Phi_Eta_EMB[i][j] = new TH2F(Form("fJet_Phi_Eta_EMB[%d][%d]",i,j),Form("fJet_Phi_Eta_EMB[%d][%d]",i,j),40,0.0, 2*pi,40,-1.,1.);
+      fOutput->Add(fJet_Phi_Eta_EMB[i][j]);
+      fJetPt_BG_EMB[i][j] = new TH1F(Form("fJetPt_BG_EMB[%d][%d]",i,j),Form("fJetPt_BG_EMB[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetPt_BG_EMB[i][j]);
+      fJetDeltaPt[i][j] = new TH1F(Form("fJetDeltaPt[%d][%d]",i,j),Form("fJetDeltaPt[%d][%d]",i,j),100,-80,120);
+      fOutput->Add(fJetDeltaPt[i][j]);
+
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < k+1; l++) {
+         // Jet Histgrams...
+         //PbPb
+         fJet1Pt_PbPb[i][j][k][l] = new TH1F(Form("fJet1Pt_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet1Pt_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1Pt_PbPb[i][j][k][l]);
+         fJet2Pt_PbPb[i][j][k][l] = new TH1F(Form("fJet2Pt_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet2Pt_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2Pt_PbPb[i][j][k][l]);
+         fJet1Pt_BG_PbPb[i][j][k][l] = new TH1F(Form("fJet1Pt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet1Pt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1Pt_BG_PbPb[i][j][k][l]);
+         fJet2Pt_BG_PbPb[i][j][k][l] = new TH1F(Form("fJet2Pt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet2Pt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2Pt_BG_PbPb[i][j][k][l]);
+         fJetDeltaPhi_PbPb[i][j][k][l] = new TH1F(Form("fJetDeltaPhi_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaPhi_PbPb[%d][%d][%d][%d]",i,j,k,l),40,-1./2.*pi,3./2.*pi);
+         fOutput->Add(fJetDeltaPhi_PbPb[i][j][k][l]);
+         fJetDeltaEta_PbPb[i][j][k][l] = new TH1F(Form("fJetDeltaEta_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEta_PbPb[%d][%d][%d][%d]",i,j,k,l),40,-1.0,1.0);
+         fOutput->Add(fJetDeltaEta_PbPb[i][j][k][l]);
+         fJetDeltaEP_PbPb[i][j][k][l] = new TH1F(Form("fJetDeltaEP_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEP_PbPb[%d][%d][%d][%d]",i,j,k,l),40,0.,pi);
+         fOutput->Add(fJetDeltaEP_PbPb[i][j][k][l]);
+         fJet1SelectPt_BG_PbPb[i][j][k][l] = new TH1F(Form("fJet1SelectPt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet1SelectPt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1SelectPt_BG_PbPb[i][j][k][l]);
+         fJet2SelectPt_BG_PbPb[i][j][k][l] = new TH1F(Form("fJet2SelectPt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fJet2SelectPt_BG_PbPb[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2SelectPt_BG_PbPb[i][j][k][l]);
+         fAj_PbPb[i][j][k][l] = new TH1F(Form("fAj_PbPb[%d][%d][%d][%d]",i,j,k,l),Form("fAj_PbPb[%d][%d][%d][%d]",i,j,k,l),20,0.,1.);
+         fOutput->Add(fAj_PbPb[i][j][k][l]);
+
+         //MC
+         fJet1Pt_MC[i][j][k][l] = new TH1F(Form("fJet1Pt_MC[%d][%d][%d][%d]",i,j,k,l),Form("fJet1Pt_MC[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1Pt_MC[i][j][k][l]);
+         fJet2Pt_MC[i][j][k][l] = new TH1F(Form("fJet2Pt_MC[%d][%d][%d][%d]",i,j,k,l),Form("fJet2Pt_MC[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2Pt_MC[i][j][k][l]);
+         fJetDeltaPhi_MC[i][j][k][l] = new TH1F(Form("fJetDeltaPhi_MC[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaPhi_MC[%d][%d][%d][%d]",i,j,k,l),40,-1./2.*pi,3./2.*pi);
+         fOutput->Add(fJetDeltaPhi_MC[i][j][k][l]);
+         fJetDeltaEta_MC[i][j][k][l] = new TH1F(Form("fJetDeltaEta_MC[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEta_MC[%d][%d][%d][%d]",i,j,k,l),40,-1.0,1.0);
+         fOutput->Add(fJetDeltaEta_MC[i][j][k][l]);
+         fJetDeltaEP_MC[i][j][k][l] = new TH1F(Form("fJetDeltaEP_MC[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEP_MC[%d][%d][%d][%d]",i,j,k,l),40,0.,pi);
+         fOutput->Add(fJetDeltaEP_MC[i][j][k][l]);
+         fAj_MC[i][j][k][l] = new TH1F(Form("fAj_MC[%d][%d][%d][%d]",i,j,k,l),Form("fAj_MC[%d][%d][%d][%d]",i,j,k,l),20,0.,1.);
+         fOutput->Add(fAj_MC[i][j][k][l]);
+
+         //EMB
+         fJet1Pt_EMB[i][j][k][l] = new TH1F(Form("fJet1Pt_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet1Pt_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1Pt_EMB[i][j][k][l]);
+         fJet2Pt_EMB[i][j][k][l] = new TH1F(Form("fJet2Pt_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet2Pt_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2Pt_EMB[i][j][k][l]);
+         fJet1Pt_BG_EMB[i][j][k][l] = new TH1F(Form("fJet1Pt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet1Pt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1Pt_BG_EMB[i][j][k][l]);
+         fJet2Pt_BG_EMB[i][j][k][l] = new TH1F(Form("fJet2Pt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet2Pt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2Pt_BG_EMB[i][j][k][l]);
+         fJet1DeltaPt[i][j][k][l] = new TH1F(Form("fJet1DeltaPt[%d][%d][%d][%d]",i,j,k,l),Form("fJet1DeltaPt[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1DeltaPt[i][j][k][l]);
+         fJet2DeltaPt[i][j][k][l] = new TH1F(Form("fJet2DeltaPt[%d][%d][%d][%d]",i,j,k,l),Form("fJet2DeltaPt[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2DeltaPt[i][j][k][l]);
+         fJetDeltaPhi_EMB[i][j][k][l] = new TH1F(Form("fJetDeltaPhi_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaPhi_EMB[%d][%d][%d][%d]",i,j,k,l),40,-1./2.*pi,3./2.*pi);
+         fOutput->Add(fJetDeltaPhi_EMB[i][j][k][l]);
+         fJetDeltaEta_EMB[i][j][k][l] = new TH1F(Form("fJetDeltaEta_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEta_EMB[%d][%d][%d][%d]",i,j,k,l),40,-1.0,1.0);
+         fOutput->Add(fJetDeltaEta_EMB[i][j][k][l]);
+         fJetDeltaEP_EMB[i][j][k][l] = new TH1F(Form("fJetDeltaEP_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJetDeltaEP_EMB[%d][%d][%d][%d]",i,j,k,l),40,0.,pi);
+         fOutput->Add(fJetDeltaEP_EMB[i][j][k][l]);
+         fJet1SelectPt_BG_EMB[i][j][k][l] = new TH1F(Form("fJet1SelectPt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet1SelectPt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1SelectPt_BG_EMB[i][j][k][l]);
+         fJet2SelectPt_BG_EMB[i][j][k][l] = new TH1F(Form("fJet2SelectPt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fJet2SelectPt_BG_EMB[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2SelectPt_BG_EMB[i][j][k][l]);
+         fJet1SelectDeltaPt[i][j][k][l] = new TH1F(Form("fJet1SelectDeltaPt[%d][%d][%d][%d]",i,j,k,l),Form("fJet1SelectDeltaPt[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet1SelectDeltaPt[i][j][k][l]);
+         fJet2SelectDeltaPt[i][j][k][l] = new TH1F(Form("fJet2SelectDeltaPt[%d][%d][%d][%d]",i,j,k,l),Form("fJet2SelectDeltaPt[%d][%d][%d][%d]",i,j,k,l),100,-80,120);
+         fOutput->Add(fJet2SelectDeltaPt[i][j][k][l]);
+         fAj_EMB[i][j][k][l] = new TH1F(Form("fAj_EMB[%d][%d][%d][%d]",i,j,k,l),Form("fAj_EMB[%d][%d][%d][%d]",i,j,k,l),20,0.,1.);
+         fOutput->Add(fAj_EMB[i][j][k][l]);
+
+
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 3; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           // Jet-Hadron Histgrams...
+           //PbPb
+           fHJetDeltaPhi_Aj0_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj0_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj1_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj1_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj2_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj2_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj3_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj3_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj4_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj4_PbPb[i][j][k][l][m]);
+
+           fHJetPt_Aj0_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj0_PbPb[i][j][k][l][m]);
+           fHJetPt_Aj1_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj1_PbPb[i][j][k][l][m]);
+           fHJetPt_Aj2_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj2_PbPb[i][j][k][l][m]);
+           fHJetPt_Aj3_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj3_PbPb[i][j][k][l][m]);
+           fHJetPt_Aj4_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj4_PbPb[i][j][k][l][m]);
+
+           //MC
+           fHJetDeltaPhi_Aj0_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj0_MC[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj1_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj1_MC[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj2_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj2_MC[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj3_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj3_MC[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj4_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj4_MC[i][j][k][l][m]);
+
+           fHJetPt_Aj0_MC[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj0_MC[i][j][k][l][m]);
+           fHJetPt_Aj1_MC[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj1_MC[i][j][k][l][m]);
+           fHJetPt_Aj2_MC[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj2_MC[i][j][k][l][m]);
+           fHJetPt_Aj3_MC[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj3_MC[i][j][k][l][m]);
+           fHJetPt_Aj4_MC[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj4_MC[i][j][k][l][m]);
+
+           //EMB
+           fHJetDeltaPhi_Aj0_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj0_EMB[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj1_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj1_EMB[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj2_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj2_EMB[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj3_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj3_EMB[i][j][k][l][m]);
+           fHJetDeltaPhi_Aj4_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhi_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhi_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhi_Aj4_EMB[i][j][k][l][m]);
+
+           fHJetPt_Aj0_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj0_EMB[i][j][k][l][m]);
+           fHJetPt_Aj1_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj1_EMB[i][j][k][l][m]);
+           fHJetPt_Aj2_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj2_EMB[i][j][k][l][m]);
+           fHJetPt_Aj3_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj3_EMB[i][j][k][l][m]);
+           fHJetPt_Aj4_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPt_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPt_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPt_Aj4_EMB[i][j][k][l][m]);
+
+
+         }
+       }
+      }
+    }
+  }
+
+  for (Int_t i = 0; i < fNcentBins; i++) {
+    for (Int_t j = 0; j < 4; j++) {
+      for (Int_t k = 0; k < 4; k++) {
+       for (Int_t l = 0; l < 4; l++) {
+         for (Int_t m = 0; m < l+1; m++) {
+           // Jet-Hadron as EP Histgrams...
+           //PbPb
+           fHJetDeltaPhiasEP_Aj0_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj0_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj1_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj1_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj2_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj2_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj3_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj3_PbPb[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj4_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj4_PbPb[i][j][k][l][m]);
+
+           fHJetPtasEP_Aj0_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj0_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj0_PbPb[i][j][k][l][m]);
+           fHJetPtasEP_Aj1_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj1_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj1_PbPb[i][j][k][l][m]);
+           fHJetPtasEP_Aj2_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj2_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj2_PbPb[i][j][k][l][m]);
+           fHJetPtasEP_Aj3_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj3_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj3_PbPb[i][j][k][l][m]);
+           fHJetPtasEP_Aj4_PbPb[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj4_PbPb[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj4_PbPb[i][j][k][l][m]);
+
+           //MC
+           fHJetDeltaPhiasEP_Aj0_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj0_MC[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj1_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj1_MC[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj2_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj2_MC[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj3_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj3_MC[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj4_MC[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj4_MC[i][j][k][l][m]);
+
+           fHJetPtasEP_Aj0_MC[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj0_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj0_MC[i][j][k][l][m]);
+           fHJetPtasEP_Aj1_MC[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj1_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj1_MC[i][j][k][l][m]);
+           fHJetPtasEP_Aj2_MC[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj2_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj2_MC[i][j][k][l][m]);
+           fHJetPtasEP_Aj3_MC[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj3_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj3_MC[i][j][k][l][m]);
+           fHJetPtasEP_Aj4_MC[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj4_MC[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj4_MC[i][j][k][l][m]);
+
+           //EMB
+           fHJetDeltaPhiasEP_Aj0_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj0_EMB[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj1_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj1_EMB[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj2_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj2_EMB[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj3_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj3_EMB[i][j][k][l][m]);
+           fHJetDeltaPhiasEP_Aj4_EMB[i][j][k][l][m] = new TH1F(Form("fHJetDeltaPhiasEP_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetDeltaPhiasEP_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),40,-1./2.*pi,3./2.*pi);
+           fOutput->Add(fHJetDeltaPhiasEP_Aj4_EMB[i][j][k][l][m]);
+
+           fHJetPtasEP_Aj0_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj0_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj0_EMB[i][j][k][l][m]);
+           fHJetPtasEP_Aj1_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj1_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj1_EMB[i][j][k][l][m]);
+           fHJetPtasEP_Aj2_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj2_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj2_EMB[i][j][k][l][m]);
+           fHJetPtasEP_Aj3_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj3_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj3_EMB[i][j][k][l][m]);
+           fHJetPtasEP_Aj4_EMB[i][j][k][l][m] = new TH1F(Form("fHJetPtasEP_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),Form("fHJetPtasEP_Aj4_EMB[%d][%d][%d][%d][%d]",i,j,k,l,m),360,0,120);
+           fOutput->Add(fHJetPtasEP_Aj4_EMB[i][j][k][l][m]);
+         }
+       }
+      }
+    }
+  }
+
+
+  delete[] binsPt;
+  delete[] binsCorrPt;
+  delete[] binsArea;
+
+  PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
+}
+
+//________________________________________________________________________
+Bool_t AliAnalysisTaskDijetHadron::FillHistograms()
+{
+  // Fill histograms.
+  // Avoid TPCHole(lhc11h)
+  Int_t runNumber = InputEvent()->GetRunNumber();
+  Int_t fAvoidTpcHole = 0;
+  Int_t runs_iroc[28] = {169975, 169981, 170038, 170040, 170083, 170084, 170085, 170088, 170089, 170091, 170152, 170155, 170159, 170163, 170193, 170195, 170203, 170204, 170205, 170228, 170230, 170264, 170268, 170269, 170270, 170306, 170308, 170309};
+  for(Int_t i=0; i<28; i++)
+    {
+      if(runNumber==runs_iroc[i])
+       {
+         fAvoidTpcHole = 1;
+         break;
+       }
+    }
+
+  //if(fAvoidTpcHole==1 && !(trigPhi>3.89 && trigPhi<5.53)) trigIndex = -1;
+
+  //Get Event
+  fEvent = InputEvent();
+  if(fEvent){
+
+    /*if(!fPtHardBinName)
+      {
+      // Get embedded pt hard bin number
+      fPtHardBinName = static_cast<AliNamedString*>(fEvent->FindListObject("AODEmbeddingFile"));
+      if(!fPtHardBinName) cout << "no embedding file!" << endl;
+      }
+
+      TString fileName = fPtHardBinName->GetString();
+      fileName.Remove(0,50);
+      fileName.Remove(fileName.Index("/"));
+      fPtHardBin = fileName.Atoi();
+      fhPtHardBins->Fill(fPtHardBin);*/
+
+    //trigger
+    Int_t fTriggerType =-1;
+    UInt_t trigger = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
+
+    if (trigger & AliVEvent::kAnyINT)      { fTriggerType=0; }
+    else if (trigger & AliVEvent::kCentral)     { fTriggerType=0; }
+    else if (trigger & AliVEvent::kSemiCentral) { fTriggerType=0; }
+    else if (trigger & AliVEvent::kEMCEGA)      { fTriggerType=1; }
+    else if (trigger & AliVEvent::kEMCEJE)      { fTriggerType=2; }
+
+    // Vertex cut 
+    const AliVVertex* vtx = fEvent->GetPrimaryVertex();
+
+    if(fTriggerType==0){
+      if (vtx && vtx->GetNContributors()>1.){
+       if (TMath::Abs(vtx->GetZ())<10.){
+         fVertex_z_cut->Fill(vtx->GetZ());
+
+         // GetCentrality
+         AliCentrality *centrality = fEvent->GetCentrality();
+         if (centrality)
+           fCentrality = centrality->GetCentralityPercentile("V0M");
+         else 
+           fCentrality = 99;
+         fCent_V0->Fill(fCentrality);
+
+         // Get Rho value
+         fJetBG_rho->Fill(fRhoVal);
+         fJetBG_rho_Cent->Fill(fCentrality,fRhoVal);
+
+         // Prepare Jet value
+         //PbPb
+         // jet counting value
+         Int_t c_jet1_PbPb[3] ={0,0,0}; Int_t c_jet2_PbPb[3] ={0,0,0};
+         Int_t leading_jet_count0[3]={0,0,0}; Int_t subleading_jet_count0[3]={0,0,0};
+         // Jet1: Leading jet
+         Double_t jet1_pt0[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_pt_BG0[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet1_phi0[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_eta0[4]  ={-999.,-999.,-999.,-999.};
+         Double_t dEPJet0[4]  ={-999.,-999.,-999.,-999.};
+         // Jet2: Sub Leading jet
+         Double_t jet2_pt0[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_pt_BG0[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet2_phi0[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_eta0[4]  ={-999.,-999.,-999.,-999.};
+         // Correlation of jet1 and jet2
+         Double_t Delta_phi0[4]  ={-999.,-999.,-999.,-999.}; Double_t Delta_eta0[4]  ={-999.,-999.,-999.,-999.}; Double_t Aj0[4]  ={-999.,-999.,-999.,-999.};
+         //MC
+         // jet counting value
+         Int_t c_jet1_MC[3] ={0,0,0}; Int_t c_jet2_MC[3] ={0,0,0};
+         Int_t leading_jet_count1[3]={0,0,0}; Int_t subleading_jet_count1[3]={0,0,0};
+         // Jet1: Leading jet
+         Double_t jet1_pt1[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet1_phi1[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_eta1[4]  ={-999.,-999.,-999.,-999.};
+         Double_t dEPJet1[4]  ={-999.,-999.,-999.,-999.};
+         // Jet2: Sub Leading jet
+         Double_t jet2_pt1[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet2_phi1[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_eta1[4]  ={-999.,-999.,-999.,-999.};
+         // Correlation of jet1 and jet2
+         Double_t Delta_phi1[4]  ={-999.,-999.,-999.,-999.}; Double_t Delta_eta1[4]  ={-999.,-999.,-999.,-999.}; Double_t Aj1[4]  ={-999.,-999.,-999.,-999.};
+         //EMB
+         // jet counting value
+         Int_t c_jet1_EMB[3] ={0,0,0}; Int_t c_jet2_EMB[3] ={0,0,0};
+         Int_t leading_jet_count2[3]={0,0,0}; Int_t subleading_jet_count2[3]={0,0,0};
+         // Jet1: Leading jet
+         Double_t jet1_pt2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_pt_BG2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_Deltapt[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet1_phi2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet1_eta2[4]  ={-999.,-999.,-999.,-999.};
+         Double_t dEPJet2[4]  ={-999.,-999.,-999.,-999.};
+         // Jet2: Sub Leading jet
+         Double_t jet2_pt2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_pt_BG2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_Deltapt[4]  ={-999.,-999.,-999.,-999.};
+         Double_t jet2_phi2[4]  ={-999.,-999.,-999.,-999.}; Double_t jet2_eta2[4]  ={-999.,-999.,-999.,-999.};
+         // Correlation of jet1 and jet2
+         Double_t Delta_phi2[4]  ={-999.,-999.,-999.,-999.}; Double_t Delta_eta2[4]  ={-999.,-999.,-999.,-999.}; Double_t Aj2[4]  ={-999.,-999.,-999.,-999.};
+
+
+         //threshold
+         double Jet1_threshold[5]; double Jet2_threshold[5];
+         Jet1_threshold[0]=0.0; Jet2_threshold[0]=0.0;
+         for(Int_t k=1;k<5;k++){
+           int dummy = k - 1;
+           Jet1_threshold[k]=Jet1_threshold[dummy]+10.0;       
+           Jet2_threshold[k]=Jet2_threshold[dummy]+10.0;       
+         }
+
+         //Jet check
+         //Double_t jet_track[6][2][200];
+         //for(Int_t m=0;m<6;m++){
+         //for(Int_t i=0;i<2;i++){
+         //for(Int_t j=0;j<200;j++){
+         //jet_track[m][i][j]=-999.0;
+         //}
+         //}
+         //}
+
+         //PbPb
+         //Track histogram
+         if (fTracksCont) {
+           AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle(0)); 
+           while(track) {
+             if(track->GetLabel()==0){
+               fTrackPt_PbPb[fCentBin]->Fill(track->Pt()); 
+               fTrackPhi_PbPb[fCentBin]->Fill(track->Phi()); 
+               fTrackEta_PbPb[fCentBin]->Fill(track->Eta()); 
+               fTrack_Phi_Eta_PbPb[fCentBin]->Fill(track->Phi(),track->Eta());
+             }
+             track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
+           }
+         }
+
+         // Jet and Jet-HadronHistgram
+         if (fJetsCont) {
+           AliEmcalJet *Jet = fJetsCont->GetNextAcceptJet(0);
+           while(Jet) {
+
+             if ((Jet->Eta() >  0.7) ||
+                 (Jet->Eta() < -0.7) ||
+                 (Jet->Phi() >  2*TMath::Pi()) ||
+                 (Jet->Phi() <  0.0)) continue; // acceptance eta range and etmin
+
+             //leading track cut
+             Int_t leading_track_count[3]={0,0,0};
+             //Int_t leading_track_limit=0;
+             if(fJetsCont->GetLeadingHadronPt(Jet) > 0.) leading_track_count[0] += 1;
+             if(fJetsCont->GetLeadingHadronPt(Jet) > 5.) leading_track_count[1] += 1;
+             if(fJetsCont->GetLeadingHadronPt(Jet) > 10.) leading_track_count[2] += 1;
+             //if(fJetsCont->GetLeadingHadronPt(Jet) > 100.) leading_track_limit += 1;
+             //if(leading_track_limit > 0) continue;
+
+             for(int m=0;m<3;m++){
+               c_jet1_PbPb[m]++; // jet count in acceptance.
+               if(leading_track_count[m] > 0){
+                 fJetPt_PbPb[fCentBin][m]->Fill(Jet->Pt());
+                 fJetPhi_PbPb[fCentBin][m]->Fill(Jet->Phi());
+                 fJetEta_PbPb[fCentBin][m]->Fill(Jet->Eta());
+                 fJet_Phi_Eta_PbPb[fCentBin][m]->Fill(Jet->Phi(),Jet->Eta());
+                 fJetPt_BG_PbPb[fCentBin][m]->Fill(Jet->Pt() - Jet->Area() * fRhoVal);
+               }
+             }
+
+             for(int m=0;m<3;m++){
+               if(c_jet1_PbPb[m] == 1)
+                 {
+                   if(leading_track_count[m] > 0){
+                     jet1_pt0[m] = Jet->Pt(); jet1_pt_BG0[m] = Jet->Pt() - Jet->Area() * fRhoVal; jet1_phi0[m] = Jet->Phi(); jet1_eta0[m] = Jet->Eta(); //Get Leading Jet(Jet1) value
+
+                     dEPJet0[m] = jet1_phi0[m] - fEPV0;
+                     while (dEPJet0[m] < 0) dEPJet0[m] += TMath::Pi();
+                     while (dEPJet0[m] >= TMath::Pi()) dEPJet0[m] -= TMath::Pi();
+
+                     leading_jet_count0[m] += 1;
+                   }
+                 }
+
+               else if(c_jet1_PbPb[m] > 1 && c_jet2_PbPb[m] == 0  && leading_jet_count0[m] > 0 && leading_track_count[m] > 0)// sub leading
+                 {
+                   jet2_pt0[m] = Jet->Pt(); jet2_pt_BG0[m] = Jet->Pt() - Jet->Area() * fRhoVal; jet2_phi0[m] = Jet->Phi(); jet2_eta0[m] = Jet->Eta(); //Get Sub Leading Jet(Jet2) value
+                   Delta_phi0[m] = jet1_phi0[m] - jet2_phi0[m]; Aj0[m] = (jet1_pt_BG0[m] - jet2_pt_BG0[m]) / (jet1_pt_BG0[m] + jet2_pt_BG0[m]);
+                   if     (Delta_phi0[m] < (-1./2*TMath::Pi()))Delta_phi0[m] = Delta_phi0[m] +2*TMath::Pi();
+                   else if(Delta_phi0[m] > (3./2*TMath::Pi()))Delta_phi0[m] = Delta_phi0[m] -2*TMath::Pi();
+                   Delta_eta0[m] = jet1_eta0[m] - jet2_eta0[m]; //Get Correlations of jet1, jet2
+
+                   // Correlations of jet1, jet2
+                   for(int count1=0;count1<4;count1++){
+                     for(int count2=0;count2<count1+1;count2++){
+                       if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                         fJet1Pt_PbPb[fCentBin][m][count1][count2]->Fill(jet1_pt0[m]);
+                         fJet2Pt_PbPb[fCentBin][m][count1][count2]->Fill(jet2_pt0[m]);
+                         fJet1Pt_BG_PbPb[fCentBin][m][count1][count2]->Fill(jet1_pt_BG0[m]);
+                         fJet2Pt_BG_PbPb[fCentBin][m][count1][count2]->Fill(jet2_pt_BG0[m]);
+                         fJetDeltaPhi_PbPb[fCentBin][m][count1][count2]->Fill(Delta_phi0[m]);
+                         fJetDeltaEta_PbPb[fCentBin][m][count1][count2]->Fill(Delta_eta0[m]);
+                         fJetDeltaEP_PbPb[fCentBin][m][count1][count2]->Fill(dEPJet0[m]);
+                       }
+                     }//count2
+                   }//count1
+
+
+                   // Find delta_phi
+                   if(Delta_phi0[m] > (2./3.)* TMath::Pi() && Delta_phi0[m] < (4./3.)* TMath::Pi()){
+                     for(int count1=0;count1<4;count1++){
+                       for(int count2=0;count2<count1+1;count2++){
+                         if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                           fJet1SelectPt_BG_PbPb[fCentBin][m][count1][count2]->Fill(jet1_pt_BG0[m]);
+                           fJet2SelectPt_BG_PbPb[fCentBin][m][count1][count2]->Fill(jet2_pt_BG0[m]);
+                           fAj_PbPb[fCentBin][m][count1][count2]->Fill((jet1_pt_BG0[m] - jet2_pt_BG0[m]) / (jet1_pt_BG0[m] + jet2_pt_BG0[m]));
+                         }
+                       }//count2
+                     }//count1
+                   }// Find delta_phi
+
+                   c_jet2_PbPb[m]++;
+                   subleading_jet_count0[m] += 1;
+                 }// sub leading
+
+             }
+
+             Jet = fJetsCont->GetNextAcceptJet();
+           }// jet while
+
+           //jet-hadron
+           if (fTracksCont) {
+             for(int m=0;m<3;m++){
+               //if find sub leading
+               int c_subleading_jet = 0;
+               c_subleading_jet = subleading_jet_count0[m];
+               if(c_subleading_jet > 0){
+
+                 AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle(0));
+                 while(track) {
+                   if(track->GetLabel()==0){
+
+                     Double_t pt,phi,dphi;
+                     pt = -999.0; phi = -999.0; dphi = -999.0;
+                     pt = track->Pt(); phi = track->Phi();
+
+                     dphi = jet1_phi0[m] - phi;
+                     if     (dphi < (-1./2.*TMath::Pi()))dphi = dphi +2*TMath::Pi();
+                     else if(dphi > (3./2.*TMath::Pi()))dphi = dphi -2*TMath::Pi();
+
+                     //jet_track check
+                     /*Bool_t jet_switch=false;
+                       for(int i=0;i<200;i++){
+                       Float_t check_track1,check_track2;
+                       check_track1 = -999.0; check_track2 = -999.0;
+                       check_track1 = jet_track[m][0][i]; check_track2 = jet_track[m][1][i];
+                       if(check_track1 == phi){
+                       jet_switch=true;
+                       }
+                       if(check_track2 == phi){
+                       jet_switch=true;
+                       }
+                       }
+
+                       if(jet_switch==true){
+                       continue;
+                       }*/
+
+                     //dphi cut
+                     Bool_t dphi_cut[4];
+                     //devide(jet side)
+                     dphi_cut[0]= ((-1./3.*TMath::Pi()) <= dphi && dphi <= (1./3.*TMath::Pi()));
+                     dphi_cut[1]= ((2./3.*TMath::Pi()) <= dphi && dphi <= (4./3.*TMath::Pi()));
+                     //devide(out jet side)
+                     dphi_cut[2]= (((1./3.*TMath::Pi()) <= dphi && dphi <= (1./2.*TMath::Pi())) || ((-1./2.*TMath::Pi()) < dphi && dphi < (-1./3.*TMath::Pi())));//leadingjet
+                     dphi_cut[3]= (((1./2.*TMath::Pi()) <= dphi && dphi <= (2./3.*TMath::Pi())) || ((4./3.*TMath::Pi()) < dphi && dphi < (3./2.*TMath::Pi())));//subleadingjet
+
+                     //pt switch
+                     Bool_t pt_switch[4];
+                     pt_switch[0]= (pt > 0.15);
+                     pt_switch[1]= (pt > 0.15 && pt <= 2.0);
+                     pt_switch[2]= (pt > 2.0 && pt <= 4.0);
+                     pt_switch[3]= (pt > 4.0);
+
+                     //jetdphi switch
+                     Double_t jet_dphi = -999.0;
+                     jet_dphi = Delta_phi0[m];
+                     Bool_t jet_dphi_switch[3];
+                     jet_dphi_switch[0]= (jet_dphi > (2./3.)* TMath::Pi() && jet_dphi < (4./3.)* TMath::Pi());
+                     jet_dphi_switch[1]= (jet_dphi > (5./6.)* TMath::Pi() && jet_dphi < (7./12.)* TMath::Pi());
+                     jet_dphi_switch[2]= (jet_dphi > (11./12.)* TMath::Pi() && jet_dphi < (13./12.)* TMath::Pi());
+
+                     //jetdEP switch
+                     Double_t jet_dEP = -999.0;
+                     jet_dEP = dEPJet0[m];
+                     Bool_t jet_dEP_switch[4];
+                     jet_dEP_switch[0]= ((0.*TMath::Pi()) <= jet_dEP && jet_dEP <= (1./4.*TMath::Pi()));
+                     jet_dEP_switch[1]= ((1./4.*TMath::Pi()) < jet_dEP && jet_dEP <= (1./2.*TMath::Pi()));
+                     jet_dEP_switch[2]= ((1./2.*TMath::Pi()) < jet_dEP && jet_dEP <= (3./4.*TMath::Pi()));
+                     jet_dEP_switch[3]= ((3./4.*TMath::Pi()) < jet_dEP && jet_dEP < (1.*TMath::Pi()));
+
+                     //eta switch
+                     /*Double_t leading_jet_eta = -999.0;
+                       leading_jet_eta = jet1_eta0[m];
+                       Bool_t eta_switch[3];
+                       eta_switch[0]= (-0.7 <= leading_jet_eta && leading_jet_eta <= 0.7);
+                       eta_switch[1]= (-0.3 <= leading_jet_eta && leading_jet_eta <= 0.3);
+                       eta_switch[2]= ((-0.7 <= leading_jet_eta && leading_jet_eta < -0.3) || (0.3 < leading_jet_eta && leading_jet_eta <= 0.7));*/
+
+                     //hadron-dphi
+                     for(int pt_cut=0;pt_cut<4;pt_cut++){
+                       if(pt_switch[pt_cut]){
+                         for(int count1=0;count1<4;count1++){
+                           if(jet_dphi_switch[0]){
+                             for(int count2=0;count2<count1+1;count2++){
+                               if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                                 fHJetDeltaPhi_Aj0_PbPb[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+
+                                 if(Aj0[m] >= 0.0 && Aj0[m] < 0.2){
+                                   fHJetDeltaPhi_Aj1_PbPb[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj0[m] >= 0.2 && Aj0[m] < 0.4){
+                                   fHJetDeltaPhi_Aj2_PbPb[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj0[m] >= 0.4 && Aj0[m] < 0.6){
+                                   fHJetDeltaPhi_Aj3_PbPb[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj0[m] >= 0.6 && Aj0[m] <= 0.8){
+                                   fHJetDeltaPhi_Aj4_PbPb[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+                               }
+
+
+                             }//count2
+                           }
+                         }//count1
+                       }//pt cut
+                     }//pt for
+
+                     //hadron-pT
+                     for(int count1=0;count1<4;count1++){
+                       if(jet_dphi_switch[0]){
+                         for(int count2=0;count2<count1+1;count2++){
+                           if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                             for(int i=0;i<4;i++){
+                               if(dphi_cut[i]){
+                                 fHJetPt_Aj0_PbPb[fCentBin][m][i][count1][count2]->Fill(pt);
+
+                                 if(Aj0[m] >= 0.0 && Aj0[m] < 0.2){
+                                   fHJetPt_Aj1_PbPb[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj0[m] >= 0.2 && Aj0[m] < 0.4){
+                                   fHJetPt_Aj2_PbPb[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj0[m] >= 0.4 && Aj0[m] < 0.6){
+                                   fHJetPt_Aj3_PbPb[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj0[m] >= 0.6 && Aj0[m] <= 0.8){
+                                   fHJetPt_Aj4_PbPb[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+                               }//dphi cut
+                             }//dphi loop
+                           }//jet pt cut
+
+                         }//count2
+                       }
+                     }//count1
+
+                     if(m==1){
+                       //hadron-dphi as dEPJet (jet leading track = 5GeV)
+                       for(int EPtri=0;EPtri<4;EPtri++){
+                         if(jet_dEP_switch[EPtri]){
+                           for(int pt_cut=0;pt_cut<4;pt_cut++){
+                             if(pt_switch[pt_cut]){
+                               for(int count1=0;count1<4;count1++){
+                                 if(jet_dphi_switch[0]){
+                                   for(int count2=0;count2<count1+1;count2++){
+                                     if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                                       fHJetDeltaPhiasEP_Aj0_PbPb[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+
+                                       if(Aj0[m] >= 0.0 && Aj0[m] < 0.2){
+                                         fHJetDeltaPhiasEP_Aj1_PbPb[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj0[m] >= 0.2 && Aj0[m] < 0.4){
+                                         fHJetDeltaPhiasEP_Aj2_PbPb[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj0[m] >= 0.4 && Aj0[m] < 0.6){
+                                         fHJetDeltaPhiasEP_Aj3_PbPb[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj0[m] >= 0.6 && Aj0[m] <= 0.8){
+                                         fHJetDeltaPhiasEP_Aj4_PbPb[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+                                     }
+
+
+                                   }//count2
+                                 }
+                               }//count1
+                             }//pt cut
+                           }//pt for
+                         }//dEP cut
+                       }//dEP for
+
+                       //hadron-pT as dEPJet (jet leading track = 5GeV)
+                       for(int EPtri=0;EPtri<4;EPtri++){
+                         if(jet_dEP_switch[EPtri]){
+                           for(int count1=0;count1<4;count1++){
+                             if(jet_dphi_switch[0]){
+                               for(int count2=0;count2<count1+1;count2++){
+                                 if(jet1_pt_BG0[m] > Jet1_threshold[count1] && jet2_pt_BG0[m] > Jet2_threshold[count2]){
+                                   for(int i=0;i<4;i++){
+                                     if(dphi_cut[i]){
+                                       fHJetPtasEP_Aj0_PbPb[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+
+                                       if(Aj0[m] >= 0.0 && Aj0[m] < 0.2){
+                                         fHJetPtasEP_Aj1_PbPb[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj0[m] >= 0.2 && Aj0[m] < 0.4){
+                                         fHJetPtasEP_Aj2_PbPb[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj0[m] >= 0.4 && Aj0[m] < 0.6){
+                                         fHJetPtasEP_Aj3_PbPb[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj0[m] >= 0.6 && Aj0[m] <= 0.8){
+                                         fHJetPtasEP_Aj4_PbPb[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+                                     }//dphi cut
+                                   }//dphi loop
+                                 }//jet pt cut
+
+                               }//count2
+                             }
+                           }//count1
+
+                         }//dEP cut
+                       }//dEP for
+                     }//jet leading track cut
+
+                   }// if label
+                   track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
+                 }// track while
+
+               }// if sub leading jet
+             }
+           }// tracks Cont
+
+         }// jetCont
+
+         //MC
+         //Track histogram
+         if (fMCTracksCont) {
+           AliVTrack *MCtrack = static_cast<AliVTrack*>(fMCTracksCont->GetNextAcceptParticle(0)); 
+           while(MCtrack) {
+             if(MCtrack->GetLabel()!=0){
+               fTrackPt_MC[fCentBin]->Fill(MCtrack->Pt()); 
+               fTrackPhi_MC[fCentBin]->Fill(MCtrack->Phi()); 
+               fTrackEta_MC[fCentBin]->Fill(MCtrack->Eta()); 
+               fTrack_Phi_Eta_MC[fCentBin]->Fill(MCtrack->Phi(),MCtrack->Eta());
+             }
+             MCtrack = static_cast<AliVTrack*>(fMCTracksCont->GetNextAcceptParticle());
+           }
+         }
+
+         // Jet and Jet-HadronHistgram
+         if (fMCJetsCont) {
+           AliEmcalJet *MCJet = fMCJetsCont->GetNextAcceptJet(0);
+           while(MCJet) {
+
+             if ((MCJet->Eta() >  0.7) ||
+                 (MCJet->Eta() < -0.7) ||
+                 (MCJet->Phi() >  2*TMath::Pi()) ||
+                 (MCJet->Phi() <  0.0)) continue; // acceptance eta range and etmin
+
+             //leading track cut
+             Int_t leading_track_count[3]={0,0,0};
+             //Int_t leading_track_limit=0;
+             if(fMCJetsCont->GetLeadingHadronPt(MCJet) > 0.) leading_track_count[0] += 1;
+             if(fMCJetsCont->GetLeadingHadronPt(MCJet) > 5.) leading_track_count[1] += 1;
+             if(fMCJetsCont->GetLeadingHadronPt(MCJet) > 10.) leading_track_count[2] += 1;
+             //if(fMCJetsCont->GetLeadingHadronPt(MCJet) > 100.) leading_track_limit += 1;
+             //if(leading_track_limit > 0) continue;
+
+             for(int m=0;m<3;m++){
+               c_jet1_MC[m]++; // jet count in acceptance.
+               if(leading_track_count[m] > 0){
+                 fJetPt_MC[fCentBin][m]->Fill(MCJet->Pt());
+                 fJetPhi_MC[fCentBin][m]->Fill(MCJet->Phi());
+                 fJetEta_MC[fCentBin][m]->Fill(MCJet->Eta());
+                 fJet_Phi_Eta_MC[fCentBin][m]->Fill(MCJet->Phi(),MCJet->Eta());
+               }
+             }
+
+             for(int m=0;m<3;m++){
+               if(c_jet1_MC[m] == 1)
+                 {
+                   if(leading_track_count[m] > 0){
+                     jet1_pt1[m] = MCJet->Pt(); jet1_phi1[m] = MCJet->Phi(); jet1_eta1[m] = MCJet->Eta(); //Get Leading Jet(Jet1) value
+
+                     dEPJet1[m] = jet1_phi1[m] - fEPV0;
+                     while (dEPJet1[m] < 0) dEPJet1[m] += TMath::Pi();
+                     while (dEPJet1[m] >= TMath::Pi()) dEPJet1[m] -= TMath::Pi();
+
+
+                     leading_jet_count1[m] += 1;
+                   }
+                 }
+
+               else if(c_jet1_MC[m] > 1 && c_jet2_MC[m] == 0  && leading_jet_count1[m] > 0 && leading_track_count[m] > 0)// sub leading
+                 {
+                   jet2_pt1[m] = MCJet->Pt(); jet2_phi1[m] = MCJet->Phi(); jet2_eta1[m] = MCJet->Eta(); //Get Sub Leading Jet(Jet2) value
+                   Delta_phi1[m] = jet1_phi1[m] - jet2_phi1[m]; Aj1[m] = (jet1_pt1[m] - jet2_pt1[m]) / (jet1_pt1[m] + jet2_pt1[m]);
+                   if     (Delta_phi1[m] < (-1./2*TMath::Pi()))Delta_phi1[m] = Delta_phi1[m] +2*TMath::Pi();
+                   else if(Delta_phi1[m] > (3./2*TMath::Pi()))Delta_phi1[m] = Delta_phi1[m] -2*TMath::Pi();
+                   Delta_eta1[m] = jet1_eta1[m] - jet2_eta1[m]; //Get Correlations of jet1, jet2
+
+                   // Correlations of jet1, jet2
+                   for(int count1=0;count1<4;count1++){
+                     for(int count2=0;count2<count1+1;count2++){
+                       if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                         fJet1Pt_MC[fCentBin][m][count1][count2]->Fill(jet1_pt1[m]);
+                         fJet2Pt_MC[fCentBin][m][count1][count2]->Fill(jet2_pt1[m]);
+                         fJetDeltaPhi_MC[fCentBin][m][count1][count2]->Fill(Delta_phi1[m]);
+                         fJetDeltaEta_MC[fCentBin][m][count1][count2]->Fill(Delta_eta1[m]);
+                         fJetDeltaEP_MC[fCentBin][m][count1][count2]->Fill(dEPJet1[m]);
+                       }
+                     }//count2
+                   }//count1
+
+
+                   // Find delta_phi
+                   if(Delta_phi1[m] > (2./3.)* TMath::Pi() && Delta_phi1[m] < (4./3.)* TMath::Pi()){
+                     for(int count1=0;count1<4;count1++){
+                       for(int count2=0;count2<count1+1;count2++){
+                         if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                           fAj_MC[fCentBin][m][count1][count2]->Fill((jet1_pt1[m] - jet2_pt1[m]) / (jet1_pt1[m] + jet2_pt1[m]));
+                         }
+                       }//count2
+                     }//count1
+                   }// Find delta_phi
+
+                   c_jet2_MC[m]++;
+                   subleading_jet_count1[m] += 1;
+                 }// sub leading
+
+             }
+
+             MCJet = fMCJetsCont->GetNextAcceptJet(); 
+           }//while jet
+
+           //jet-hadron
+           if (fMCTracksCont) {
+             for(int m=0;m<3;m++){
+               //if find sub leading
+               int c_subleading_jet = 0;
+               c_subleading_jet = subleading_jet_count1[m];
+               if(c_subleading_jet > 0){
+
+                 AliVTrack *MCtrack = static_cast<AliVTrack*>(fMCTracksCont->GetNextAcceptParticle(0));
+                 while(MCtrack) {
+                   if(MCtrack->GetLabel()!=0){
+
+                     Double_t pt,phi,dphi;
+                     pt = -999.0; phi = -999.0; dphi = -999.0;
+                     pt = MCtrack->Pt(); phi = MCtrack->Phi();
+
+                     dphi = jet1_phi1[m] - phi;
+                     if     (dphi < (-1./2.*TMath::Pi()))dphi = dphi +2*TMath::Pi();
+                     else if(dphi > (3./2.*TMath::Pi()))dphi = dphi -2*TMath::Pi();
+
+                     //jet_track check
+                     /*Bool_t jet_switch=false;
+                       for(int i=0;i<200;i++){
+                       Float_t check_track1,check_track2;
+                       check_track1 = -999.0; check_track2 = -999.0;
+                       check_track1 = jet_track[m][0][i]; check_track2 = jet_track[m][1][i];
+                       if(check_track1 == phi){
+                       jet_switch=true;
+                       }
+                       if(check_track2 == phi){
+                       jet_switch=true;
+                       }
+                       }
+
+                       if(jet_switch==true){
+                       continue;
+                       }*/
+
+                     //dphi cut
+                     Bool_t dphi_cut[4];
+                     //devide(jet side)
+                     dphi_cut[0]= ((-1./3.*TMath::Pi()) <= dphi && dphi <= (1./3.*TMath::Pi()));
+                     dphi_cut[1]= ((2./3.*TMath::Pi()) <= dphi && dphi <= (4./3.*TMath::Pi()));
+                     //devide(out jet side)
+                     dphi_cut[2]= (((1./3.*TMath::Pi()) <= dphi && dphi <= (1./2.*TMath::Pi())) || ((-1./2.*TMath::Pi()) < dphi && dphi < (-1./3.*TMath::Pi())));//leadingjet
+                     dphi_cut[3]= (((1./2.*TMath::Pi()) <= dphi && dphi <= (2./3.*TMath::Pi())) || ((4./3.*TMath::Pi()) < dphi && dphi < (3./2.*TMath::Pi())));//subleadingjet
+
+                     //pt switch
+                     Bool_t pt_switch[4];
+                     pt_switch[0]= (pt > 0.15);
+                     pt_switch[1]= (pt > 0.15 && pt <= 2.0);
+                     pt_switch[2]= (pt > 2.0 && pt <= 4.0);
+                     pt_switch[3]= (pt > 4.0);
+
+                     //jetdphi switch
+                     Double_t jet_dphi = -999.0;
+                     jet_dphi = Delta_phi1[m];
+                     Bool_t jet_dphi_switch[3];
+                     jet_dphi_switch[0]= (jet_dphi > (2./3.)* TMath::Pi() && jet_dphi < (4./3.)* TMath::Pi());
+                     jet_dphi_switch[1]= (jet_dphi > (5./6.)* TMath::Pi() && jet_dphi < (7./12.)* TMath::Pi());
+                     jet_dphi_switch[2]= (jet_dphi > (11./12.)* TMath::Pi() && jet_dphi < (13./12.)* TMath::Pi());
+
+                     //jetdEP switch
+                     Double_t jet_dEP = -999.0;
+                     jet_dEP = dEPJet1[m];
+                     Bool_t jet_dEP_switch[4];
+                     jet_dEP_switch[0]= ((0.*TMath::Pi()) <= jet_dEP && jet_dEP <= (1./4.*TMath::Pi()));
+                     jet_dEP_switch[1]= ((1./4.*TMath::Pi()) < jet_dEP && jet_dEP <= (1./2.*TMath::Pi()));
+                     jet_dEP_switch[2]= ((1./2.*TMath::Pi()) < jet_dEP && jet_dEP <= (3./4.*TMath::Pi()));
+                     jet_dEP_switch[3]= ((3./4.*TMath::Pi()) < jet_dEP && jet_dEP < (1.*TMath::Pi()));
+
+                     //eta switch
+                     /*Double_t leading_jet_eta = -999.0;
+                       leading_jet_eta = jet1_eta1[m];
+                       Bool_t eta_switch[3];
+                       eta_switch[0]= (-0.7 <= leading_jet_eta && leading_jet_eta <= 0.7);
+                       eta_switch[1]= (-0.3 <= leading_jet_eta && leading_jet_eta <= 0.3);
+                       eta_switch[2]= ((-0.7 <= leading_jet_eta && leading_jet_eta < -0.3) || (0.3 < leading_jet_eta && leading_jet_eta <= 0.7));*/
+
+                     //hadron-dphi
+                     for(int pt_cut=0;pt_cut<4;pt_cut++){
+                       if(pt_switch[pt_cut]){
+                         for(int count1=0;count1<4;count1++){
+                           if(jet_dphi_switch[0]){
+                             for(int count2=0;count2<count1+1;count2++){
+                               if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                                 fHJetDeltaPhi_Aj0_MC[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+
+                                 if(Aj1[m] >= 0.0 && Aj1[m] < 0.2){
+                                   fHJetDeltaPhi_Aj1_MC[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj1[m] >= 0.2 && Aj1[m] < 0.4){
+                                   fHJetDeltaPhi_Aj2_MC[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj1[m] >= 0.4 && Aj1[m] < 0.6){
+                                   fHJetDeltaPhi_Aj3_MC[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+
+                                 if(Aj1[m] >= 0.6 && Aj1[m] <= 0.8){
+                                   fHJetDeltaPhi_Aj4_MC[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                                 }
+                               }
+
+
+                             }//count2
+                           }
+                         }//count1
+                       }//pt cut
+                     }//pt for
+
+                     //hadron-pT
+                     for(int count1=0;count1<4;count1++){
+                       if(jet_dphi_switch[0]){
+                         for(int count2=0;count2<count1+1;count2++){
+                           if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                             for(int i=0;i<4;i++){
+                               if(dphi_cut[i]){
+                                 fHJetPt_Aj0_MC[fCentBin][m][i][count1][count2]->Fill(pt);
+
+                                 if(Aj1[m] >= 0.0 && Aj1[m] < 0.2){
+                                   fHJetPt_Aj1_MC[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj1[m] >= 0.2 && Aj1[m] < 0.4){
+                                   fHJetPt_Aj2_MC[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj1[m] >= 0.4 && Aj1[m] < 0.6){
+                                   fHJetPt_Aj3_MC[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+
+                                 if(Aj1[m] >= 0.6 && Aj1[m] <= 0.8){
+                                   fHJetPt_Aj4_MC[fCentBin][m][i][count1][count2]->Fill(pt);
+                                 }
+                               }//dphi cut
+                             }//dphi loop
+                           }//jet pt cut
+
+                         }//count2
+                       }
+                     }//count1
+
+                     if(m==1){
+                       //hadron-dphi as dEPJet (jet leading track = 5GeV)
+                       for(int EPtri=0;EPtri<4;EPtri++){
+                         if(jet_dEP_switch[EPtri]){
+                           for(int pt_cut=0;pt_cut<4;pt_cut++){
+                             if(pt_switch[pt_cut]){
+                               for(int count1=0;count1<4;count1++){
+                                 if(jet_dphi_switch[0]){
+                                   for(int count2=0;count2<count1+1;count2++){
+                                     if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                                       fHJetDeltaPhiasEP_Aj0_MC[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+
+                                       if(Aj1[m] >= 0.0 && Aj1[m] < 0.2){
+                                         fHJetDeltaPhiasEP_Aj1_MC[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj1[m] >= 0.2 && Aj1[m] < 0.4){
+                                         fHJetDeltaPhiasEP_Aj2_MC[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj1[m] >= 0.4 && Aj1[m] < 0.6){
+                                         fHJetDeltaPhiasEP_Aj3_MC[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+
+                                       if(Aj1[m] >= 0.6 && Aj1[m] <= 0.8){
+                                         fHJetDeltaPhiasEP_Aj4_MC[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                       }
+                                     }
+
+
+                                   }//count2
+                                 }
+                               }//count1
+                             }//pt cut
+                           }//pt for
+                         }//dEP cut
+                       }//dEP for
+
+                       //hadron-pT as dEPJet (jet leading track = 5GeV)
+                       for(int EPtri=0;EPtri<4;EPtri++){
+                         if(jet_dEP_switch[EPtri]){
+                           for(int count1=0;count1<4;count1++){
+                             if(jet_dphi_switch[0]){
+                               for(int count2=0;count2<count1+1;count2++){
+                                 if(jet1_pt1[m] > Jet1_threshold[count1] && jet2_pt1[m] > Jet2_threshold[count2]){
+                                   for(int i=0;i<4;i++){
+                                     if(dphi_cut[i]){
+                                       fHJetPtasEP_Aj0_MC[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+
+                                       if(Aj1[m] >= 0.0 && Aj1[m] < 0.2){
+                                         fHJetPtasEP_Aj1_MC[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj1[m] >= 0.2 && Aj1[m] < 0.4){
+                                         fHJetPtasEP_Aj2_MC[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj1[m] >= 0.4 && Aj1[m] < 0.6){
+                                         fHJetPtasEP_Aj3_MC[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+
+                                       if(Aj1[m] >= 0.6 && Aj1[m] <= 0.8){
+                                         fHJetPtasEP_Aj4_MC[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                       }
+                                     }//dphi cut
+                                   }//dphi loop
+                                 }//jet pt cut
+
+                               }//count2
+                             }
+                           }//count1
+                         }//dEP cut
+                       }//dEP for
+                     }//jet leading track cut
+
+                   }// if label
+                   MCtrack = static_cast<AliVTrack*>(fMCTracksCont->GetNextAcceptParticle());
+                 }// track while
+
+               }// if sub leading jet
+             }
+           }// tracks Cont
+
+         }//jet Cont
+
+         // ************
+         // Random cones
+         // _________________________________
+  
+         const Float_t rcArea = fConeRadius * fConeRadius * TMath::Pi();
+         Float_t RCpt = 0;
+         Float_t RCeta = 0;
+         Float_t RCphi = 0;
+  
+         if (fTracksCont || fCaloClustersCont) {
+    
+           for (Int_t i = 0; i < fRCperEvent; i++) {
+             // Simple random cones
+             RCpt = 0;
+             RCeta = 0;
+             RCphi = 0;
+             GetRandomCone(RCpt, RCeta, RCphi, fTracksCont, fCaloClustersCont, 0);
+             if (RCpt > 0) {
+               fHistRCPhiEta->Fill(RCeta, RCphi);
+               fHistRhoVSRCPt[fCentBin]->Fill(fRhoVal * rcArea, RCpt);
+       
+               fHistRCPt[fCentBin]->Fill(RCpt);
+
+               Double_t ep = RCphi - fEPV0;
+               while (ep < 0) ep += TMath::Pi();
+               while (ep >= TMath::Pi()) ep -= TMath::Pi();
+
+               fHistDeltaPtRCvsEP[fCentBin]->Fill(ep, RCpt - rcArea * fRhoVal);
+             }
+
+             if (fJetsCont) {
+
+               // Random cones far from leading jet
+               AliEmcalJet* jet = fJetsCont->GetLeadingJet("rho");
+       
+               RCpt = 0;
+               RCeta = 0;
+               RCphi = 0;
+               GetRandomCone(RCpt, RCeta, RCphi, fTracksCont, fCaloClustersCont, jet);
+               if (RCpt > 0) {
+                 if (jet) {
+                   Float_t dphi = RCphi - jet->Phi();
+                   if (dphi > 4.8) dphi -= TMath::Pi() * 2;
+                   if (dphi < -1.6) dphi += TMath::Pi() * 2; 
+                   fHistRCPtExLJVSDPhiLJ->Fill(RCpt, dphi);
+                 }
+                 fHistRCPtExLJ[fCentBin]->Fill(RCpt);
+                 fHistDeltaPtRCExLJ[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
+               }
+
+               //partial exclusion
+               if(fBeamType == kpA) {
+
+                 RCpt = 0;
+                 RCeta = 0;
+                 RCphi = 0;
+                 GetRandomCone(RCpt, RCeta, RCphi, fTracksCont, fCaloClustersCont, jet, kTRUE);
+
+                 if (RCpt > 0) {
+                   if (jet) {
+                     Float_t dphi = RCphi - jet->Phi();
+                     if (dphi > 4.8) dphi -= TMath::Pi() * 2;
+                     if (dphi < -1.6) dphi += TMath::Pi() * 2;
+                     fHistRCPtExPartialLJVSDPhiLJ->Fill(RCpt, dphi);
+                   }
+                   fHistRCPtExPartialLJ[fCentBin]->Fill(RCpt);
+                   fHistDeltaPtRCExPartialLJ[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
+                 }
+               }
+             }
+           }
+         }
+  
+         // Random cones with randomized particles
+         /*if (fRandTracksCont || fRandCaloClustersCont) {
+           RCpt = 0;
+           RCeta = 0;
+           RCphi = 0;
+           GetRandomCone(RCpt, RCeta, RCphi, fRandTracksCont, fRandCaloClustersCont, 0);
+           if (RCpt > 0) {
+           fHistRCPtRand[fCentBin]->Fill(RCpt);
+           fHistDeltaPtRCRand[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
+           }  
+           }*/
+
+         // ************
+         // Embedding
+         // _________________________________
+
+         //Track histogram
+         if (fEmbTracksCont) {
+           AliVTrack *EMBtrack = static_cast<AliVTrack*>(fEmbTracksCont->GetNextAcceptParticle(0)); 
+           while(EMBtrack) {
+             fTrackPt_EMB[fCentBin]->Fill(EMBtrack->Pt()); 
+             fTrackPhi_EMB[fCentBin]->Fill(EMBtrack->Phi()); 
+             fTrackEta_EMB[fCentBin]->Fill(EMBtrack->Eta()); 
+             fTrack_Phi_Eta_EMB[fCentBin]->Fill(EMBtrack->Phi(),EMBtrack->Eta());
+             EMBtrack = static_cast<AliVTrack*>(fEmbTracksCont->GetNextAcceptParticle());
+           }
+         }
+
+         if (fEmbJetsCont) {
+    
+           AliEmcalJet *embJet = NextEmbeddedJet(kTRUE);
+    
+           while (embJet != 0) {
+
+             if ((embJet->Eta() >  0.7) ||
+                 (embJet->Eta() < -0.7) ||
+                 (embJet->Phi() >  2*TMath::Pi()) ||
+                 (embJet->Phi() <  0.0)) continue; // acceptance eta range and etmin
+
+             TLorentzVector mom;
+             fEmbJetsCont->GetLeadingHadronMomentum(mom,embJet);
+      
+             Double_t distLeading2Jet = TMath::Sqrt((embJet->Eta() - mom.Eta()) * (embJet->Eta() - mom.Eta()) + (embJet->Phi() - mom.Phi()) * (embJet->Phi() - mom.Phi()));
+      
+             fHistEmbPartPtvsJetPt[fCentBin]->Fill(embJet->MCPt(), embJet->Pt());
+             fHistEmbPartPtvsJetCorrPt[fCentBin]->Fill(embJet->MCPt(), embJet->Pt() - embJet->Area() * fRhoVal);
+             fHistLeadPartPhiEta->Fill(mom.Eta(), mom.Phi());
+             fHistDistLeadPart2JetAxis[fCentBin]->Fill(distLeading2Jet);
+      
+             fHistEmbJetsPtArea[fCentBin]->Fill(embJet->Area(), embJet->Pt(), mom.Pt());
+             fHistEmbJetsCorrPtArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - fRhoVal * embJet->Area(), mom.Pt());
+             fHistEmbJetsPhiEta->Fill(embJet->Eta(), embJet->Phi());
+             fHistJetPtvsJetCorrPt[fCentBin]->Fill(embJet->Pt(), embJet->Pt() - fRhoVal * embJet->Area());
+      
+             fHistEmbBkgArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - embJet->MCPt());
+             fHistRhoVSEmbBkg[fCentBin]->Fill(fRhoVal * embJet->Area(), embJet->Pt() - embJet->MCPt());
+             fHistDeltaPtEmbArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - embJet->Area() * fRhoVal - embJet->MCPt());
+
+             Double_t ep = embJet->Phi() - fEPV0;
+             while (ep < 0) ep += TMath::Pi();
+             while (ep >= TMath::Pi()) ep -= TMath::Pi();
+
+             fHistDeltaPtEmbvsEP[fCentBin]->Fill(ep, embJet->Pt() - embJet->Area() * fRhoVal - embJet->MCPt());
+
+             //leading track cut
+             Int_t leading_track_count[3]={0,0,0};
+             //Int_t leading_track_limit=0;
+             if(fEmbJetsCont->GetLeadingHadronPt(embJet) > 0.) leading_track_count[0] += 1;
+             if(fEmbJetsCont->GetLeadingHadronPt(embJet) > 5.) leading_track_count[1] += 1;
+             if(fEmbJetsCont->GetLeadingHadronPt(embJet) > 10.) leading_track_count[2] += 1;
+             //if(fEmbJetsCont->GetLeadingHadronPt(embJet) > 100.) leading_track_limit += 1;
+             //if(leading_track_limit > 0) continue;
+
+             for(int m=0;m<3;m++){
+               c_jet1_EMB[m]++; // jet count in acceptance.
+               if(leading_track_count[m] > 0){
+                 fJetPt_EMB[fCentBin][m]->Fill(embJet->Pt());
+                 fJetPhi_EMB[fCentBin][m]->Fill(embJet->Phi());
+                 fJetEta_EMB[fCentBin][m]->Fill(embJet->Eta());
+                 fJet_Phi_Eta_EMB[fCentBin][m]->Fill(embJet->Phi(),embJet->Eta());
+                 fJetPt_BG_EMB[fCentBin][m]->Fill(embJet->Pt() - embJet->Area() * fRhoVal);
+                 fJetDeltaPt[fCentBin][m]->Fill(embJet->Pt() - embJet->Area() * fRhoVal - embJet->MCPt());
+               }
+             }
+
+             for(int m=0;m<3;m++){
+               if(c_jet1_EMB[m] == 1)
+                 {
+                   if(leading_track_count[m] > 0){
+                     jet1_pt2[m] = embJet->Pt(); jet1_pt_BG2[m] = embJet->Pt() - embJet->Area() * fRhoVal; jet1_Deltapt[m] = embJet->Pt() - embJet->Area() * fRhoVal - embJet->MCPt(); jet1_phi2[m] = embJet->Phi(); jet1_eta2[m] = embJet->Eta(); //Get Leading Jet(Jet1) value
+
+                     dEPJet2[m] = jet1_phi2[m] - fEPV0;
+                     while (dEPJet2[m] < 0) dEPJet2[m] += TMath::Pi();
+                     while (dEPJet2[m] >= TMath::Pi()) dEPJet2[m] -= TMath::Pi();
+
+                     leading_jet_count2[m] += 1;
+                   }
+                 }
+
+               else if(c_jet1_EMB[m] > 1 && c_jet2_EMB[m] == 0  && leading_jet_count2[m] > 0 && leading_track_count[m] > 0)// sub leading
+                 {
+                   jet2_pt2[m] = embJet->Pt(); jet2_pt_BG2[m] = embJet->Pt() - embJet->Area() * fRhoVal; jet2_Deltapt[m] = embJet->Pt() - embJet->Area() * fRhoVal - embJet->MCPt(); jet2_phi2[m] = embJet->Phi(); jet2_eta2[m] = embJet->Eta(); //Get Sub Leading Jet(Jet2) value
+                   Delta_phi2[m] = jet1_phi2[m] - jet2_phi2[m]; Aj2[m] = (jet1_pt_BG2[m] - jet2_pt_BG2[m]) / (jet1_pt_BG2[m] + jet2_pt_BG2[m]);
+                   if     (Delta_phi2[m] < (-1./2*TMath::Pi()))Delta_phi2[m] = Delta_phi2[m] +2*TMath::Pi();
+                   else if(Delta_phi2[m] > (3./2*TMath::Pi()))Delta_phi2[m] = Delta_phi2[m] -2*TMath::Pi();
+                   Delta_eta2[m] = jet1_eta2[m] - jet2_eta2[m]; //Get Correlations of jet1, jet2
+
+                   // Correlations of jet1, jet2
+                   for(int count1=0;count1<4;count1++){
+                     for(int count2=0;count2<count1+1;count2++){
+                       if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                         fJet1Pt_EMB[fCentBin][m][count1][count2]->Fill(jet1_pt2[m]);
+                         fJet2Pt_EMB[fCentBin][m][count1][count2]->Fill(jet2_pt2[m]);
+                         fJet1Pt_BG_EMB[fCentBin][m][count1][count2]->Fill(jet1_pt_BG2[m]);
+                         fJet2Pt_BG_EMB[fCentBin][m][count1][count2]->Fill(jet2_pt_BG2[m]);
+                         fJet1DeltaPt[fCentBin][m][count1][count2]->Fill(jet1_Deltapt[m]);
+                         fJet2DeltaPt[fCentBin][m][count1][count2]->Fill(jet2_Deltapt[m]);
+                         fJetDeltaPhi_EMB[fCentBin][m][count1][count2]->Fill(Delta_phi2[m]);
+                         fJetDeltaEta_EMB[fCentBin][m][count1][count2]->Fill(Delta_eta2[m]);
+                         fJetDeltaEP_EMB[fCentBin][m][count1][count2]->Fill(dEPJet2[m]);
+                       }
+                     }//count2
+                   }//count1
+
+
+                   // Find delta_phi
+                   if(Delta_phi2[m] > (2./3.)* TMath::Pi() && Delta_phi2[m] < (4./3.)* TMath::Pi()){
+                     for(int count1=0;count1<4;count1++){
+                       for(int count2=0;count2<count1+1;count2++){
+                         if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                           fJet1SelectPt_BG_EMB[fCentBin][m][count1][count2]->Fill(jet1_pt_BG2[m]);
+                           fJet2SelectPt_BG_EMB[fCentBin][m][count1][count2]->Fill(jet2_pt_BG2[m]);
+                           fJet1SelectDeltaPt[fCentBin][m][count1][count2]->Fill(jet1_Deltapt[m]);
+                           fJet2SelectDeltaPt[fCentBin][m][count1][count2]->Fill(jet2_Deltapt[m]);
+                           fAj_EMB[fCentBin][m][count1][count2]->Fill((jet1_pt_BG2[m] - jet2_pt_BG2[m]) / (jet1_pt_BG2[m] + jet2_pt_BG2[m]));
+                         }
+                       }//count2
+                     }//count1
+                   }// Find delta_phi
+
+                   c_jet2_EMB[m]++;
+                   subleading_jet_count2[m] += 1;
+                 }// sub leading
+
+             }
+
+             embJet = NextEmbeddedJet();
+           }// jet while
+
+
+           //jet-hadron
+           if (fEmbTracksCont) {
+             for(int m=0;m<3;m++){
+               //if find sub leading
+               int c_subleading_jet = 0;
+               c_subleading_jet = subleading_jet_count2[m];
+               if(c_subleading_jet > 0){
+
+                 AliVTrack *EMBtrack = static_cast<AliVTrack*>(fEmbTracksCont->GetNextAcceptParticle(0));
+                 while(EMBtrack) {
+
+                   Double_t pt,phi,dphi;
+                   pt = -999.0; phi = -999.0; dphi = -999.0;
+                   pt = EMBtrack->Pt(); phi = EMBtrack->Phi();
+
+                   dphi = jet1_phi2[m] - phi;
+                   if     (dphi < (-1./2.*TMath::Pi()))dphi = dphi +2*TMath::Pi();
+                   else if(dphi > (3./2.*TMath::Pi()))dphi = dphi -2*TMath::Pi();
+
+                   //jet_track check
+                   /*Bool_t jet_switch=false;
+                     for(int i=0;i<200;i++){
+                     Float_t check_track1,check_track2;
+                     check_track1 = -999.0; check_track2 = -999.0;
+                     check_track1 = jet_track[m][0][i]; check_track2 = jet_track[m][1][i];
+                     if(check_track1 == phi){
+                     jet_switch=true;
+                     }
+                     if(check_track2 == phi){
+                     jet_switch=true;
+                     }
+                     }
+
+                     if(jet_switch==true){
+                     continue;
+                     }*/
+
+                   //dphi cut
+                   Bool_t dphi_cut[4];
+                   //devide(jet side)
+                   dphi_cut[0]= ((-1./3.*TMath::Pi()) <= dphi && dphi <= (1./3.*TMath::Pi()));
+                   dphi_cut[1]= ((2./3.*TMath::Pi()) <= dphi && dphi <= (4./3.*TMath::Pi()));
+                   //devide(out jet side)
+                   dphi_cut[2]= (((1./3.*TMath::Pi()) <= dphi && dphi <= (1./2.*TMath::Pi())) || ((-1./2.*TMath::Pi()) < dphi && dphi < (-1./3.*TMath::Pi())));//leadingjet
+                   dphi_cut[3]= (((1./2.*TMath::Pi()) <= dphi && dphi <= (2./3.*TMath::Pi())) || ((4./3.*TMath::Pi()) < dphi && dphi < (3./2.*TMath::Pi())));//subleadingjet
+
+                   //pt switch
+                   Bool_t pt_switch[4];
+                   pt_switch[0]= (pt > 0.15);
+                   pt_switch[1]= (pt > 0.15 && pt <= 2.0);
+                   pt_switch[2]= (pt > 2.0 && pt <= 4.0);
+                   pt_switch[3]= (pt > 4.0);
+
+                   //jetdphi switch
+                   Double_t jet_dphi = -999.0;
+                   jet_dphi = Delta_phi2[m];
+                   Bool_t jet_dphi_switch[3];
+                   jet_dphi_switch[0]= (jet_dphi > (2./3.)* TMath::Pi() && jet_dphi < (4./3.)* TMath::Pi());
+                   jet_dphi_switch[1]= (jet_dphi > (5./6.)* TMath::Pi() && jet_dphi < (7./12.)* TMath::Pi());
+                   jet_dphi_switch[2]= (jet_dphi > (11./12.)* TMath::Pi() && jet_dphi < (13./12.)* TMath::Pi());
+
+                   //jetdEP switch
+                   Double_t jet_dEP = -999.0;
+                   jet_dEP = dEPJet2[m];
+                   Bool_t jet_dEP_switch[4];
+                   jet_dEP_switch[0]= ((0.*TMath::Pi()) <= jet_dEP && jet_dEP <= (1./4.*TMath::Pi()));
+                   jet_dEP_switch[1]= ((1./4.*TMath::Pi()) < jet_dEP && jet_dEP <= (1./2.*TMath::Pi()));
+                   jet_dEP_switch[2]= ((1./2.*TMath::Pi()) < jet_dEP && jet_dEP <= (3./4.*TMath::Pi()));
+                   jet_dEP_switch[3]= ((3./4.*TMath::Pi()) < jet_dEP && jet_dEP < (1.*TMath::Pi()));
+
+                   //eta switch
+                   /*Double_t leading_jet_eta = -999.0;
+                     leading_jet_eta = jet1_eta2[m];
+                     Bool_t eta_switch[3];
+                     eta_switch[0]= (-0.7 <= leading_jet_eta && leading_jet_eta <= 0.7);
+                     eta_switch[1]= (-0.3 <= leading_jet_eta && leading_jet_eta <= 0.3);
+                     eta_switch[2]= ((-0.7 <= leading_jet_eta && leading_jet_eta < -0.3) || (0.3 < leading_jet_eta && leading_jet_eta <= 0.7));*/
+
+                   //hadron-dphi
+                   for(int pt_cut=0;pt_cut<4;pt_cut++){
+                     if(pt_switch[pt_cut]){
+                       for(int count1=0;count1<4;count1++){
+                         if(jet_dphi_switch[0]){
+                           for(int count2=0;count2<count1+1;count2++){
+                             if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                               fHJetDeltaPhi_Aj0_EMB[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+
+                               if(Aj2[m] >= 0.0 && Aj2[m] < 0.2){
+                                 fHJetDeltaPhi_Aj1_EMB[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                               }
+
+                               if(Aj2[m] >= 0.2 && Aj2[m] < 0.4){
+                                 fHJetDeltaPhi_Aj2_EMB[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                               }
+
+                               if(Aj2[m] >= 0.4 && Aj2[m] < 0.6){
+                                 fHJetDeltaPhi_Aj3_EMB[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                               }
+
+                               if(Aj2[m] >= 0.6 && Aj2[m] <= 0.8){
+                                 fHJetDeltaPhi_Aj4_EMB[fCentBin][m][pt_cut][count1][count2]->Fill(dphi);
+                               }
+                             }
+
+
+                           }//count2
+                         }
+                       }//count1
+                     }//pt cut
+                   }//pt for
+
+                   //hadron-pT
+                   for(int count1=0;count1<4;count1++){
+                     if(jet_dphi_switch[0]){
+                       for(int count2=0;count2<count1+1;count2++){
+                         if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                           for(int i=0;i<4;i++){
+                             if(dphi_cut[i]){
+                               fHJetPt_Aj0_EMB[fCentBin][m][i][count1][count2]->Fill(pt);
+
+                               if(Aj2[m] >= 0.0 && Aj2[m] < 0.2){
+                                 fHJetPt_Aj1_EMB[fCentBin][m][i][count1][count2]->Fill(pt);
+                               }
+
+                               if(Aj2[m] >= 0.2 && Aj2[m] < 0.4){
+                                 fHJetPt_Aj2_EMB[fCentBin][m][i][count1][count2]->Fill(pt);
+                               }
+
+                               if(Aj2[m] >= 0.4 && Aj2[m] < 0.6){
+                                 fHJetPt_Aj3_EMB[fCentBin][m][i][count1][count2]->Fill(pt);
+                               }
+
+                               if(Aj2[m] >= 0.6 && Aj2[m] <= 0.8){
+                                 fHJetPt_Aj4_EMB[fCentBin][m][i][count1][count2]->Fill(pt);
+                               }
+                             }//dphi cut
+                           }//dphi loop
+                         }//jet pt cut
+
+                       }//count2
+                     }
+                   }//count1
+
+                   if(m==1){
+                     //hadron-dphi as dEPJet (jet leading track = 5GeV)
+                     for(int EPtri=0;EPtri<4;EPtri++){
+                       if(jet_dEP_switch[EPtri]){
+                         for(int pt_cut=0;pt_cut<4;pt_cut++){
+                           if(pt_switch[pt_cut]){
+                             for(int count1=0;count1<4;count1++){
+                               if(jet_dphi_switch[0]){
+                                 for(int count2=0;count2<count1+1;count2++){
+                                   if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                                     fHJetDeltaPhiasEP_Aj0_EMB[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+
+                                     if(Aj2[m] >= 0.0 && Aj2[m] < 0.2){
+                                       fHJetDeltaPhiasEP_Aj1_EMB[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                     }
+
+                                     if(Aj2[m] >= 0.2 && Aj2[m] < 0.4){
+                                       fHJetDeltaPhiasEP_Aj2_EMB[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                     }
+
+                                     if(Aj2[m] >= 0.4 && Aj2[m] < 0.6){
+                                       fHJetDeltaPhiasEP_Aj3_EMB[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                     }
+
+                                     if(Aj2[m] >= 0.6 && Aj2[m] <= 0.8){
+                                       fHJetDeltaPhiasEP_Aj4_EMB[fCentBin][EPtri][pt_cut][count1][count2]->Fill(dphi);
+                                     }
+                                   }
+
+
+                                 }//count2
+                               }
+                             }//count1
+                           }//pt cut
+                         }//pt for
+                       }//dEP cut
+                     }//dEP for
+
+                     //hadron-pT as dEPJet (jet lenading track = 5GeV)
+                     for(int EPtri=0;EPtri<4;EPtri++){
+                       if(jet_dEP_switch[EPtri]){
+                         for(int count1=0;count1<4;count1++){
+                           if(jet_dphi_switch[0]){
+                             for(int count2=0;count2<count1+1;count2++){
+                               if(jet1_pt_BG2[m] > Jet1_threshold[count1] && jet2_pt_BG2[m] > Jet2_threshold[count2]){
+                                 for(int i=0;i<4;i++){
+                                   if(dphi_cut[i]){
+                                     fHJetPtasEP_Aj0_EMB[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+
+                                     if(Aj2[m] >= 0.0 && Aj2[m] < 0.2){
+                                       fHJetPtasEP_Aj1_EMB[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                     }
+
+                                     if(Aj2[m] >= 0.2 && Aj2[m] < 0.4){
+                                       fHJetPtasEP_Aj2_EMB[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                     }
+
+                                     if(Aj2[m] >= 0.4 && Aj2[m] < 0.6){
+                                       fHJetPtasEP_Aj3_EMB[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                     }
+
+                                     if(Aj2[m] >= 0.6 && Aj2[m] <= 0.8){
+                                       fHJetPtasEP_Aj4_EMB[fCentBin][EPtri][i][count1][count2]->Fill(pt);
+                                     }
+                                   }//dphi cut
+                                 }//dphi loop
+                               }//jet pt cut
+
+                             }//count2
+                           }
+                         }//count1
+                       }//dEP cut
+                     }//dEP for
+                   }//jet leading track cut
+
+                   EMBtrack = static_cast<AliVTrack*>(fEmbTracksCont->GetNextAcceptParticle());
+                 }// track while
+
+               }// if sub leading jet
+             }
+           }// tracks Cont
+
+         }// jet Cont
+
+
+       }//vertex
+      }//vertex
+    }//trigger
+
+  }//event
+  return kTRUE;
+}
+
+//________________________________________________________________________
+AliEmcalJet* AliAnalysisTaskDijetHadron::NextEmbeddedJet(Bool_t reset)
+{
+  // Get the next accepted embedded jet.
+
+  Int_t i = reset ? 0 : -1;
+      
+  AliEmcalJet* jet = fEmbJetsCont->GetNextAcceptJet(i);
+  while (jet && jet->MCPt() < fMCJetPtThreshold) jet = fEmbJetsCont->GetNextAcceptJet();
+
+  return jet;
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::GetRandomCone(Float_t &pt, Float_t &eta, Float_t &phi,
+                                           AliParticleContainer* tracks, AliClusterContainer* clusters,
+                                           AliEmcalJet *jet, Bool_t bPartialExclusion) const
+{
+  // Get rigid cone.
+
+  eta = -999;
+  phi = -999;
+  pt = 0;
+
+  if (!tracks && !clusters)
+    return;
+
+  Float_t LJeta = 999;
+  Float_t LJphi = 999;
+
+  if (jet) {
+    LJeta = jet->Eta();
+    LJphi = jet->Phi();
+  }
+
+  Float_t maxEta = fConeMaxEta;
+  Float_t minEta = fConeMinEta;
+  Float_t maxPhi = fConeMaxPhi;
+  Float_t minPhi = fConeMinPhi;
+
+  if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
+  if (minPhi < 0) minPhi = 0;
+  
+  Float_t dLJ = 0;
+  Int_t repeats = 0;
+  Bool_t reject = kTRUE;
+  do {
+    eta = gRandom->Rndm() * (maxEta - minEta) + minEta;
+    phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi;
+    dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi));
+
+    if(bPartialExclusion) {
+      reject = kFALSE;
+
+      TRandom3 rnd;
+      rnd.SetSeed(0);
+
+      Double_t ncoll = GetNColl();
+
+      Double_t prob = 0.;
+      if(ncoll>0)
+        prob = 1./ncoll;
+
+      if(rnd.Rndm()<=prob) reject = kTRUE; //reject cone
+    }
+
+    repeats++;
+  } while (dLJ < fMinRC2LJ && repeats < 999 && reject);
+
+  if (repeats == 999) {
+    AliWarning(Form("%s: Could not get random cone!", GetName()));
+    return;
+  }
+
+  if (clusters) {
+    AliVCluster* cluster = clusters->GetNextAcceptCluster(0);
+    while (cluster) {     
+      TLorentzVector nPart;
+      cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
+
+      Float_t cluseta = nPart.Eta();
+      Float_t clusphi = nPart.Phi();
+      
+      if (TMath::Abs(clusphi - phi) > TMath::Abs(clusphi - phi + 2 * TMath::Pi()))
+       clusphi += 2 * TMath::Pi();
+      if (TMath::Abs(clusphi - phi) > TMath::Abs(clusphi - phi - 2 * TMath::Pi()))
+       clusphi -= 2 * TMath::Pi();
+     
+      Float_t d = TMath::Sqrt((cluseta - eta) * (cluseta - eta) + (clusphi - phi) * (clusphi - phi));
+      if (d <= fConeRadius) 
+       pt += nPart.Pt();
+
+      cluster = clusters->GetNextAcceptCluster();
+    }
+  }
+
+  if (tracks) {
+    AliVParticle* track = tracks->GetNextAcceptParticle(0); 
+    while(track) { 
+      Float_t tracketa = track->Eta();
+      Float_t trackphi = track->Phi();
+      
+      if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
+       trackphi += 2 * TMath::Pi();
+      if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
+       trackphi -= 2 * TMath::Pi();
+      
+      Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
+      if (d <= fConeRadius)
+       pt += track->Pt();
+
+      track = tracks->GetNextAcceptParticle(); 
+    }
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::SetConeEtaPhiEMCAL()
+{
+  // Set default cuts for full cones
+
+  SetConeEtaLimits(-0.7+fConeRadius,0.7-fConeRadius);
+  SetConePhiLimits(1.4+fConeRadius,TMath::Pi()-fConeRadius);
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::SetConeEtaPhiTPC()
+{
+  // Set default cuts for charged cones
+
+  SetConeEtaLimits(-0.9+fConeRadius, 0.9-fConeRadius);
+  SetConePhiLimits(-10, 10);
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskDijetHadron::ExecOnce()
+{
+  // Initialize the analysis.
+
+  AliAnalysisTaskEmcalJet::ExecOnce();
+
+  if (fTracksCont && fTracksCont->GetArray() == 0) fTracksCont = 0;
+  if (fCaloClustersCont && fCaloClustersCont->GetArray() == 0) fCaloClustersCont = 0;
+  if (fEmbTracksCont && fEmbTracksCont->GetArray() == 0) fEmbTracksCont = 0;
+  if (fEmbCaloClustersCont && fEmbCaloClustersCont->GetArray() == 0) fEmbCaloClustersCont = 0;
+  //if (fRandTracksCont && fRandTracksCont->GetArray() == 0) fRandTracksCont = 0;
+  //if (fRandCaloClustersCont && fRandCaloClustersCont->GetArray() == 0) fRandCaloClustersCont = 0;
+  if (fJetsCont && fJetsCont->GetArray() == 0) fJetsCont = 0;
+  if (fMCJetsCont && fMCJetsCont->GetArray() == 0) fMCJetsCont = 0;
+  if (fEmbJetsCont && fEmbJetsCont->GetArray() == 0) fEmbJetsCont = 0;
+
+  if (fRCperEvent < 0) {
+    Double_t area = (fConeMaxEta - fConeMinEta) * (fConeMaxPhi - fConeMinPhi);
+    Double_t rcArea = TMath::Pi() * fConeRadius * fConeRadius;
+    fRCperEvent = TMath::FloorNint(area / rcArea - 0.5);
+    if (fRCperEvent == 0)
+      fRCperEvent = 1;
+  }
+
+  if (fMinRC2LJ < 0)
+    fMinRC2LJ = fConeRadius * 1.5;
+
+  const Float_t maxDist = TMath::Max(fConeMaxPhi - fConeMinPhi, fConeMaxEta - fConeMinEta) / 2;
+  if (fMinRC2LJ > maxDist) {
+    AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. "
+                    "Will use fMinRC2LJ = %f", fMinRC2LJ, maxDist));
+    fMinRC2LJ = maxDist;
+  }
+}
+
+//________________________________________________________________________
+Double_t AliAnalysisTaskDijetHadron::GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz)
+{
+  return (trkPx*jetPx+trkPy*jetPy+trkPz*jetPz)/(jetPx*jetPx+jetPy*jetPy+jetPz*jetPz);
+}
+
+//________________________________________________________________________
+Double_t AliAnalysisTaskDijetHadron::GetNColl() const {
+  // Get NColl - returns value of corresponding bin
+  // only works for pA
+  // values taken from V0A slicing https://twiki.cern.ch/twiki/bin/viewauth/ALICE/PACentStudies#Tables_with_centrality_bins_from
+
+  if(fBeamType == kpA) {
+
+    const Int_t nNCollBins = 7;
+
+    Double_t centMin[nNCollBins] = {0.,5.,10.,20.,40.,60.,80.};
+    Double_t centMax[nNCollBins] = {5.,10.,20.,40.,60.,80.,100.};
+
+    Double_t nColl[nNCollBins] = {14.7,13.,11.7,9.38,6.49,3.96,1.52};
+
+    for(Int_t i = 0; i<nNCollBins; i++) {
+      if(fCent>=centMin[i] && fCent<centMax[i])
+       return nColl[i];
+    }
+
+    return -1.;
+  }
+  else {
+    AliWarning(Form("%s: Only works for pA analysis. Returning -1",GetName()));
+    return -1.;
+  }
+}
diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.h b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskDijetHadron.h
new file mode 100644 (file)
index 0000000..cab4f85
--- /dev/null
@@ -0,0 +1,258 @@
+#ifndef ALIANALYSISTASKDIJETHADRON_H
+#define ALIANALYSISTASKDIJETHADRON_H
+
+// $Id$
+#include <vector>
+
+class TH1;
+class TH2;
+class TH3;
+class TH2F;
+class TH1F;
+class TF1;
+class TH3F;
+class THnSparse;
+class TClonesArray;
+class TObject;
+class TString;
+class AliNamedString;
+class AliAODEvent;
+class AliESDEvent;
+class AliMCEvent;
+class AliRhoParameter;
+class TRandom3;
+class AliEmcalJet;
+class AliVTrack;
+class AliNamedArrayI;
+class AliJetContainer;
+class AliParticleContainer;
+class AliClusterContainer;
+
+template<class T> class TParameter;
+
+#include "AliAnalysisTaskSE.h"
+#include "AliEmcalJet.h"
+#include "AliAnalysisTaskEmcalJet.h"
+
+class AliAnalysisTaskDijetHadron : public AliAnalysisTaskEmcalJet {
+ public:
+
+  AliAnalysisTaskDijetHadron();
+  AliAnalysisTaskDijetHadron(const char *name);
+  virtual ~AliAnalysisTaskDijetHadron() {;}
+
+  void                        UserCreateOutputObjects();
+
+  void                        SetJetMinRC2LJ(Float_t d)                            { fMinRC2LJ                = d          ; }
+  void                        SetRCperEvent(Int_t n)                               { fRCperEvent              = n          ; }
+  void                        SetMCJetPtThreshold(Double_t t)                      { fMCJetPtThreshold        = t          ; }
+  void                        SetConeRadius(Double_t r)                            { fConeRadius              = r          ; }
+  void                        SetConeEtaPhiEMCAL() ;
+  void                        SetConeEtaPhiTPC()   ;
+  void                        SetConeEtaLimits(Float_t min, Float_t max)           { fConeMinEta = min, fConeMaxEta = max  ; }
+  void                        SetConePhiLimits(Float_t min, Float_t max)           { fConeMinPhi = min, fConeMaxPhi = max  ; }
+
+ protected:
+  void                        AllocateHistogramArrays()                                                                     ;
+  void                        ExecOnce()                                                                                    ;
+  Bool_t                      FillHistograms()                                                                              ;
+  void                        GetLeadingJets(Int_t &maxJetIndex, Int_t &max2JetIndex)                                       ;
+  AliEmcalJet*                NextEmbeddedJet(Bool_t reset=kFALSE)                                                          ;
+  void                        DoEmbTrackLoop()                                                                              ;
+  void                        DoEmbClusterLoop()                                                                            ;
+  void                        GetRandomCone(Float_t &pt, Float_t &eta, Float_t &phi, AliParticleContainer* tracks, AliClusterContainer* clusters,
+                                           AliEmcalJet *jet = 0, Bool_t bPartialExclusion = 0) const;
+  Double_t                    GetZ(const Double_t trkPx, const Double_t trkPy, const Double_t trkPz, const Double_t jetPx, const Double_t jetPy, const Double_t jetPz);
+  Double_t                    GetNColl() const;
+
+
+  Double_t                    fMCJetPtThreshold;                               // threshold for MC jets
+  Float_t                     fMinRC2LJ;                                       // Minimum distance random cone to leading jet
+  Int_t                       fRCperEvent;                                     // No. of random cones per event
+  Double_t                    fConeRadius;                                     // Radius of the random cones
+  Float_t                     fConeMinEta;                                     // Minimum eta of the random cones
+  Float_t                     fConeMaxEta;                                     // Maximum eta of the random cones
+  Float_t                     fConeMinPhi;                                     // Minimum phi of the random cones
+  Float_t                     fConeMaxPhi;                                     // Maximum phi of the random cones
+
+  AliJetContainer            *fJetsCont;                                       //!PbPb Jets
+  AliParticleContainer       *fTracksCont;                                     //!PbPb Tracks
+  AliClusterContainer        *fCaloClustersCont;                               //!PbPb Clusters  
+  AliJetContainer            *fMCJetsCont;                                     //!MC jets
+  AliParticleContainer       *fMCTracksCont;                                   //!MC tracks
+  AliClusterContainer        *fMCCaloClustersCont;                             //!MC clusters  
+  AliJetContainer            *fEmbJetsCont;                                    //!EMB jets
+  AliParticleContainer       *fEmbTracksCont;                                  //!EMB tracks
+  AliClusterContainer        *fEmbCaloClustersCont;                            //!EMB clusters  
+  //AliParticleContainer       *fRandTracksCont;                               //!Randomized tracks
+  //AliClusterContainer        *fRandCaloClustersCont;                         //!Randomized clusters
+
+  // Random cones
+  TH2                        *fHistRCPhiEta;                                   //!Phi-Eta distribution of random cones
+  TH1                       **fHistRCPt;                                       //!Random cone pt
+  TH1                       **fHistRCPtExLJ;                                   //!Random cone pt, imposing min distance from leading jet
+  TH1                       **fHistRCPtExPartialLJ;                            //!Random cone pt, imposing min distance from leading jet with 1/ncoll probability
+  //TH1                       **fHistRCPtRand;                                 //!Random cone pt, randomized particles
+  TH2                       **fHistRhoVSRCPt;                                  //!Area(RC) * rho vs. Pt(RC)
+  TH2                       **fHistDeltaPtRCvsEP;                              //!deltaPt = Pt(RC) - A * rho vs. event plane
+  TH1                       **fHistDeltaPtRCExLJ;                              //!deltaPt = Pt(RC) - A * rho, imposing min distance from leading jet
+  TH1                       **fHistDeltaPtRCExPartialLJ;                       //!deltaPt = Pt(RC) - A * rho, imposing min distance from leading jet with 1/ncoll probability
+  //TH1                       **fHistDeltaPtRCRand;                            //!deltaPt = Pt(RC) - A * rho, randomzied particles
+
+  // Jet embedding
+  TH3                       **fHistEmbJetsPtArea;                              //!Pt vs. area of EMB jets
+  TH3                       **fHistEmbJetsCorrPtArea;                          //!Pt-rho*A vs. area of EMB jets
+  TH2                       **fHistEmbPartPtvsJetPt;                           //!MC jet pt total jet pt
+  TH2                       **fHistEmbPartPtvsJetCorrPt;                       //!MC jet pt total jet pt - rho*A
+  TH2                       **fHistJetPtvsJetCorrPt;                           //!Pt vs jet pt - rho*A
+  TH1                       **fHistDistLeadPart2JetAxis;                       //!Distance between leading particle and jet axis
+  TH2                       **fHistEmbBkgArea;                                 //!Pt(embjet) - Pt(embtrack) vs. area of EMB jets
+  TH2                       **fHistRhoVSEmbBkg;                                //!Area(embjet) * rho vs. Pt(embjet) - Pt(embtrack)
+  TH2                       **fHistDeltaPtEmbArea;                             //!deltaPt = Pt(embjet) - Area(embjet) * rho - Pt(embtrack) vs. Area(embjet)
+  TH2                       **fHistDeltaPtEmbvsEP;                             //!deltaPt = Pt(embjet) - Area(embjet) * rho - Pt(embtrack) vs. event plane
+  TH2                        *fHistRCPtExLJVSDPhiLJ;                           //!Random cone pt, imposing min distance from leading jet, vs. deltaPhi leading jet
+  TH2                        *fHistRCPtExPartialLJVSDPhiLJ;                    //!Random cone pt, imposing min distance from leading jet, vs. deltaPhi leading jet with 1/ncoll probability
+  TH2                        *fHistEmbJetsPhiEta;                              //!Phi-Eta distribution of EMB jets
+  TH2                        *fHistLeadPartPhiEta;                             //!Phi-Eta distribution of the leading particle of EMB jets
+
+  //User Task
+  TH1                        *fCent_V0;                                        //!Centrality
+  TH1                        *fVertex_z_cut;                                   //!z_vertex_cut
+  TH1                        *fJetBG_rho;                                      //!rhoValue
+  TH2                        *fJetBG_rho_Cent;                                 //!rho vs. Centrality
+  TH1                        **fTrackPt_PbPb;                                  //!PbPb, trackPt
+  TH1                        **fTrackPhi_PbPb;                                 //!PbPb, trackPhi
+  TH1                        **fTrackEta_PbPb;                                 //!PbPb, trackEta
+  TH2                        **fTrack_Phi_Eta_PbPb;                            //!PbPb, trackPhi vs. trackEta
+  TH1                        **fTrackPt_MC;                                    //!MC, trackPt
+  TH1                        **fTrackPhi_MC;                                   //!MC, trackPhi
+  TH1                        **fTrackEta_MC;                                   //!MC, trackEta
+  TH2                        **fTrack_Phi_Eta_MC;                              //!MC, trackPhi vs. trackEta
+  TH1                        **fTrackPt_EMB;                                   //!EMB, trackPt
+  TH1                        **fTrackPhi_EMB;                                  //!EMB, trackPhi
+  TH1                        **fTrackEta_EMB;                                  //!EMB, trackEta
+  TH2                        **fTrack_Phi_Eta_EMB;                             //!EMB, trackPhi vs. trackEta
+  TH1                        *fJetPt_PbPb[4][3];                               //!PbPb, jetPt
+  TH1                        *fJetPhi_PbPb[4][3];                              //!PbPb, jetPhi
+  TH1                        *fJetEta_PbPb[4][3];                              //!PbPb, jetEta
+  TH2                        *fJet_Phi_Eta_PbPb[4][3];                         //!PbPb, jetPhi vs. jetEta
+  TH1                        *fJetPt_BG_PbPb[4][3];                            //!PbPb, pT - rho * area
+  TH1                        *fJet1Pt_PbPb[4][3][4][4];                        //!PbPb, leadingjetPt
+  TH1                        *fJet2Pt_PbPb[4][3][4][4];                        //!PbPb, subleadingjetPt
+  TH1                        *fJet1Pt_BG_PbPb[4][3][4][4];                     //!PbPb, pT - rho * area, jet1
+  TH1                        *fJet2Pt_BG_PbPb[4][3][4][4];                     //!PbPb, pT - rho * area, jet2
+  TH1                        *fJetDeltaPhi_PbPb[4][3][4][4];                   //!PbPb, jetDeltaPhi
+  TH1                        *fJetDeltaEta_PbPb[4][3][4][4];                   //!PbPb, jetDeltaEta
+  TH1                        *fJetDeltaEP_PbPb[4][3][4][4];                    //!PbPb, jetDeltaEP
+  TH1                        *fJet1SelectPt_BG_PbPb[4][3][4][4];               //!PbPb, selectleadingjetPt
+  TH1                        *fJet2SelectPt_BG_PbPb[4][3][4][4];               //!PbPb, selectsubleadingjetPt
+  TH1                        *fAj_PbPb[4][3][4][4];                            //!PbPb, Aj(energy balance) -> Aj = (jet1-jet2)/(jet1+jet2)
+
+  TH1                        *fJetPt_MC[4][3];                                 //!MC, jetPt
+  TH1                        *fJetPhi_MC[4][3];                                //!MC, jetPhi
+  TH1                        *fJetEta_MC[4][3];                                //!MC, jetEta
+  TH2                        *fJet_Phi_Eta_MC[4][3];                           //!MC, jetPhi vs. jetEta
+  TH1                        *fJet1Pt_MC[4][3][4][4];                          //!MC, leadingjetPt
+  TH1                        *fJet2Pt_MC[4][3][4][4];                          //!MC, subleadingjetPt
+  TH1                        *fJetDeltaPhi_MC[4][3][4][4];                     //!MC, jetDeltaPhi
+  TH1                        *fJetDeltaEta_MC[4][3][4][4];                     //!MC, jetDeltaEta
+  TH1                        *fJetDeltaEP_MC[4][3][4][4];                      //!MC, jetDeltaEP
+  TH1                        *fAj_MC[4][3][4][4];                              //!MC, Aj(energy balance) -> Aj = (jet1-jet2)/(jet1+jet2)
+
+  TH1                        *fJetPt_EMB[4][3];                                //!EMB, jetPt
+  TH1                        *fJetPhi_EMB[4][3];                               //!EMB, jetPhi
+  TH1                        *fJetEta_EMB[4][3];                               //!EMB, jetEta
+  TH2                        *fJet_Phi_Eta_EMB[4][3];                          //!EMB, jetPhi vs. jetEta
+  TH1                        *fJetPt_BG_EMB[4][3];                             //!EMB, pT - rho * area
+  TH1                        *fJetDeltaPt[4][3];                               //!EMB, pT - rho * area - pT(embtrack)
+  TH1                        *fJet1Pt_EMB[4][3][4][4];                         //!EMB, leadingjetPt
+  TH1                        *fJet2Pt_EMB[4][3][4][4];                         //!EMB, subleadingjetPt
+  TH1                        *fJet1Pt_BG_EMB[4][3][4][4];                      //!EMB, pT - rho * area, jet1
+  TH1                        *fJet2Pt_BG_EMB[4][3][4][4];                      //!EMB, pT - rho * area, jet2
+  TH1                        *fJet1DeltaPt[4][3][4][4];                        //!EMB, pT - rho * area - pT(embtrack), jet1
+  TH1                        *fJet2DeltaPt[4][3][4][4];                        //!EMB, pT - rho * area - pT(embtrack), jet2
+  TH1                        *fJetDeltaPhi_EMB[4][3][4][4];                    //!EMB, jetDeltaPhi
+  TH1                        *fJetDeltaEta_EMB[4][3][4][4];                    //!EMB, jetDeltaEta
+  TH1                        *fJetDeltaEP_EMB[4][3][4][4];                     //!EMB, jetDeltaEP
+  TH1                        *fJet1SelectPt_BG_EMB[4][3][4][4];                //!EMB, selectleadingjetPt
+  TH1                        *fJet2SelectPt_BG_EMB[4][3][4][4];                //!EMB, selectsubleadingjetPt
+  TH1                        *fJet1SelectDeltaPt[4][3][4][4];                  //!EMB, selectleadingjetPt
+  TH1                        *fJet2SelectDeltaPt[4][3][4][4];                  //!EMB, selectsubleadingjetPt
+  TH1                        *fAj_EMB[4][3][4][4];                             //!EMB, Aj(energy balance) -> Aj = (jet1-jet2)/(jet1+jet2)
+
+  TH1                        *fHJetDeltaPhi_Aj0_PbPb[4][3][4][4][4];           //!PbPb, HjetDeltaPhi, no Aj cut
+  TH1                        *fHJetDeltaPhi_Aj1_PbPb[4][3][4][4][4];           //!PbPb, HjetDeltaPhi, Aj1(0.0 to 0.2)
+  TH1                        *fHJetDeltaPhi_Aj2_PbPb[4][3][4][4][4];           //!PbPb, HjetDeltaPhi, Aj2(0.2 to 0.4)
+  TH1                        *fHJetDeltaPhi_Aj3_PbPb[4][3][4][4][4];           //!PbPb, HjetDeltaPhi, Aj3(0.4 to 0.6)
+  TH1                        *fHJetDeltaPhi_Aj4_PbPb[4][3][4][4][4];           //!PbPb, HjetDeltaPhi, Aj4(0.6 to 0.8)
+  TH1                        *fHJetPt_Aj0_PbPb[4][3][4][4][4];                 //!PbPb, HjetPt, no Aj cut
+  TH1                        *fHJetPt_Aj1_PbPb[4][3][4][4][4];                 //!PbPb, HjetPt, Aj1
+  TH1                        *fHJetPt_Aj2_PbPb[4][3][4][4][4];                 //!PbPb, HjetPt, Aj2
+  TH1                        *fHJetPt_Aj3_PbPb[4][3][4][4][4];                 //!PbPb, HjetPt, Aj3
+  TH1                        *fHJetPt_Aj4_PbPb[4][3][4][4][4];                 //!PbPb, HjetPt, Aj4
+  TH1                        *fHJetDeltaPhi_Aj0_MC[4][3][4][4][4];             //!MC, HjetDeltaPhi, no Aj cut
+  TH1                        *fHJetDeltaPhi_Aj1_MC[4][3][4][4][4];             //!MC, HjetDeltaPhi, Aj1(0.0 to 0.2)
+  TH1                        *fHJetDeltaPhi_Aj2_MC[4][3][4][4][4];             //!MC, HjetDeltaPhi, Aj2(0.2 to 0.4)
+  TH1                        *fHJetDeltaPhi_Aj3_MC[4][3][4][4][4];             //!MC, HjetDeltaPhi, Aj3(0.4 to 0.6)
+  TH1                        *fHJetDeltaPhi_Aj4_MC[4][3][4][4][4];             //!MC, HjetDeltaPhi, Aj4(0.6 to 0.8)
+  TH1                        *fHJetPt_Aj0_MC[4][3][4][4][4];                   //!MC, HjetPt, no Aj cut
+  TH1                        *fHJetPt_Aj1_MC[4][3][4][4][4];                   //!MC, HjetPt, Aj1
+  TH1                        *fHJetPt_Aj2_MC[4][3][4][4][4];                   //!MC, HjetPt, Aj2
+  TH1                        *fHJetPt_Aj3_MC[4][3][4][4][4];                   //!MC, HjetPt, Aj3
+  TH1                        *fHJetPt_Aj4_MC[4][3][4][4][4];                   //!MC, HjetPt, Aj4
+  TH1                        *fHJetDeltaPhi_Aj0_EMB[4][3][4][4][4];            //!EMB, HjetDeltaPhi, no Aj cut
+  TH1                        *fHJetDeltaPhi_Aj1_EMB[4][3][4][4][4];            //!EMB, HjetDeltaPhi, Aj1(0.0 to 0.2)
+  TH1                        *fHJetDeltaPhi_Aj2_EMB[4][3][4][4][4];            //!EMB, HjetDeltaPhi, Aj2(0.2 to 0.4)
+  TH1                        *fHJetDeltaPhi_Aj3_EMB[4][3][4][4][4];            //!EMB, HjetDeltaPhi, Aj3(0.4 to 0.6)
+  TH1                        *fHJetDeltaPhi_Aj4_EMB[4][3][4][4][4];            //!EMB, HjetDeltaPhi, Aj4(0.6 to 0.8)
+  TH1                        *fHJetPt_Aj0_EMB[4][3][4][4][4];                  //!EMB, HjetPt, no Aj cut
+  TH1                        *fHJetPt_Aj1_EMB[4][3][4][4][4];                  //!EMB, HjetPt, Aj1
+  TH1                        *fHJetPt_Aj2_EMB[4][3][4][4][4];                  //!EMB, HjetPt, Aj2
+  TH1                        *fHJetPt_Aj3_EMB[4][3][4][4][4];                  //!EMB, HjetPt, Aj3
+  TH1                        *fHJetPt_Aj4_EMB[4][3][4][4][4];                  //!EMB, HjetPt, Aj4
+
+  TH1                        *fHJetDeltaPhiasEP_Aj0_PbPb[4][4][4][4][4];       //!PbPb, HjetDeltaPhi, asEP, no Aj cut
+  TH1                        *fHJetDeltaPhiasEP_Aj1_PbPb[4][4][4][4][4];       //!PbPb, HjetDeltaPhi, asEP, Aj1
+  TH1                        *fHJetDeltaPhiasEP_Aj2_PbPb[4][4][4][4][4];       //!PbPb, HjetDeltaPhi, asEP, Aj2
+  TH1                        *fHJetDeltaPhiasEP_Aj3_PbPb[4][4][4][4][4];       //!PbPb, HjetDeltaPhi, asEP, Aj3
+  TH1                        *fHJetDeltaPhiasEP_Aj4_PbPb[4][4][4][4][4];       //!PbPb, HjetDeltaPhi, asEP, Aj4
+  TH1                        *fHJetPtasEP_Aj0_PbPb[4][4][4][4][4];             //!PbPb, HjetPt, asEP, no Aj cut
+  TH1                        *fHJetPtasEP_Aj1_PbPb[4][4][4][4][4];             //!PbPb, HjetPt, asEP, Aj1
+  TH1                        *fHJetPtasEP_Aj2_PbPb[4][4][4][4][4];             //!PbPb, HjetPt, asEP, Aj2
+  TH1                        *fHJetPtasEP_Aj3_PbPb[4][4][4][4][4];             //!PbPb, HjetPt, asEP, Aj3
+  TH1                        *fHJetPtasEP_Aj4_PbPb[4][4][4][4][4];             //!PbPb, HjetPt, asEP, Aj4
+  TH1                        *fHJetDeltaPhiasEP_Aj0_MC[4][4][4][4][4];         //!MC, HjetDeltaPhi, asEP, no Aj cut
+  TH1                        *fHJetDeltaPhiasEP_Aj1_MC[4][4][4][4][4];         //!MC, HjetDeltaPhi, asEP, Aj1
+  TH1                        *fHJetDeltaPhiasEP_Aj2_MC[4][4][4][4][4];         //!MC, HjetDeltaPhi, asEP, Aj2
+  TH1                        *fHJetDeltaPhiasEP_Aj3_MC[4][4][4][4][4];         //!MC, HjetDeltaPhi, asEP, Aj3
+  TH1                        *fHJetDeltaPhiasEP_Aj4_MC[4][4][4][4][4];         //!MC, HjetDeltaPhi, asEP, Aj4
+  TH1                        *fHJetPtasEP_Aj0_MC[4][4][4][4][4];               //!MC, HjetPt, asEP, no Aj cut
+  TH1                        *fHJetPtasEP_Aj1_MC[4][4][4][4][4];               //!MC, HjetPt, asEP, Aj1
+  TH1                        *fHJetPtasEP_Aj2_MC[4][4][4][4][4];               //!MC, HjetPt, asEP, Aj2
+  TH1                        *fHJetPtasEP_Aj3_MC[4][4][4][4][4];               //!MC, HjetPt, asEP, Aj3
+  TH1                        *fHJetPtasEP_Aj4_MC[4][4][4][4][4];               //!MC, HjetPt, asEP, Aj4
+  TH1                        *fHJetDeltaPhiasEP_Aj0_EMB[4][4][4][4][4];        //!EMB, HjetDeltaPhi, asEP, no Aj cut
+  TH1                        *fHJetDeltaPhiasEP_Aj1_EMB[4][4][4][4][4];        //!EMB, HjetDeltaPhi, asEP, Aj1
+  TH1                        *fHJetDeltaPhiasEP_Aj2_EMB[4][4][4][4][4];        //!EMB, HjetDeltaPhi, asEP, Aj2
+  TH1                        *fHJetDeltaPhiasEP_Aj3_EMB[4][4][4][4][4];        //!EMB, HjetDeltaPhi, asEP, Aj3
+  TH1                        *fHJetDeltaPhiasEP_Aj4_EMB[4][4][4][4][4];        //!EMB, HjetDeltaPhi, asEP, Aj4
+  TH1                        *fHJetPtasEP_Aj0_EMB[4][4][4][4][4];              //!EMB, HjetPt, asEP, no Aj cut
+  TH1                        *fHJetPtasEP_Aj1_EMB[4][4][4][4][4];              //!EMB, HjetPt, asEP, Aj1
+  TH1                        *fHJetPtasEP_Aj2_EMB[4][4][4][4][4];              //!EMB, HjetPt, asEP, Aj2
+  TH1                        *fHJetPtasEP_Aj3_EMB[4][4][4][4][4];              //!EMB, HjetPt, asEP, Aj3
+  TH1                        *fHJetPtasEP_Aj4_EMB[4][4][4][4][4];              //!EMB, HjetPt, asEP, Aj4
+
+
+ private:
+  AliVEvent                  *fEvent;
+  Double_t                    fCentrality;                                     //! V0M for current event
+  //AliNamedString             *fPtHardBinName;                                //!Pt hard bin param
+  //Int_t                       fPtHardBin;                                    //!        
+  //TH1F                        *fhPtHardBins;                                 //!
+
+  AliAnalysisTaskDijetHadron(const AliAnalysisTaskDijetHadron&);                     // not implemented
+  AliAnalysisTaskDijetHadron &operator=(const AliAnalysisTaskDijetHadron&);          // not implemented
+
+  ClassDef(AliAnalysisTaskDijetHadron, 5)                                         // Jet-Hadron analysis task
+};
+#endif
diff --git a/PWGJE/EMCALJetTasks/macros/AddTaskDijetHadron.C b/PWGJE/EMCALJetTasks/macros/AddTaskDijetHadron.C
new file mode 100644 (file)
index 0000000..baf2f75
--- /dev/null
@@ -0,0 +1,154 @@
+AliAnalysisTaskDijetHadron* AddTaskDijetHadron(
+  const char *ntracks            = "Tracks",
+  const char *nclusters          = "CaloClusters",
+  const char *njets              = "Jets",
+  const char *nMCtracks            = "TracksMC",
+  const char *nMCclusters          = "CaloClustersMC",
+  const char *nMCjets              = "JetsMC",
+  const char *nembtracks         = "TracksEmbedded",
+  const char *nembclusters       = "CaloClustersEmbedded",
+  const char *nembjets           = "EmbJets",
+  const char *nrandtracks        = "TracksRandomized",
+  const char *nrandclusters      = "CaloClustersRandomized",
+  const char *nPbPbrho               = "Rho",
+  const char *nMCrho               = "RhoMC",
+  const char *nEMBrho               = "RhoEMB",
+  Double_t    jetradius          = 0.2,
+  Double_t    jetareacut         = 0.557,
+  Double_t    trackptcut         = 0.15,
+  Double_t    clusptcut          = 0.30,
+  const char *type               = "TPC",
+  const char *taskname           = "AliAnalysisTaskDijetHadron"
+)
+{  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr)
+  {
+    ::Error("AddTaskHJetCorr", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler())
+  {
+    ::Error("AddTaskHJetCorr", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  //-------------------------------------------------------
+  // Init the task and do settings
+  //-------------------------------------------------------
+  TString name;
+  if (strcmp(ntracks, "") == 0 && strcmp(nclusters, "") == 0) 
+    name = Form("%s_%s_R0%d_%s",taskname,nPbPbrho,(Int_t)floor(jetradius*100+0.5),type);
+  else if (strcmp(ntracks, "") == 0) 
+    name = Form("%s_%s_%s_R0%d_%s",taskname,nclusters,nPbPbrho,(Int_t)floor(jetradius*100+0.5),type);
+  else if (strcmp(nclusters, "") == 0) 
+    name = Form("%s_%s_%s_R0%d_%s",taskname,ntracks,nPbPbrho,(Int_t)floor(jetradius*100+0.5),type);
+  else
+    name = Form("%s_%s_%s_%s_R0%d_%s",taskname,ntracks,nclusters,nPbPbrho,(Int_t)floor(jetradius*100+0.5),type);
+
+  AliAnalysisTaskDijetHadron* jetTask = new AliAnalysisTaskDijetHadron(name);
+  jetTask->SetConeRadius(jetradius);
+  jetTask->SetRhoName(nPbPbrho,-1);
+  if (strcmp(type,"TPC")==0) 
+    jetTask->SetConeEtaPhiTPC();
+  else if (strcmp(type,"EMCAL")==0) 
+    jetTask->SetConeEtaPhiEMCAL();
+
+  AliParticleContainer *partCont = jetTask->AddParticleContainer(ntracks);
+  if (partCont) {
+    partCont->SetName("Tracks");
+    partCont->SetParticlePtCut(trackptcut);
+  }
+
+  AliClusterContainer *clusCont = jetTask->AddClusterContainer(nclusters);
+  if (clusCont) {
+    clusCont->SetName("CaloClusters");
+    clusCont->SetClusPtCut(clusptcut);
+  }
+
+  AliJetContainer *jetCont = jetTask->AddJetContainer(njets,type,jetradius);
+  if (jetCont) {
+    jetCont->SetName("Jets");
+    jetCont->SetPercAreaCut(jetareacut);
+    jetCont->SetRhoName(nPbPbrho);
+    jetCont->ConnectParticleContainer(partCont);
+    jetCont->ConnectClusterContainer(clusCont);
+  }
+
+  AliParticleContainer *MCpartCont = jetTask->AddParticleContainer(nMCtracks);
+  if (partCont) {
+    MCpartCont->SetName("MCTracks");
+    MCpartCont->SetParticlePtCut(trackptcut);
+  }
+
+  AliClusterContainer *MCclusCont = jetTask->AddClusterContainer(nMCclusters);
+  if (clusCont) {
+    MCclusCont->SetName("MCCaloClusters");
+    MCclusCont->SetClusPtCut(clusptcut);
+  }
+
+  AliJetContainer *MCjetCont = jetTask->AddJetContainer(nMCjets,type,jetradius);
+  if (jetCont) {
+    MCjetCont->SetName("MCJets");
+    MCjetCont->SetPercAreaCut(jetareacut);
+    MCjetCont->SetRhoName(nMCrho);
+    MCjetCont->ConnectParticleContainer(MCpartCont);
+    MCjetCont->ConnectClusterContainer(MCclusCont);
+  }
+
+  AliParticleContainer *embPartCont = jetTask->AddParticleContainer(nembtracks);
+  if (embPartCont) {
+    embPartCont->SetName("EmbTracks");
+    embPartCont->SetParticlePtCut(trackptcut);
+  }
+
+  AliClusterContainer *embClusCont = jetTask->AddClusterContainer(nembclusters);
+  if (embClusCont) {
+    embClusCont->SetName("EmbClusters");
+    embClusCont->SetClusPtCut(clusptcut);
+  }
+
+  AliJetContainer *embJetCont = jetTask->AddJetContainer(nembjets,type,jetradius);
+  if (embJetCont) {
+    embJetCont->SetName("EmbJets");
+    embJetCont->SetPercAreaCut(jetareacut);
+    embJetCont->SetRhoName(nEMBrho);
+    embJetCont->ConnectParticleContainer(embPartCont);
+    embJetCont->ConnectClusterContainer(embClusCont);
+  }
+
+  /*AliParticleContainer *randPartCont = jetTask->AddParticleContainer(nrandtracks);
+  if (randPartCont) {
+    randPartCont->SetName("RandTracks");
+    randPartCont->SetParticlePtCut(trackptcut);
+  }
+
+  AliClusterContainer *randClusCont = jetTask->AddClusterContainer(nrandclusters);    
+  if (randClusCont) {
+    randClusCont->SetName("RandClusters");
+    randClusCont->SetClusPtCut(clusptcut);
+  }*/
+  
+  //-------------------------------------------------------
+  // Final settings, pass to manager and set the containers
+  //-------------------------------------------------------
+  
+  mgr->AddTask(jetTask);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
+  TString contname(name);
+  contname += "_histos";
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(), 
+                                                           TList::Class(),AliAnalysisManager::kOutputContainer,
+                                                           Form("%s", AliAnalysisManager::GetCommonFileName()));
+  mgr->ConnectInput(jetTask, 0, cinput1);
+  mgr->ConnectOutput(jetTask, 1, coutput1);
+  
+  return jetTask;
+}
index 2f66f9c..77e0235 100644 (file)
@@ -37,6 +37,7 @@
 #pragma link C++ class AliAnalysisTaskChargedJetsPA;
 #pragma link C++ class AliAnalysisTaskDcalDijetPerf;
 #pragma link C++ class AliAnalysisTaskDeltaPtJEmb+;
+#pragma link C++ class AliAnalysisTaskDijetHadron+;
 #pragma link C++ class AliAnalysisTaskEmcalBadCells+;
 #pragma link C++ class AliAnalysisTaskEmcalDiJetBase+;
 #pragma link C++ class AliAnalysisTaskEmcalDiJetAna+;