]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
update for background subtraction
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Jun 2013 09:23:23 +0000 (09:23 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Jun 2013 09:23:23 +0000 (09:23 +0000)
PWGGA/CaloTrackCorrelations/AliAnaChargedParticles.cxx
PWGGA/CaloTrackCorrelations/AliAnaChargedParticles.h
PWGGA/CaloTrackCorrelations/AliAnaParticleHadronCorrelation.cxx
PWGGA/CaloTrackCorrelations/AliAnaParticleHadronCorrelation.h
PWGGA/CaloTrackCorrelations/AliAnaParticleIsolation.cxx
PWGGA/CaloTrackCorrelations/AliAnaParticleIsolation.h
PWGGA/CaloTrackCorrelations/AliAnaPhoton.cxx

index 89e4e6a80625e49a3dd7a9a0573480fb17955454..5270309c1465825d452123ca168156fa9f244162 100755 (executable)
@@ -63,6 +63,8 @@ ClassImp(AliAnaChargedParticles)
     fhPtElectron(0),   fhPhiElectron(0),     fhEtaElectron(0),
     fhPtKaon(0),       fhPhiKaon(0),         fhEtaKaon(0),
     fhPtUnknown(0),    fhPhiUnknown(0),      fhEtaUnknown(0),
+    fhMCPt(0),         fhMCPhi(0),           fhMCEta(0),
+    fhMCRecPt(0),
     //TOF
     fhTOFSignal(0),    fhTOFSignalPtCut(0),  fhTOFSignalBCOK(0),
     fhPtTOFSignal(0),  fhPtTOFSignalDCACut(0),
@@ -588,7 +590,22 @@ TList *  AliAnaChargedParticles::GetCreateOutputObjects()
     fhEtaUnknown  = new TH2F ("hEtaMCUnknown","#eta distribution from unknown",nptbins,ptmin,ptmax, netabins,etamin,etamax); 
     fhEtaUnknown->SetXTitle("#eta ");
     outputContainer->Add(fhEtaUnknown);
-    
+
+    fhMCPt  = new TH1F ("hMCPt","p_T distribution from MC", nptbins,ptmin,ptmax); 
+    fhMCPt->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhMCPt);
+
+    fhMCPhi  = new TH2F ("hMCPhi","#phi distribution from MC",nptbins,ptmin,ptmax, nphibins,phimin,phimax); 
+    fhMCPhi->SetXTitle("#phi (rad)");
+    outputContainer->Add(fhMCPhi);
+   
+    fhMCEta  = new TH2F ("hMCEta","#eta distribution from MC",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
+    fhMCEta->SetXTitle("#eta (rad)");
+    outputContainer->Add(fhMCEta);
+
+    fhMCRecPt  = new TH1F ("hMCRecPt","p_T distribution from Rec MC", nptbins,ptmin,ptmax); 
+    fhMCRecPt->SetXTitle("p_{T} (GeV/c)");
+    outputContainer->Add(fhMCRecPt);
   }
   
   return outputContainer;
@@ -1108,24 +1125,29 @@ void  AliAnaChargedParticles::MakeAnalysisFillHistograms()
     
     if(IsDataMC())
     {
-      //Play with the MC stack if available            
+      //Play with the MC stack if available
       Int_t mompdg = -1;
       Int_t label  = track->GetLabel();
+
       if(label >= 0)
-      {
-        if( GetReader()->ReadStack() && label < GetMCStack()->GetNtrack())
-        {
-          TParticle * mom = GetMCStack()->Particle(label);
-          mompdg =TMath::Abs(mom->GetPdgCode());
-        }
-        else if(GetReader()->ReadAODMCParticles())
-        {
-          AliAODMCParticle * aodmom = 0;
-          //Get the list of MC particles
-          aodmom = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label);
-          mompdg =TMath::Abs(aodmom->GetPdgCode());
-        }
-      }
+       {
+         if( GetReader()->ReadStack() && label < GetMCStack()->GetNtrack())
+           {
+             TParticle * mom = GetMCStack()->Particle(label);
+             mompdg =TMath::Abs(mom->GetPdgCode());
+           }
+         else if(GetReader()->ReadAODMCParticles())
+           {
+             AliAODMCParticle * aodmom = 0;
+             //Get the list of MC particles
+             aodmom = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label);
+             mompdg =TMath::Abs(aodmom->GetPdgCode());
+           }
+       }
+
+      if(mompdg==211 || mompdg==2212 || mompdg==321 || mompdg==11){
+       if(TMath::Abs(eta) < 0.8 && phi < 3.145) fhMCRecPt->Fill(pt);
+      } 
       
       if(mompdg==211)
       {
@@ -1156,10 +1178,46 @@ void  AliAnaChargedParticles::MakeAnalysisFillHistograms()
         fhPtUnknown ->Fill(pt);
         fhPhiUnknown->Fill(pt, phi);
         fhEtaUnknown->Fill(pt, eta);
-      }
-      
+      }     
     }//Work with stack also
     
   }// aod branch loop
   
-}
+  if(IsDataMC())
+    {
+      Int_t primpdg = -1;
+      if(GetReader()->ReadStack()) {   
+       AliStack * stack = GetMCStack();
+       if(stack) {
+         for(Int_t i=0 ; i<stack->GetNtrack(); i++){
+           TParticle *prim = stack->Particle(i);
+           primpdg = TMath::Abs(prim->GetPdgCode());
+           if(primpdg == 211 || primpdg == 2212 || primpdg == 321 || primpdg == 11){
+             if(prim->IsPrimary() && TMath::Abs(prim->Eta()) < 0.8 && prim->Phi() < 3.145){
+               fhMCPt->Fill(prim->Pt());
+               fhMCPhi->Fill(prim->Pt(),prim->Phi());
+               fhMCEta->Fill(prim->Pt(),prim->Eta());
+             }
+           }
+         }
+       }
+      }
+      else if(GetReader()->ReadAODMCParticles()){
+       TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
+       if(mcparticles){
+         Int_t nprim = mcparticles->GetEntriesFast();
+         for(Int_t i=0; i < nprim; i++){
+           AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i); 
+           primpdg = TMath::Abs(prim->GetPdgCode());
+           if(primpdg == 211 || primpdg == 2212 || primpdg == 321 || primpdg == 11){
+             if(prim->IsPhysicalPrimary() && TMath::Abs(prim->Eta()) < 0.8 && prim->Phi() < 3.145){
+               fhMCPt->Fill(prim->Pt());
+               fhMCPhi->Fill(prim->Pt(),prim->Phi());
+               fhMCEta->Fill(prim->Pt(),prim->Eta());
+             }
+           }
+         }
+       }
+      }
+    }
+  }
index 5f710eccc28c83fb0a755dc632f40394631b2d6a..8b5fc1844d0c792b0b822f6b27342719bec2ce82 100755 (executable)
@@ -98,7 +98,12 @@ class AliAnaChargedParticles : public AliAnaCaloTrackCorrBaseClass {
   TH1F * fhPtUnknown;   //! pT distribution
   TH2F * fhPhiUnknown;  //! phi distribution vs pT
   TH2F * fhEtaUnknown;  //! eta distribution vs pT
-  
+
+  TH1F * fhMCPt; //! Number of generated charged hadrons vs pT coming from MC particle
+  TH2F * fhMCPhi; //! Number of generated charged hadrons vs phi coming from MC particle
+  TH2F * fhMCEta; //! Number of generated charged hadrons vs eta coming from MC particle
+  TH1F * fhMCRecPt; //! Number of reconstructed charged hadrons vs pT coming from MC particle
+
   // TOF
   TH1F * fhTOFSignal;                    //! TOF signal
   TH1F * fhTOFSignalPtCut;               //! TOF signal pt and acceptance cut
index 16c600fad9ea3762cbb6675a7e61b492613afb4d..287fe2f33d129a8a410ffc891f0799c6f8482f10 100755 (executable)
@@ -90,9 +90,9 @@ ClassImp(AliAnaParticleHadronCorrelation)
     fhDeltaPhiCharged(0),           fhDeltaEtaCharged(0), 
     fhDeltaPhiChargedPt(0),         fhDeltaPhiUeChargedPt(0), 
     fhUePart(0),
-    fhXECharged(0),                 fhXEUeCharged(0),
+    fhXECharged(0),                 fhXECharged_Cone2(0),            fhXEUeCharged(0),
     fhXEPosCharged(0),              fhXENegCharged(0),
-    fhPtHbpXECharged(0),            fhPtHbpXEUeCharged(0),
+    fhPtHbpXECharged(0),            fhPtHbpXECharged_Cone2(0),             fhPtHbpXEUeCharged(0),
     fhZTCharged(0),                 fhZTUeCharged(0),
     fhZTPosCharged(0),              fhZTNegCharged(0),
     fhPtHbpZTCharged(0),            fhPtHbpZTUeCharged(0),
@@ -472,7 +472,7 @@ Bool_t AliAnaParticleHadronCorrelation::FillChargedMCCorrelationHistograms(Float
 void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(Float_t ptTrig,   Float_t ptAssoc, 
                                                                              Float_t xE,       Float_t hbpXE, 
                                                                              Float_t zT,       Float_t hbpZT, 
-                                                                             Float_t pout,
+                                                                             Float_t pout,     Float_t deltaPhi,
                                                                              Int_t   nTracks,  Int_t   charge,
                                                                              Int_t   bin,      Bool_t  decay,
                                                                              Int_t   outTOF,   Int_t   mcTag)
@@ -480,12 +480,16 @@ void AliAnaParticleHadronCorrelation::FillChargedMomentumImbalanceHistograms(Flo
 {
   // Fill mostly momentum imbalance related histograms
   
-  fhXECharged         ->Fill(ptTrig , xE); 
+  fhXECharged         ->Fill(ptTrig , xE);
   fhPtHbpXECharged    ->Fill(ptTrig , hbpXE);
   fhZTCharged         ->Fill(ptTrig , zT); 
   fhPtHbpZTCharged    ->Fill(ptTrig , hbpZT);
   fhPtTrigPout        ->Fill(ptTrig , pout) ;
   fhPtTrigCharged     ->Fill(ptTrig , ptAssoc) ;
+  if((deltaPhi > 5*TMath::Pi()/6.)   && (deltaPhi < 7*TMath::Pi()/6.)) {
+    fhXECharged_Cone2         ->Fill(ptTrig , xE);
+    fhPtHbpXECharged_Cone2    ->Fill(ptTrig , hbpXE);
+  }
   
   // Pile up studies
   if(fFillPileUpHistograms) 
@@ -1220,6 +1224,12 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
              nptbins,ptmin,ptmax,200,0.,2.); 
     fhXECharged->SetYTitle("x_{E}");
     fhXECharged->SetXTitle("p_{T trigger} (GeV/c)");
+
+    fhXECharged_Cone2  = 
+    new TH2F("hXECharged_Cone2","x_{E} for charged tracks in cone 2 (5#pi/6-7#pi/6)",
+             nptbins,ptmin,ptmax,200,0.,2.); 
+    fhXECharged_Cone2->SetYTitle("x_{E}");
+    fhXECharged_Cone2->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhXEUeCharged  = 
     new TH2F("hXEUeCharged","x_{E} for Underlying Event",
@@ -1244,6 +1254,12 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
              nptbins,ptmin,ptmax,200,0.,10.); 
     fhPtHbpXECharged->SetYTitle("ln(1/x_{E})");
     fhPtHbpXECharged->SetXTitle("p_{T trigger} (GeV/c)");
+
+    fhPtHbpXECharged_Cone2  = 
+    new TH2F("hHbpXECharged_Cone2","#xi = ln(1/x_{E}) with charged hadrons in cone 2 (5#pi/6-7#pi/6)",
+             nptbins,ptmin,ptmax,200,0.,10.); 
+    fhPtHbpXECharged_Cone2->SetYTitle("ln(1/x_{E})");
+    fhPtHbpXECharged_Cone2->SetXTitle("p_{T trigger} (GeV/c)");
     
     fhPtHbpXEUeCharged  = 
     new TH2F("hHbpXEUeCharged","#xi = ln(1/x_{E}) with charged hadrons,Underlying Event",
@@ -1312,7 +1328,7 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     outputContainer->Add(fhUePart);
 
     outputContainer->Add(fhXECharged) ;
-  
+    outputContainer->Add(fhXECharged_Cone2) ;
     if(IsDataMC())
     {
       for(Int_t i=0; i < 7; i++)
@@ -1338,6 +1354,7 @@ TList *  AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
     outputContainer->Add(fhXENegCharged) ;
     outputContainer->Add(fhXEUeCharged) ;
     outputContainer->Add(fhPtHbpXECharged) ;
+    outputContainer->Add(fhPtHbpXECharged_Cone2) ;
     outputContainer->Add(fhPtHbpXEUeCharged) ;
 
     outputContainer->Add(fhZTCharged) ;
@@ -3013,7 +3030,7 @@ Bool_t  AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Partic
       if  ( (deltaPhi > fDeltaPhiMinCut)   && (deltaPhi < fDeltaPhiMaxCut)   )
       {
         
-        FillChargedMomentumImbalanceHistograms(ptTrig, pt, xE, hbpXE, zT, hbpZT, pout, 
+        FillChargedMomentumImbalanceHistograms(ptTrig, pt, xE, hbpXE, zT, hbpZT, pout, deltaPhi, 
                                                nTracks, track->Charge(), bin, decay,outTOF,mcTag);
         
       }
index 5b6db12b355d40049e57255f8e4a0e5a0223f7c2..ed66bb3242bb45492bc8bc4fe14222d5d479a8a4 100755 (executable)
@@ -74,7 +74,7 @@ class AliAnaParticleHadronCorrelation : public AliAnaCaloTrackCorrBaseClass {
   void         FillChargedMomentumImbalanceHistograms   (Float_t ptTrig,   Float_t ptAssoc, 
                                                          Float_t xE,       Float_t hbpXE, 
                                                          Float_t zT,       Float_t hbpZT, 
-                                                         Float_t pout,     Int_t   nTracks,  Int_t charge,
+                                                         Float_t pout,     Float_t deltaPhi, Int_t   nTracks,  Int_t charge,
                                                          Int_t   assocBin, Bool_t  decay,
                                                          Int_t outTOF,    Int_t mcTag );
   
@@ -255,10 +255,12 @@ class AliAnaParticleHadronCorrelation : public AliAnaCaloTrackCorrBaseClass {
   TH2F *       fhDeltaPhiUeChargedPt ;         //! Difference of charged particle from underlying events phi and trigger particle  phi as function of charged particle pT
   TH1F *       fhUePart;                       //! UE particles distribution vs pt trig
   TH2F *       fhXECharged  ;                  //! Trigger particle -charged hadron momentum imbalance histogram
+  TH2F *       fhXECharged_Cone2  ;            //! Trigger particle -charged hadron momentum imbalance histogram in cone2 (5pi/6-7pi/6)
   TH2F *       fhXEUeCharged  ;                //! Trigger particle -underlying charged hadron momentum imbalance histogram  
   TH2F *       fhXEPosCharged  ;               //! Trigger particle -positive charged hadron momentum imbalance histogram
   TH2F *       fhXENegCharged  ;               //! Trigger particle -negative charged hadron momentum imbalance histogram 
   TH2F *       fhPtHbpXECharged  ;             //! Trigger particle -charged hadron momentum HBP histogram
+  TH2F *       fhPtHbpXECharged_Cone2  ;       //! Trigger particle -charged hadron momentum HBP histogram in cone2 (5pi/6-7pi/6)
   TH2F *       fhPtHbpXEUeCharged  ;           //! Trigger particle -underlying charged hadron momentum HBP histogram  
   TH2F *       fhZTCharged  ;                  //! Trigger particle -charged hadron momentum imbalance histogram
   TH2F *       fhZTUeCharged  ;                //! Trigger particle -underlying charged hadron momentum imbalance histogram  
index 7a0af5bac23c08d5d82dcb97d5659100ec5835d9..307598b41c1d71439386624eafe814a079c25809 100755 (executable)
@@ -117,6 +117,8 @@ fhConeSumPtSubvsConeSumPtTotPhiCluster(0),  fhConeSumPtSubNormvsConeSumPtTotPhiC
 fhConeSumPtSubvsConeSumPtTotEtaCluster(0),  fhConeSumPtSubNormvsConeSumPtTotEtaCluster(0),
 fhConeSumPtSubvsConeSumPtTotPhiCell(0),     fhConeSumPtSubNormvsConeSumPtTotPhiCell(0),
 fhConeSumPtSubvsConeSumPtTotEtaCell(0),     fhConeSumPtSubNormvsConeSumPtTotEtaCell(0),
+fhConeSumPtVSUETracksEtaBand(0),            fhConeSumPtVSUETracksPhiBand(0),
+fhConeSumPtVSUEClusterEtaBand(0),           fhConeSumPtVSUEClusterPhiBand(0),
 // MC histograms
 fhPtIsoPrompt(0),                 fhPhiIsoPrompt(0),               fhEtaIsoPrompt(0), 
 fhPtThresIsolatedPrompt(),        fhPtFracIsolatedPrompt(),        fhPtSumIsolatedPrompt(),
@@ -521,7 +523,7 @@ void AliAnaParticleIsolation::CalculateTrackUEBand(AliAODPWG4ParticleCorrelation
     
     if(!track)
     {
-      printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Track not available?");
+      printf("AliAnaParticleIsolation::CalculateTrackUEBand() - Track not available?");
       continue;
     }
     
@@ -582,121 +584,10 @@ void AliAnaParticleIsolation::CalculateTrackUEBand(AliAODPWG4ParticleCorrelation
 }
 
 
-//________________________________________________________________________________________________________
-Float_t AliAnaParticleIsolation::CalculateExcessAreaFraction(const Float_t excess, const Float_t conesize)
-{
-  // Area of a circunference segment segment 1/2 R^2 (angle-sin(angle)), angle = 2*ACos((R-excess)/R)
-  
-  
-  Float_t angle   = 2*TMath::ACos( (conesize-excess) / conesize );
-  
-  Float_t coneA   = conesize*conesize*TMath::Pi(); // A = pi R^2, isolation cone area
-  
-  Float_t excessA = conesize*conesize / 2 * (angle-TMath::Sin(angle));
-  
-  if(coneA > excessA) return coneA / (coneA-excessA);
-  else
-  {
-    printf("AliAnaParticleIsolation::CalculateExcessAreaFraction() - Please Check : Excess Track %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",
-           excess,coneA, excessA, angle*TMath::RadToDeg(), coneA / (coneA-excessA));
-    return  1;
-  }
-}
-//__________________________________________________________________________________
-void AliAnaParticleIsolation::GetCoeffNormBadCell(const AliAODPWG4ParticleCorrelation * pCandidate, 
-                                        const AliCaloTrackReader * reader,  Float_t &  coneBadCellsCoeff, Float_t &  etaBandBadCellsCoeff, Float_t & phiBandBadCellsCoeff, const Float_t conesize) 
-{
-  // Get good cell density (number of active cells over all cells in cone)
-  
-   Double_t coneCells    = 0.; //number of cells in cone with radius fConeSize
-  Double_t  phiBandCells    = 0.; //number of cells in band phi
-  Double_t etaBandCells    = 0.; //number of cells in band eta
- Float_t phiC  = pCandidate->Phi() ;
-  if(phiC<0) phiC+=TMath::TwoPi();
-  Float_t etaC  = pCandidate->Eta() ;
-  
-  if(pCandidate->GetDetector()=="EMCAL")
-  {
-    AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
-    AliCalorimeterUtils *cu = reader->GetCaloUtils();
-    
-    Int_t absId = -999;
-    if (eGeom->GetAbsCellIdFromEtaPhi(etaC,phiC,absId))
-    {
-      //Get absolute (col,row) of candidate
-      Int_t iEta=-1, iPhi=-1, iRCU = -1;      
-      Int_t nSupMod = cu->GetModuleNumberCellIndexes(absId, pCandidate->GetDetector(), iEta, iPhi, iRCU);
-      
-      Int_t colC = iEta;
-      if (nSupMod % 2) colC =  AliEMCALGeoParams::fgkEMCALCols + iEta ;
-      Int_t rowC = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
-      
-      Int_t sqrSize = int(conesize/0.0143) ; // Size of cell in radians
-      for(Int_t icol = 0; icol < 2*AliEMCALGeoParams::fgkEMCALCols-1;icol++)
-      {
-        for(Int_t irow = 0; irow < 5*AliEMCALGeoParams::fgkEMCALRows -1; irow++)
-        {
-           //loop on cells in a square of side fConeSize to check cells in cone    
-         if ( GetIsolationCut()->Radius(colC, rowC, icol, irow) < sqrSize) { coneCells += 1.;}
-         else if(icol>colC-sqrSize && icol<colC+sqrSize ){  phiBandCells +=1;}
-          else if(irow>rowC-sqrSize && irow<rowC+sqrSize ){  etaBandCells +=1;}
-               
-            Int_t cellSM  = -999;
-            Int_t cellEta = -999;
-            Int_t cellPhi = -999;
-            if(icol > AliEMCALGeoParams::fgkEMCALCols-1) 
-            {
-              cellSM = 0+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
-              cellEta = icol-AliEMCALGeoParams::fgkEMCALCols;
-              cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
-            }
-            if(icol < AliEMCALGeoParams::fgkEMCALCols) 
-            {
-              cellSM = 1+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
-              cellEta = icol;
-              cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
-            }
-            
-            if( (icol < 0 || icol > AliEMCALGeoParams::fgkEMCALCols*2-1 || 
-               irow < 0 || irow > AliEMCALGeoParams::fgkEMCALRows*5 - 1) //5*nRows+1/3*nRows //Count as bad "cells" out of EMCAL acceptance
-                  || (cu->GetEMCALChannelStatus(cellSM,cellEta,cellPhi)==1))  //Count as bad "cells" marked as bad in the DataBase
-            {
-                   if (GetIsolationCut()->Radius(colC, rowC, icol, irow) < sqrSize) coneBadCellsCoeff += 1.;
-                   else if(icol>colC-sqrSize && icol<colC+sqrSize ) phiBandBadCellsCoeff +=1;
-                 else if(irow>rowC-sqrSize && irow<rowC+sqrSize ) etaBandBadCellsCoeff +=1;
-             }          
-        }
-      }//end of cells loop
-    }
-    
-    else if(GetDebug()>0) printf("cluster with bad (eta,phi) in EMCal for energy density coeff calculation\n");
-    
-    if (coneCells > 0.) 
-    {
-   //   printf("Energy density coneBadCellsCoeff= %.2f coneCells%.2f\n", coneBadCellsCoeff,coneCells);
-      coneBadCellsCoeff = (coneCells-coneBadCellsCoeff)/coneCells;
-    //  printf("coneBadCellsCoeff= %.2f\n", coneBadCellsCoeff);
-    }
-    if (phiBandCells > 0.) 
-    {
-    // printf("Energy density phiBandBadCellsCoeff = %.2f phiBandCells%.2f\n", phiBandBadCellsCoeff,phiBandCells);
-      phiBandBadCellsCoeff = (phiBandCells-phiBandBadCellsCoeff)/phiBandCells;
-    // printf("phiBandBadCellsCoeff = %.2f\n", phiBandBadCellsCoeff);
-     } 
-      if (etaBandCells > 0.) 
-    {
-      //printf("Energy density etaBandBadCellsCoeff = %.2f etaBandCells%.2f\n", etaBandBadCellsCoeff,etaBandCells);
-      etaBandBadCellsCoeff = (etaBandCells-etaBandBadCellsCoeff)/etaBandCells;
-     // printf("etaBandBadCellsCoeff = %.2f\n",etaBandBadCellsCoeff);
-   } 
-   
-     }
-  
-}
 
 //___________________________________________________________________________________________________________________________________
 void AliAnaParticleIsolation::CalculateNormalizeUEBandPerUnitArea(AliAODPWG4ParticleCorrelation * pCandidate,
-                                                                   Float_t coneptsumCluster,  Float_t coneptsumCell, Float_t coneptsumTrack)
+                                                                 Float_t coneptsumCluster,  Float_t coneptsumCell, Float_t coneptsumTrack, Float_t &etaBandptsumTrackNorm, Float_t &etaBandptsumClusterNorm)
 {
   //normalize phi/eta band per area unit
 
@@ -707,15 +598,8 @@ void AliAnaParticleIsolation::CalculateNormalizeUEBandPerUnitArea(AliAODPWG4Part
   Float_t etaUEptsumCell    = 0 ;
   Float_t phiUEptsumCell    = 0 ;
   
-  
   Int_t   partTypeInCone    = GetIsolationCut()->GetParticleTypeInCone();
   
-  // Sum the pT in the phi or eta band for clusters or tracks
-  
-  CalculateTrackUEBand   (pCandidate,etaUEptsumTrack  ,phiUEptsumTrack  );// rajouter ici l'histo eta phi 
-  CalculateCaloUEBand    (pCandidate,etaUEptsumCluster,phiUEptsumCluster);// rajouter ici l'histo eta phi
-  CalculateCaloCellUEBand(pCandidate,etaUEptsumCell   ,phiUEptsumCell   );
-
   // Do the normalization
   
   Float_t conesize  = GetIsolationCut()->GetConeSize();
@@ -723,11 +607,7 @@ void AliAnaParticleIsolation::CalculateNormalizeUEBandPerUnitArea(AliAODPWG4Part
   Float_t ptTrig    = pCandidate->Pt() ;
   Float_t phiTrig   = pCandidate->Phi();
   Float_t etaTrig   = pCandidate->Eta();
-
-Float_t coneBadCellsCoeff=1;
-Float_t etaBandBadCellsCoeff=1;
-Float_t phiBandBadCellsCoeff=1;
-GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsCoeff,phiBandBadCellsCoeff,conesize) ;
+  
 
   // ------ //
   // Tracks //
@@ -738,39 +618,30 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
   Float_t coneptsumTrackSubEta = 0 ;
   Float_t coneptsumTrackSubPhiNorm = 0 ;
   Float_t coneptsumTrackSubEtaNorm = 0 ;
+  etaBandptsumTrackNorm = 0 ;
 
   if( partTypeInCone!=AliIsolationCut::kOnlyNeutral )
   {
-    // Get the cut used for the TPC tracks in the reader, +-0.8, +-0.9 ...
-    // Only valid in simple fidutial cut case and if the cut is applied, careful!
-    Float_t tpcEtaSize = GetReader()->GetFiducialCut()->GetCTSFidCutMaxEtaArray()->At(0) -
-    GetReader()->GetFiducialCut()->GetCTSFidCutMinEtaArray()->At(0) ;
-    Float_t tpcPhiSize = TMath::TwoPi();
-    
-    
-    //printf("tracks eta fiducial acceptance %f\n",tpcEtaSize);
-    
-/*    phiUEptsumTrackNorm = phiUEptsumTrack*(coneA*coneBadCellsCoeff / (((2*conesize*tpcPhiSize)-coneA))*phiBandBadCellsCoeff); // pi * R^2 / (2 R * 2 pi) -  trigger cone
-    etaUEptsumTrackNorm = etaUEptsumTrack*(coneA*coneBadCellsCoeff / (((2*conesize*tpcEtaSize)-coneA))*etaBandBadCellsCoeff); // pi * R^2 / (2 R * 1.6)  -  trigger cone
-  */  
-    if((2*conesize*tpcPhiSize-coneA)!=0)phiUEptsumTrackNorm = phiUEptsumTrack*(coneA / (((2*conesize*tpcPhiSize)-coneA))); // pi * R^2 / (2 R * 2 pi) -  trigger cone
-    if((2*conesize*tpcEtaSize-coneA)!=0)etaUEptsumTrackNorm = etaUEptsumTrack*(coneA / (((2*conesize*tpcEtaSize)-coneA))); // pi * R^2 / (2 R * 1.6)  -  trigger cone
-   
-    // Need to correct coneptsumTrack by the fraction of the cone out of track cut acceptance!
-    Float_t correctConeSumTrack = 1;
-    if(TMath::Abs(etaTrig)+conesize > tpcEtaSize/2.)
-    {
-      Float_t excess = TMath::Abs(etaTrig) + conesize - tpcEtaSize/2.;
-      correctConeSumTrack = CalculateExcessAreaFraction(excess,conesize);
-      //printf("Excess Track   %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",excess,coneA, excessA, angle*TMath::RadToDeg(), correctConeSumTrack);
-      
-      // Need to correct phi band surface if part of the cone falls out of track cut acceptance! Not sure this will happen.
-      if((2*(conesize-excess)*tpcPhiSize)-(coneA-correctConeSumTrack)!=0)phiUEptsumTrackNorm = phiUEptsumTrack*(coneA / (((2*(conesize-excess)*tpcPhiSize)-(coneA/correctConeSumTrack))));
-  //    phiUEptsumTrackNorm = phiUEptsumTrack*(coneA *coneBadCellsCoeff/ (((2*(conesize-excess)*tpcPhiSize)-(coneA-correctConeSumTrack))*phiBandBadCellsCoeff));
-   }
-    
-    coneptsumTrackSubPhi = coneptsumTrack*correctConeSumTrack - phiUEptsumTrackNorm;
-    coneptsumTrackSubEta = coneptsumTrack*correctConeSumTrack - etaUEptsumTrackNorm;
+    // Sum the pT in the phi or eta band for clusters or tracks
+    CalculateTrackUEBand   (pCandidate,etaUEptsumTrack  ,phiUEptsumTrack  );// rajouter ici l'histo eta phi
+
+  //Fill histos
+  fhConeSumPtVSUETracksEtaBand->Fill(coneptsumTrack,etaUEptsumTrack);
+  fhConeSumPtVSUETracksPhiBand->Fill(coneptsumTrack,phiUEptsumTrack);
+
+
+    Float_t correctConeSumTrack    = 1;
+    Float_t correctConeSumTrackPhi = 1;
+
+    GetIsolationCut()->CalculateUEBandTrackNormalization(GetReader(),etaTrig, phiTrig,
+                                                           phiUEptsumTrack,etaUEptsumTrack,
+                                                           phiUEptsumTrackNorm,etaUEptsumTrackNorm,
+                                                           correctConeSumTrack,correctConeSumTrackPhi);
+
+    coneptsumTrackSubPhi = coneptsumTrack - phiUEptsumTrackNorm;
+    coneptsumTrackSubEta = coneptsumTrack - etaUEptsumTrackNorm;
+
+    etaBandptsumTrackNorm = etaUEptsumTrackNorm;
     
     fhConeSumPtPhiUESubTrack           ->Fill(ptTrig ,          coneptsumTrackSubPhi);
     fhConeSumPtPhiUESubTrackTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumTrackSubPhi);
@@ -780,10 +651,12 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
     fhFractionTrackOutConeEta          ->Fill(ptTrig ,         correctConeSumTrack-1);
     fhFractionTrackOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig,correctConeSumTrack-1);
     
-    if(coneptsumTrack!=0){
-       coneptsumTrackSubPhiNorm = coneptsumTrackSubPhi/coneptsumTrack;
+    if(coneptsumTrack > 0)
+    {
+      coneptsumTrackSubPhiNorm = coneptsumTrackSubPhi/coneptsumTrack;
        coneptsumTrackSubEtaNorm = coneptsumTrackSubEta/coneptsumTrack;
     }
+    
     fhConeSumPtSubvsConeSumPtTotPhiTrack    ->Fill(coneptsumTrack,coneptsumTrackSubPhi);
     fhConeSumPtSubNormvsConeSumPtTotPhiTrack->Fill(coneptsumTrack,coneptsumTrackSubPhiNorm);
     fhConeSumPtSubvsConeSumPtTotEtaTrack    ->Fill(coneptsumTrack,coneptsumTrackSubEta);
@@ -806,54 +679,44 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
   Float_t coneptsumCellSubEta    = 0 ;
   Float_t coneptsumCellSubPhiNorm = 0 ;
   Float_t coneptsumCellSubEtaNorm = 0 ;
+  etaBandptsumClusterNorm = 0;
 
   if( partTypeInCone!=AliIsolationCut::kOnlyCharged )
   {
-    //Careful here if EMCal limits changed .. 2010 (4 SM) to 2011-12 (10 SM), for the moment consider 100 deg in phi
-    Float_t emcEtaSize = 0.7*2;
-    Float_t emcPhiSize = TMath::DegToRad()*100;
 
     // -------------- //
     // EMCal clusters //
     // -------------- //
-        
-   if(((((2*conesize*emcPhiSize)-coneA))*phiBandBadCellsCoeff)!=0)phiUEptsumClusterNorm = phiUEptsumCluster*(coneA*coneBadCellsCoeff / (((2*conesize*emcPhiSize)-coneA))*phiBandBadCellsCoeff); // pi * R^2 / (2 R * 2 100 deg) -  trigger cone
-   if(((((2*conesize*emcEtaSize)-coneA))*etaBandBadCellsCoeff)!=0) etaUEptsumClusterNorm = etaUEptsumCluster*(coneA*coneBadCellsCoeff / (((2*conesize*emcEtaSize)-coneA))*etaBandBadCellsCoeff); // pi * R^2 / (2 R * 2*1.7)  -  trigger cone
-  
-    // Need to correct coneptsumCluster by the fraction of the cone out of the calorimeter cut acceptance!    
-    Float_t correctConeSumClusterEta = 1;
-    if(TMath::Abs(etaTrig)+conesize > emcEtaSize/2.)
-    {
-      Float_t excess = TMath::Abs(etaTrig) + conesize - emcEtaSize/2.;
-      correctConeSumClusterEta = CalculateExcessAreaFraction(excess,conesize);
-      //printf("Excess EMC-Eta %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",excess,coneA, excessA, angle*TMath::RadToDeg(), correctConeSumClusterEta);
-      
-      // Need to correct phi band surface if part of the cone falls out of track cut acceptance!
-     if(((((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumClusterEta))*etaBandBadCellsCoeff))!=0)phiUEptsumClusterNorm = phiUEptsumCluster*(coneA *coneBadCellsCoeff/ (((2*(conesize-excess)*emcPhiSize)-(coneA/correctConeSumClusterEta))*etaBandBadCellsCoeff));
-     }
     
+    // Sum the pT in the phi or eta band for clusters or tracks
+    CalculateCaloUEBand    (pCandidate,etaUEptsumCluster,phiUEptsumCluster);// rajouter ici l'histo eta phi
+
+  //Fill histos
+  fhConeSumPtVSUEClusterEtaBand->Fill(coneptsumCluster,etaUEptsumCluster);
+  fhConeSumPtVSUEClusterPhiBand->Fill(coneptsumCluster,phiUEptsumCluster);
+
+
+    Float_t correctConeSumClusterEta = 1;
     Float_t correctConeSumClusterPhi = 1;
-    //printf("EMCPhiTrig %2.2f, conesize %2.2f, sum %2.2f, rest %2.2f \n",phiTrig*TMath::RadToDeg(),conesize*TMath::RadToDeg(),(phiTrig+conesize)*TMath::RadToDeg(),(phiTrig-conesize)*TMath::RadToDeg() );
-    if((phiTrig+conesize > 180*TMath::DegToRad()) ||
-       (phiTrig-conesize <  80*TMath::DegToRad()))
-    {
-      Float_t excess = 0;
-      if( phiTrig+conesize > 180*TMath::DegToRad() ) excess = conesize + phiTrig - 180*TMath::DegToRad() ;
-      else                                           excess = conesize - phiTrig +  80*TMath::DegToRad() ;
-      
-      correctConeSumClusterPhi = CalculateExcessAreaFraction(excess,conesize);
-      //printf("Excess EMC-Phi %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",excess,coneA, excessA, angle*TMath::RadToDeg(), correctConeSumClusterPhi);
-      
-      // Need to correct eta band surface if part of the cone falls out of track cut acceptance!
-     if(((2*(conesize-excess)*emcEtaSize)-(coneA-correctConeSumClusterPhi))*phiBandBadCellsCoeff!=0) etaUEptsumClusterNorm = etaUEptsumCluster*(coneA*coneBadCellsCoeff / (((2*(conesize-excess)*emcEtaSize)-(coneA/correctConeSumClusterPhi))*phiBandBadCellsCoeff));
-    }
+
+    GetIsolationCut()->CalculateUEBandClusterNormalization(GetReader(),etaTrig, phiTrig,
+                                                           phiUEptsumCluster,etaUEptsumCluster,
+                                                           phiUEptsumClusterNorm,etaUEptsumClusterNorm,
+                                                           correctConeSumClusterEta,correctConeSumClusterPhi);
     
     // In case that cone is out of eta and phi side, we are over correcting, not too often with the current cuts ...
-    coneptsumCluster=coneptsumCluster*coneBadCellsCoeff*correctConeSumClusterEta*correctConeSumClusterPhi;
-    coneptsumClusterSubPhi =  coneptsumCluster - phiUEptsumClusterNorm;
+    // Comment if not used
+    //  Float_t coneBadCellsCoeff   =1;
+    //  Float_t etaBandBadCellsCoeff=1;
+    //  Float_t phiBandBadCellsCoeff=1;
+    //  GetIsolationCut()->GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsCoeff,phiBandBadCellsCoeff) ;
+
+    //coneptsumCluster=coneptsumCluster*coneBadCellsCoeff*correctConeSumClusterEta*correctConeSumClusterPhi;
+    
+    coneptsumClusterSubPhi = coneptsumCluster - phiUEptsumClusterNorm;
     coneptsumClusterSubEta = coneptsumCluster - etaUEptsumClusterNorm;
     
+    etaBandptsumClusterNorm = etaUEptsumClusterNorm;
 
     fhConeSumPtPhiUESubCluster           ->Fill(ptTrig ,          coneptsumClusterSubPhi);
     fhConeSumPtPhiUESubClusterTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumClusterSubPhi);
@@ -865,10 +728,12 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
     fhFractionClusterOutConePhi          ->Fill(ptTrig ,          correctConeSumClusterPhi-1);
     fhFractionClusterOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumClusterPhi-1);
     
-    if(coneptsumCluster!=0){
+    if(coneptsumCluster!=0)
+    {
            coneptsumClusterSubPhiNorm = coneptsumClusterSubPhi/coneptsumCluster;
        coneptsumClusterSubEtaNorm = coneptsumClusterSubEta/coneptsumCluster;
     }
+    
     fhConeSumPtSubvsConeSumPtTotPhiCluster    ->Fill(coneptsumCluster,coneptsumClusterSubPhi);
     fhConeSumPtSubNormvsConeSumPtTotPhiCluster->Fill(coneptsumCluster,coneptsumClusterSubPhiNorm);
     fhConeSumPtSubvsConeSumPtTotEtaCluster    ->Fill(coneptsumCluster,coneptsumClusterSubEta);
@@ -877,9 +742,18 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
     // ----------- //
     // EMCal Cells //
     // ----------- //
-        
+    
+    // Sum the pT in the phi or eta band for clusters or tracks
+    CalculateCaloCellUEBand(pCandidate,etaUEptsumCell   ,phiUEptsumCell   );
+
+    // Move to AliIsolationCut the calculation not the histograms??
+    
+    //Careful here if EMCal limits changed .. 2010 (4 SM) to 2011-12 (10 SM), for the moment consider 100 deg in phi
+    Float_t emcEtaSize = 0.7*2; // TO FIX
+    Float_t emcPhiSize = TMath::DegToRad()*100.; // TO FIX
+    
     if(((2*conesize*emcPhiSize)-coneA)!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*conesize*emcPhiSize)-coneA));
-    if((((2*conesize*emcEtaSize)-coneA))!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*conesize*emcEtaSize)-coneA));
+    if(((2*conesize*emcEtaSize)-coneA)!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*conesize*emcEtaSize)-coneA));
     
     // Need to correct coneptsumCluster by the fraction of the cone out of the calorimeter cut acceptance!
     
@@ -887,7 +761,7 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
     if(TMath::Abs(etaTrig)+conesize > emcEtaSize/2.)
     {
       Float_t excess = TMath::Abs(etaTrig) + conesize - emcEtaSize/2.;
-      correctConeSumCellEta = CalculateExcessAreaFraction(excess,conesize);
+      correctConeSumCellEta = GetIsolationCut()->CalculateExcessAreaFraction(excess);
       //printf("Excess EMC-Eta %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",excess,coneA, excessA, angle*TMath::RadToDeg(), correctConeSumClusterEta);
       // Need to correct phi band surface if part of the cone falls out of track cut acceptance!
       if(((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta))!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta)));
@@ -902,7 +776,7 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
       if( phiTrig+conesize > 180*TMath::DegToRad() ) excess = conesize + phiTrig - 180*TMath::DegToRad() ;
       else                                           excess = conesize - phiTrig +  80*TMath::DegToRad() ;
       
-      correctConeSumCellPhi = CalculateExcessAreaFraction(excess,conesize);
+      correctConeSumCellPhi = GetIsolationCut()->CalculateExcessAreaFraction(excess);
       //printf("Excess EMC-Phi %2.3f, coneA %2.2f,  excessA %2.2f, angle %2.2f,factor %2.2f\n",excess,coneA, excessA, angle*TMath::RadToDeg(), correctConeSumClusterPhi);
       
       // Need to correct eta band surface if part of the cone falls out of track cut acceptance!
@@ -923,15 +797,16 @@ GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsC
     fhFractionCellOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellEta-1);
     fhFractionCellOutConePhi          ->Fill(ptTrig ,          correctConeSumCellPhi-1);
     fhFractionCellOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellPhi-1);
-    if(coneptsumCell!=0){
-       coneptsumCellSubPhiNorm = coneptsumCellSubPhi/coneptsumCell;
+    if(coneptsumCell!=0)
+    {
+      coneptsumCellSubPhiNorm = coneptsumCellSubPhi/coneptsumCell;
        coneptsumCellSubEtaNorm = coneptsumCellSubEta/coneptsumCell;
     }
+    
     fhConeSumPtSubvsConeSumPtTotPhiCell    ->Fill(coneptsumCell,coneptsumCellSubPhi);
     fhConeSumPtSubNormvsConeSumPtTotPhiCell->Fill(coneptsumCell,coneptsumCellSubPhiNorm);
     fhConeSumPtSubvsConeSumPtTotEtaCell    ->Fill(coneptsumCell,coneptsumCellSubEta);
     fhConeSumPtSubNormvsConeSumPtTotEtaCell->Fill(coneptsumCell,coneptsumCellSubEtaNorm);
-    
   }
     
   if( partTypeInCone==AliIsolationCut::kNeutralAndCharged )
@@ -1261,8 +1136,7 @@ void AliAnaParticleIsolation::FillPileUpHistograms(Int_t clusterID)
 
 //_____________________________________________________________________________________________________________________
 void AliAnaParticleIsolation::FillTrackMatchingShowerShapeControlHistograms(AliAODPWG4ParticleCorrelation  *pCandidate,
-                                                                            const AliCaloTrackReader * reader, 
-                                                                            const AliCaloPID * pid)
+                                                                            AliCaloPID * pid)
 {
   // Fill Track matching and Shower Shape control histograms  
   if(!fFillTMHisto &&  !fFillSSHisto) return;
@@ -1331,8 +1205,8 @@ void AliAnaParticleIsolation::FillTrackMatchingShowerShapeControlHistograms(AliA
         
         GetIsolationCut()->SetPtThresholdMax(1.);
         GetIsolationCut()->MakeIsolationCut(plCTS,   plNe, 
-                                            reader, pid,
-                                            kFALSE, pCandidate, "", 
+                                            GetReader(), pid,
+                                            kFALSE, pCandidate, "",
                                             n,nfrac,coneptsum, iso);
         
         if (!iso) fhELambda0SSBkg->Fill(energy, cluster->GetM02());
@@ -1953,6 +1827,34 @@ TList *  AliAnaParticleIsolation::GetCreateOutputObjects()
       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetXTitle("#Sigma p_{T, tot} (GeV/c)");
       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetYTitle("#Sigma p_{T, sub norm} (GeV/c)");
       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCell);
+
+      fhConeSumPtVSUETracksEtaBand  = new TH2F("hConeSumPtVSUETracksEtaBand",
+                                                         Form("#Sigma p_{T} in cone versus #Sigma p_{T} in eta band for tracks (before normalization), R=%2.2f",r),
+                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
+      fhConeSumPtVSUETracksEtaBand->SetXTitle("#Sigma p_{T} cone (GeV/c)");
+      fhConeSumPtVSUETracksEtaBand->SetYTitle("#Sigma p_{T} UE (GeV/c)");
+      outputContainer->Add(fhConeSumPtVSUETracksEtaBand);
+
+      fhConeSumPtVSUETracksPhiBand  = new TH2F("hConeSumPtVSUETracksPhiBand",
+                                                         Form("#Sigma p_{T} in cone versus #Sigma p_{T} in phi band for tracks (before normalization), R=%2.2f",r),
+                                                         nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
+      fhConeSumPtVSUETracksPhiBand->SetXTitle("#Sigma p_{T} cone (GeV/c)");
+      fhConeSumPtVSUETracksPhiBand->SetYTitle("#Sigma p_{T} UE (GeV/c)");
+      outputContainer->Add(fhConeSumPtVSUETracksPhiBand);
+
+      fhConeSumPtVSUEClusterEtaBand  = new TH2F("hConeSumPtVSUEClusterEtaBand",
+                                                         Form("#Sigma p_{T} in cone versus #Sigma p_{T} in eta band for cluster (before normalization), R=%2.2f",r),
+                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
+      fhConeSumPtVSUEClusterEtaBand->SetXTitle("#Sigma p_{T} cone (GeV/c)");
+      fhConeSumPtVSUEClusterEtaBand->SetYTitle("#Sigma p_{T} UE (GeV/c)");
+      outputContainer->Add(fhConeSumPtVSUEClusterEtaBand);
+
+      fhConeSumPtVSUEClusterPhiBand  = new TH2F("hConeSumPtVSUEClusterPhiBand",
+                                                         Form("#Sigma p_{T} in cone versus #Sigma p_{T} in phi band for cluster (before normalization), R=%2.2f",r),
+                                                         nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
+      fhConeSumPtVSUEClusterPhiBand->SetXTitle("#Sigma p_{T} cone (GeV/c)");
+      fhConeSumPtVSUEClusterPhiBand->SetYTitle("#Sigma p_{T} UE (GeV/c)");
+      outputContainer->Add(fhConeSumPtVSUEClusterPhiBand);
       
     }
     
@@ -3376,7 +3278,7 @@ void  AliAnaParticleIsolation::MakeAnalysisFillAOD()
   n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0;
   GetIsolationCut()->MakeIsolationCut(GetCTSTracks(),pl,
                                       GetReader(), GetCaloPID(),
-                                      kTRUE, aodinput, GetAODObjArrayName(), 
+                                      kTRUE, aodinput, GetAODObjArrayName(),
                                       n,nfrac,coneptsum, isolated);
   
   if(!fMakeSeveralIC) aodinput->SetIsolated(isolated);
@@ -3435,7 +3337,7 @@ void  AliAnaParticleIsolation::MakeAnalysisFillHistograms()
       isolated = kFALSE;
       Int_t   n = 0, nfrac = 0;
       Float_t coneptsum = 0 ;
-
+      
       //Recover reference arrays with clusters and tracks
       TObjArray * refclusters = aod->GetObjArray(GetAODObjArrayName()+"Clusters");
       TObjArray * reftracks   = aod->GetObjArray(GetAODObjArrayName()+"Tracks");
@@ -3454,13 +3356,15 @@ void  AliAnaParticleIsolation::MakeAnalysisFillHistograms()
     {
       if(GetDebug() > 0) printf(" AliAnaParticleIsolation::MakeAnalysisFillHistograms() - pt %1.1f, eta %1.1f, phi %1.1f\n",pt, eta, phi);
       
-      FillTrackMatchingShowerShapeControlHistograms(aod,GetReader(), GetCaloPID());
+      FillTrackMatchingShowerShapeControlHistograms(aod,GetCaloPID());
 
       //Fill pt/sum pT distribution of particles in cone or in UE band
       Float_t coneptsumCluster = 0;
       Float_t coneptsumTrack   = 0;
       Float_t coneptsumCell    = 0;
-      
+      Float_t etaBandptsumClusterNorm = 0;
+      Float_t etaBandptsumTrackNorm   = 0;
+          
       CalculateTrackSignalInCone   (aod,coneptsumTrack  );
       CalculateCaloSignalInCone    (aod,coneptsumCluster);
       CalculateCaloCellSignalInCone(aod,coneptsumCell   );
@@ -3480,7 +3384,10 @@ void  AliAnaParticleIsolation::MakeAnalysisFillHistograms()
         printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Particle %d Energy Sum in Isolation Cone %2.2f\n", iaod, coneptsumTrack+coneptsumCluster);
 
       //normalize phi/eta band per area unit
-      CalculateNormalizeUEBandPerUnitArea(aod, coneptsumCluster, coneptsumCell, coneptsumTrack) ;
+      CalculateNormalizeUEBandPerUnitArea(aod, coneptsumCluster, coneptsumCell, coneptsumTrack, etaBandptsumTrackNorm, etaBandptsumClusterNorm) ;
+
+    //  printf("Histograms analysis : cluster pt = %f, etaBandTrack = %f, etaBandCluster = %f, isolation = %d\n",aod->Pt(),etaBandptsumTrackNorm,etaBandptsumClusterNorm,aod->IsIsolated());
+     
     }
     
     Int_t mcTag = aod->GetTag() ;
@@ -3647,7 +3554,7 @@ void  AliAnaParticleIsolation::MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelati
   Int_t   nCone     = 0;
   Int_t   nFracCone = 0;
  
-  // fill hist with all particles before isolation criteria
+  // Fill hist with all particles before isolation criteria
   fhPtNoIso    ->Fill(ptC);
   fhEtaPhiNoIso->Fill(etaC,phiC);
   
@@ -3694,9 +3601,8 @@ void  AliAnaParticleIsolation::MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelati
   GetIsolationCut()->SetConeSize(fConeSizes[icone]);
   GetIsolationCut()->MakeIsolationCut(reftracks,   refclusters, 
                                           GetReader(), GetCaloPID(),
-                                          kFALSE, ph, "", 
-                                     nCone,nFracCone,coneptsum, isolated);
-
+                                          kFALSE, ph, "",
+                                          nCone,nFracCone,coneptsum, isolated);
         
     fhSumPtLeadingPt[icone]->Fill(ptC,coneptsum);  
     
index 647019c6c6ea9ccd395156fcd76324b2cb28c88e..a3a558fae24d7848f7553c3a460c79f4133e2659 100755 (executable)
@@ -42,14 +42,11 @@ class AliAnaParticleIsolation : public AliAnaCaloTrackCorrBaseClass {
   void         CalculateCaloSignalInCone    (AliAODPWG4ParticleCorrelation * aodParticle, Float_t & coneptsumCluster) ;
   void         CalculateCaloCellSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle, Float_t & coneptsumCell) ;
   void         CalculateTrackSignalInCone   (AliAODPWG4ParticleCorrelation * aodParticle, Float_t & coneptsumTrack  ) ;
-  
-  Float_t      CalculateExcessAreaFraction(const Float_t excess, const Float_t conesize);
-  
-  void            GetCoeffNormBadCell(const AliAODPWG4ParticleCorrelation * pCandidate, 
-                                        const AliCaloTrackReader * reader,  Float_t &  coneBadCellsCoeff, Float_t &  etaBandBadCellsCoeff, Float_t & phiBandBadCellsCoeff, const Float_t conesize) ;
+
 
   void         CalculateNormalizeUEBandPerUnitArea(AliAODPWG4ParticleCorrelation * pCandidate,
-                                                   const Float_t coneptsumCluster,const Float_t coneptsumCell, const Float_t coneptsumTrack ) ;
+                                                   const Float_t coneptsumCluster,const Float_t coneptsumCell, const Float_t coneptsumTrack,
+                                                   Float_t &etaBandptsumTrackNorm, Float_t &etaBandptsumClusterNorm ) ;
   
   TObjString * GetAnalysisCuts() ;
   
@@ -71,8 +68,7 @@ class AliAnaParticleIsolation : public AliAnaCaloTrackCorrBaseClass {
   void         FillPileUpHistograms(Int_t clusterID) ;
   
   void         FillTrackMatchingShowerShapeControlHistograms(AliAODPWG4ParticleCorrelation  * pCandidate,
-                                                             const AliCaloTrackReader * reader,
-                                                             const AliCaloPID * pid) ;
+                                                             AliCaloPID * pid) ;
   
   void         MakeSeveralICAnalysis( AliAODPWG4ParticleCorrelation * ph ) ; 
   
@@ -277,7 +273,10 @@ class AliAnaParticleIsolation : public AliAnaCaloTrackCorrBaseClass {
   TH2F *   fhConeSumPtSubNormvsConeSumPtTotPhiCell; //! Cells, phi band: sum pT in cone after bkg sub normalized by sum pT in cone before bkg sub vs sum pT in cone before bkg sub
   TH2F *   fhConeSumPtSubvsConeSumPtTotEtaCell;  //! Cells, eta band: sum pT in cone after bkg sub vs sum pT in cone before bkg sub
   TH2F *   fhConeSumPtSubNormvsConeSumPtTotEtaCell; //! Cells, eta band: sum pT in cone after bkg sub normalized by sum pT in cone before bkg sub vs sum pT in cone before bkg sub
-
+  TH2F *   fhConeSumPtVSUETracksEtaBand;//!
+  TH2F *   fhConeSumPtVSUETracksPhiBand;//!
+  TH2F *   fhConeSumPtVSUEClusterEtaBand;//!
+  TH2F *   fhConeSumPtVSUEClusterPhiBand;//!
   
   //MC
   TH1F *   fhPtIsoPrompt;                         //! Number of isolated prompt gamma 
index d5207bf0dbd6af6463c9da0da2d48cfac35ca7bd..a38813e6057a7f15d395743fd74561bc215c5cb2 100755 (executable)
@@ -1035,7 +1035,6 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
       fhPhiLam0HighE   ->Fill(phi, lambda0);
     }
   }
-  
   if(IsDataMC())
   {
     AliVCaloCells* cells = 0;
@@ -1044,8 +1043,11 @@ void  AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
     
     //Fill histograms to check shape of embedded clusters
     Float_t fraction = 0;
+   // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
+  
     if(GetReader()->IsEmbeddedClusterSelectionOn())
     {//Only working for EMCAL
+       printf("embedded\n");
       Float_t clusterE = 0; // recalculate in case corrections applied.
       Float_t cellE    = 0;
       for(Int_t icell  = 0; icell < cluster->GetNCells(); icell++)
@@ -2463,7 +2465,6 @@ TList *  AliAnaPhoton::GetCreateOutputObjects()
         
       } //No embedding     
       
-      //Fill histograms to check shape of embedded clusters
       if(GetReader()->IsEmbeddedClusterSelectionOn())
       {
         
@@ -2803,6 +2804,8 @@ void  AliAnaPhoton::MakeAnalysisFillHistograms()
   if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
   
   Float_t cen = GetEventCentrality();
+ // printf("++++++++++ GetEventCentrality() %f\n",cen);
   Float_t ep  = GetEventPlaneAngle();
   
   for(Int_t iaod = 0; iaod < naod ; iaod++)