remove filling of obsolete histogram
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaParticleIsolation.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes hereby granted      *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //_________________________________________________________________________
17 // Class for analysis of particle isolation
18 // Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation)
19 //
20 //  Class created from old AliPHOSGammaJet 
21 //  (see AliRoot versions previous Release 4-09)
22 //
23 // -- Author: Gustavo Conesa (LNF-INFN) 
24
25 //-Yaxian Mao (add the possibility for different IC method with different pt range, 01/10/2010)
26 //////////////////////////////////////////////////////////////////////////////
27
28
29 // --- ROOT system --- 
30 #include <TClonesArray.h>
31 #include <TList.h>
32 #include <TObjString.h>
33 #include <TH2F.h>
34 #include <TClass.h>
35 #include <TH2F.h>
36 #include "TParticle.h"
37 #include "TDatabasePDG.h"
38
39
40
41 // --- Analysis system --- 
42 #include "AliAnaParticleIsolation.h" 
43 #include "AliCaloTrackReader.h"
44 #include "AliStack.h"
45 #include "AliIsolationCut.h"
46 #include "AliFiducialCut.h"
47 #include "AliMCAnalysisUtils.h"
48 #include "AliNeutralMesonSelection.h"
49 #include "AliAODMCParticle.h"
50 #include "AliAODPWG4ParticleCorrelation.h"
51 #include "AliMCAnalysisUtils.h"
52 #include "AliVTrack.h"
53 #include "AliVCluster.h"
54 #include "AliESDEvent.h"
55 #include "AliAODEvent.h"
56 // --- Detectors ---
57 #include "AliEMCALGeometry.h"                    
58 #include "AliPHOSGeoUtils.h"
59
60 ClassImp(AliAnaParticleIsolation)
61
62 //______________________________________________________________________________
63 AliAnaParticleIsolation::AliAnaParticleIsolation() : 
64 AliAnaCaloTrackCorrBaseClass(),   fCalorimeter(""), 
65 fReMakeIC(0),                     fMakeSeveralIC(0),               
66 fFillPileUpHistograms(0),
67 fFillTMHisto(0),                  fFillSSHisto(0),
68 // Several IC
69 fNCones(0),                       fNPtThresFrac(0), 
70 fConeSizes(),                     fPtThresholds(),                 
71 fPtFractions(),                   fSumPtThresholds(),
72 // Histograms
73 fhEIso(0),                        fhPtIso(0),
74 fhPtCentralityIso(0),             fhPtEventPlaneIso(0),
75 fhPtNLocMaxIso(0),
76 fhPhiIso(0),                      fhEtaIso(0),                              fhEtaPhiIso(0), 
77 fhEtaPhiNoIso(0), 
78 fhENoIso(0),                      fhPtNoIso(0),                             fhPtNLocMaxNoIso(0),
79 fhPtDecayIso(0),                  fhPtDecayNoIso(0),
80 fhEtaPhiDecayIso(0),              fhEtaPhiDecayNoIso(0), 
81 fhPtInCone(0),
82 fhPtClusterInCone(0),             fhPtCellInCone(0),                        fhPtTrackInCone(0),
83 fhPtTrackInConeOtherBC(0),        fhPtTrackInConeOtherBCPileUpSPD(0),
84 fhPtTrackInConeBC0(0),            fhPtTrackInConeVtxBC0(0),
85 fhPtTrackInConeBC0PileUpSPD(0),
86 fhPtInConePileUp(),               fhPtInConeCent(0),
87 fhPerpConeSumPt(0),               fhPtInPerpCone(0),
88 fhEtaPhiInConeCluster(0),fhEtaPhiCluster(0),fhEtaPhiInConeTrack(0),fhEtaPhiTrack(0),
89 fhEtaBandCluster(0),              fhPhiBandCluster(0),
90 fhEtaBandTrack(0),                fhPhiBandTrack(0),
91 fhEtaBandCell(0),                 fhPhiBandCell(0),
92 fhConeSumPt(0),                   fhConeSumPtCellTrack(0),
93 fhConeSumPtCell(0),               fhConeSumPtCluster(0),                    fhConeSumPtTrack(0),
94 fhConeSumPtEtaBandUECluster(0),             fhConeSumPtPhiBandUECluster(0),
95 fhConeSumPtEtaBandUETrack(0),               fhConeSumPtPhiBandUETrack(0),
96 fhConeSumPtEtaBandUECell(0),                fhConeSumPtPhiBandUECell(0),
97 fhConeSumPtTrigEtaPhi(0),
98 fhConeSumPtCellTrackTrigEtaPhi(0),
99 fhConeSumPtEtaBandUEClusterTrigEtaPhi(0),   fhConeSumPtPhiBandUEClusterTrigEtaPhi(0),
100 fhConeSumPtEtaBandUETrackTrigEtaPhi(0),     fhConeSumPtPhiBandUETrackTrigEtaPhi(0),
101 fhConeSumPtEtaBandUECellTrigEtaPhi(0),      fhConeSumPtPhiBandUECellTrigEtaPhi(0),
102 fhConeSumPtEtaUESub(0),                     fhConeSumPtPhiUESub(0),
103 fhConeSumPtEtaUESubTrigEtaPhi(0),           fhConeSumPtPhiUESubTrigEtaPhi(0),
104 fhConeSumPtEtaUESubTrackCell(0),            fhConeSumPtPhiUESubTrackCell(0),
105 fhConeSumPtEtaUESubTrackCellTrigEtaPhi(0),  fhConeSumPtPhiUESubTrackCellTrigEtaPhi(0),
106 fhConeSumPtEtaUESubCluster(0),              fhConeSumPtPhiUESubCluster(0),
107 fhConeSumPtEtaUESubClusterTrigEtaPhi(0),    fhConeSumPtPhiUESubClusterTrigEtaPhi(0),
108 fhConeSumPtEtaUESubCell(0),                 fhConeSumPtPhiUESubCell(0),
109 fhConeSumPtEtaUESubCellTrigEtaPhi(0),       fhConeSumPtPhiUESubCellTrigEtaPhi(0),
110 fhConeSumPtEtaUESubTrack(0),                fhConeSumPtPhiUESubTrack(0),
111 fhConeSumPtEtaUESubTrackTrigEtaPhi(0),      fhConeSumPtPhiUESubTrackTrigEtaPhi(0),
112 fhFractionTrackOutConeEta(0),               fhFractionTrackOutConeEtaTrigEtaPhi(0),
113 fhFractionClusterOutConeEta(0),             fhFractionClusterOutConeEtaTrigEtaPhi(0),
114 fhFractionClusterOutConePhi(0),             fhFractionClusterOutConePhiTrigEtaPhi(0),
115 fhFractionCellOutConeEta(0),                fhFractionCellOutConeEtaTrigEtaPhi(0),
116 fhFractionCellOutConePhi(0),                fhFractionCellOutConePhiTrigEtaPhi(0),
117 fhConeSumPtClustervsTrack(0),
118 fhConeSumPtEtaUESubClustervsTrack(0),       fhConeSumPtPhiUESubClustervsTrack(0),
119 fhConeSumPtCellvsTrack(0),
120 fhConeSumPtEtaUESubCellvsTrack(0),          fhConeSumPtPhiUESubCellvsTrack(0),
121 fhEtaBandClustervsTrack(0),                 fhPhiBandClustervsTrack(0),
122 fhEtaBandNormClustervsTrack(0),             fhPhiBandNormClustervsTrack(0),
123 fhEtaBandCellvsTrack(0),                    fhPhiBandCellvsTrack(0),
124 fhEtaBandNormCellvsTrack(0),                fhPhiBandNormCellvsTrack(0),
125 fhConeSumPtSubvsConeSumPtTotPhiTrack(0),    fhConeSumPtSubNormvsConeSumPtTotPhiTrack(0),
126 fhConeSumPtSubvsConeSumPtTotEtaTrack(0),    fhConeSumPtSubNormvsConeSumPtTotEtaTrack(0),
127 fhConeSumPtSubvsConeSumPtTotPhiCluster(0),  fhConeSumPtSubNormvsConeSumPtTotPhiCluster(0),
128 fhConeSumPtSubvsConeSumPtTotEtaCluster(0),  fhConeSumPtSubNormvsConeSumPtTotEtaCluster(0),
129 fhConeSumPtSubvsConeSumPtTotPhiCell(0),     fhConeSumPtSubNormvsConeSumPtTotPhiCell(0),
130 fhConeSumPtSubvsConeSumPtTotEtaCell(0),     fhConeSumPtSubNormvsConeSumPtTotEtaCell(0),
131 fhConeSumPtVSUETracksEtaBand(0),            fhConeSumPtVSUETracksPhiBand(0),
132 fhConeSumPtVSUEClusterEtaBand(0),           fhConeSumPtVSUEClusterPhiBand(0),
133 // MC histograms
134 fhPtIsoPrompt(0),                 fhPhiIsoPrompt(0),               fhEtaIsoPrompt(0), 
135 fhPtThresIsolatedPrompt(),        fhPtFracIsolatedPrompt(),        fhPtSumIsolatedPrompt(),
136 fhPtIsoFragmentation(0),          fhPhiIsoFragmentation(0),        fhEtaIsoFragmentation(0), 
137 fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(),
138 fhPtIsoPi0(0),                    fhPhiIsoPi0(0),                  fhEtaIsoPi0(0),
139 fhPtThresIsolatedPi0(),           fhPtFracIsolatedPi0(),           fhPtSumIsolatedPi0(),
140 fhPtIsoPi0Decay(0),               fhPhiIsoPi0Decay(0),             fhEtaIsoPi0Decay(0),
141 fhPtThresIsolatedPi0Decay(),      fhPtFracIsolatedPi0Decay(),      fhPtSumIsolatedPi0Decay(),
142 fhPtIsoEtaDecay(0),               fhPhiIsoEtaDecay(0),             fhEtaIsoEtaDecay(0),
143 fhPtThresIsolatedEtaDecay(),      fhPtFracIsolatedEtaDecay(),      fhPtSumIsolatedEtaDecay(),
144 fhPtIsoOtherDecay(0),             fhPhiIsoOtherDecay(0),           fhEtaIsoOtherDecay(0), 
145 fhPtThresIsolatedOtherDecay(),    fhPtFracIsolatedOtherDecay(),    fhPtSumIsolatedOtherDecay(),
146 //fhPtIsoConversion(0),             fhPhiIsoConversion(0),           fhEtaIsoConversion(0), 
147 //fhPtThresIsolatedConversion(),    fhPtFracIsolatedConversion(),    fhPtSumIsolatedConversion(),
148 fhPtIsoHadron(0),                 fhPhiIsoHadron(0),               fhEtaIsoHadron(0), 
149 fhPtThresIsolatedHadron(),        fhPtFracIsolatedHadron(),        fhPtSumIsolatedHadron(),
150 fhPtNoIsoPi0(0),                  fhPtNoIsoPi0Decay(0),             
151 fhPtNoIsoEtaDecay(0),             fhPtNoIsoOtherDecay(0),
152 fhPtNoIsoPrompt(0),               fhPtIsoMCPhoton(0),              fhPtNoIsoMCPhoton(0),
153 //fhPtNoIsoConversion(0),           
154 fhPtNoIsoFragmentation(0),        fhPtNoIsoHadron(0),
155 // Hist several IC
156 fhSumPtLeadingPt(),               fhPtLeadingPt(), 
157 fhPerpSumPtLeadingPt(),           fhPerpPtLeadingPt(),
158 fhPtThresIsolated(),              fhPtFracIsolated(),              fhPtSumIsolated(),
159 fhEtaPhiPtThresIso(),             fhEtaPhiPtThresDecayIso(),       fhPtPtThresDecayIso(),
160 fhEtaPhiPtFracIso(),              fhEtaPhiPtFracDecayIso(),        fhPtPtFracDecayIso(),
161 fhPtPtSumDecayIso(),              fhEtaPhiSumDensityIso(),         fhEtaPhiSumDensityDecayIso(),
162 fhPtSumDensityIso(),              fhPtSumDensityDecayIso(), 
163 fhPtFracPtSumIso(),               fhPtFracPtSumDecayIso(),      
164 fhEtaPhiFracPtSumIso(),           fhEtaPhiFracPtSumDecayIso(),
165 // Cluster control histograms
166 fhTrackMatchedDEta(),             fhTrackMatchedDPhi(),           fhTrackMatchedDEtaDPhi(),
167 fhdEdx(),                         fhEOverP(),                     fhTrackMatchedMCParticle(),
168 fhELambda0() ,                    fhPtLambda0() ,                 fhELambda1(),
169 fhELambda0TRD(),                  fhPtLambda0TRD(),               fhELambda1TRD(),
170 fhELambda0MCPhoton(),             fhPtLambda0MCPhotonPrompt(),    fhPtLambda0MCPhotonFrag(),
171 fhELambda0MCPi0(),                fhELambda0MCPi0Decay(),
172 fhELambda0MCEtaDecay(),           fhELambda0MCOtherDecay(),       fhELambda0MCHadron(),
173                   
174 // Number of local maxima in cluster
175 fhNLocMax(),
176 fhELambda0LocMax1(),              fhELambda1LocMax1(),
177 fhELambda0LocMax2(),              fhELambda1LocMax2(),
178 fhELambda0LocMaxN(),              fhELambda1LocMaxN(),
179 // PileUp
180 fhEIsoPileUp(),                   fhPtIsoPileUp(),
181 fhENoIsoPileUp(),                 fhPtNoIsoPileUp(),
182 fhTimeENoCut(0),                  fhTimeESPD(0),                  fhTimeESPDMulti(0),
183 fhTimeNPileUpVertSPD(0),          fhTimeNPileUpVertTrack(0),
184 fhTimeNPileUpVertContributors(0),
185 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
186 // Histograms settings
187 fHistoNPtSumBins(0),              fHistoPtSumMax(0.),              fHistoPtSumMin(0.),
188 fHistoNPtInConeBins(0),           fHistoPtInConeMax(0.),           fHistoPtInConeMin(0.)
189 {
190   //default ctor
191   
192   //Initialize parameters
193   InitParameters();
194   
195   for(Int_t i = 0; i < 5 ; i++)
196   {
197     fConeSizes[i]      = 0 ;
198     
199     fhPtSumIsolatedPrompt       [i] = 0 ;
200     fhPtSumIsolatedFragmentation[i] = 0 ;
201     fhPtSumIsolatedPi0Decay     [i] = 0 ;
202     fhPtSumIsolatedPi0          [i] = 0 ;
203     fhPtSumIsolatedEtaDecay     [i] = 0 ;
204     fhPtSumIsolatedOtherDecay   [i] = 0 ;
205     //  fhPtSumIsolatedConversion   [i] = 0 ;
206     fhPtSumIsolatedHadron       [i] = 0 ;
207     
208     for(Int_t j = 0; j < 5 ; j++)
209     {
210       fhPtThresIsolated             [i][j] = 0 ;
211       fhPtFracIsolated              [i][j] = 0 ;
212       fhPtSumIsolated               [i][j] = 0 ;
213       
214       fhEtaPhiPtThresIso            [i][j] = 0 ;
215       fhEtaPhiPtThresDecayIso       [i][j] = 0 ;
216       fhPtPtThresDecayIso           [i][j] = 0 ;
217       
218       fhEtaPhiPtFracIso             [i][j] = 0 ;
219       fhEtaPhiPtFracDecayIso        [i][j] = 0 ;
220       fhPtPtFracDecayIso            [i][j] = 0 ;
221       fhPtPtSumDecayIso             [i][j] = 0 ;
222       fhPtSumDensityIso             [i][j] = 0 ;
223       fhPtSumDensityDecayIso        [i][j] = 0 ;
224       fhEtaPhiSumDensityIso         [i][j] = 0 ;
225       fhEtaPhiSumDensityDecayIso    [i][j] = 0 ;
226       fhPtFracPtSumIso              [i][j] = 0 ;
227       fhPtFracPtSumDecayIso         [i][j] = 0 ;
228       fhEtaPhiFracPtSumIso          [i][j] = 0 ;
229       fhEtaPhiFracPtSumDecayIso     [i][j] = 0 ;
230       
231       fhPtThresIsolatedPrompt       [i][j] = 0 ;
232       fhPtThresIsolatedFragmentation[i][j] = 0 ;
233       fhPtThresIsolatedPi0Decay     [i][j] = 0 ;
234       fhPtThresIsolatedPi0          [i][j] = 0 ;
235       fhPtThresIsolatedEtaDecay     [i][j] = 0 ;
236       fhPtThresIsolatedOtherDecay   [i][j] = 0 ;
237       //    fhPtThresIsolatedConversion   [i][j] = 0 ;
238       fhPtThresIsolatedHadron      [ i][j] = 0 ;
239       
240       fhPtFracIsolatedPrompt        [i][j] = 0 ;
241       fhPtFracIsolatedFragmentation [i][j] = 0 ;
242       fhPtFracIsolatedPi0           [i][j] = 0 ;
243       fhPtFracIsolatedPi0Decay      [i][j] = 0 ;
244       fhPtFracIsolatedEtaDecay      [i][j] = 0 ;
245       fhPtFracIsolatedOtherDecay    [i][j] = 0 ;
246       //    fhPtFracIsolatedConversion    [i][j] = 0 ;
247       fhPtFracIsolatedHadron        [i][j] = 0 ;
248       
249     }
250   }
251   
252   for(Int_t i = 0; i < 5 ; i++)
253   {
254     fPtFractions    [i] = 0 ;
255     fPtThresholds   [i] = 0 ;
256     fSumPtThresholds[i] = 0 ;
257   }
258   
259   
260   for(Int_t i = 0; i < 2 ; i++)
261   {
262     fhTrackMatchedDEta[i] = 0 ;             fhTrackMatchedDPhi[i] = 0 ;           fhTrackMatchedDEtaDPhi  [i] = 0 ;
263     fhdEdx            [i] = 0 ;             fhEOverP          [i] = 0 ;           fhTrackMatchedMCParticle[i] = 0 ;
264     fhELambda0        [i] = 0 ;             fhELambda1        [i] = 0 ;
265     fhELambda0TRD     [i] = 0 ;             fhELambda1TRD     [i] = 0 ;
266     
267     fhELambda0MCPhoton  [i] = 0 ;           fhELambda0MCPi0       [i] = 0 ;       fhELambda0MCPi0Decay[i] = 0 ;
268     fhELambda0MCEtaDecay[i] = 0 ;           fhELambda0MCOtherDecay[i] = 0 ;       fhELambda0MCHadron  [i] = 0 ;
269     fhPtLambda0        [i] = 0 ;            fhPtLambda0TRD     [i] = 0 ;
270     fhPtLambda0MCPhotonPrompt  [i] = 0 ;    fhPtLambda0MCPhotonFrag  [i] = 0 ;
271     // Number of local maxima in cluster
272     fhNLocMax        [i] = 0 ;
273     fhELambda0LocMax1[i] = 0 ;              fhELambda1LocMax1[i] = 0 ;
274     fhELambda0LocMax2[i] = 0 ;              fhELambda1LocMax2[i] = 0 ;
275     fhELambda0LocMaxN[i] = 0 ;              fhELambda1LocMaxN[i] = 0 ;
276     
277   }
278   
279   
280   // Acceptance
281   for(Int_t i = 0; i < 7; i++)
282   {
283     fhPtPrimMCiso[i] = 0;
284     fhEPrimMC    [i] = 0;
285     fhEtaPrimMC  [i] = 0;
286     fhPhiPrimMC  [i] = 0;
287   }
288   
289   // Pile-Up
290   
291   for(Int_t i = 0 ; i < 7 ; i++)
292   {
293     fhPtInConePileUp[i] = 0 ;
294     fhEIsoPileUp    [i] = 0 ;
295     fhPtIsoPileUp   [i] = 0 ;
296     fhENoIsoPileUp  [i] = 0 ;
297     fhPtNoIsoPileUp [i] = 0 ;
298   }
299   
300 }
301
302 //_______________________________________________________________________________________________
303 void AliAnaParticleIsolation::CalculateCaloUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
304                                                   Float_t & etaBandPtSum, Float_t & phiBandPtSum)
305 {
306   // Get the clusters pT or sum of pT in phi/eta bands or at 45 degrees from trigger
307   
308   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
309   
310   Float_t conesize   = GetIsolationCut()->GetConeSize();
311   TLorentzVector mom ;
312   
313   //Select the Calorimeter 
314   TObjArray * pl = 0x0;
315   if      (fCalorimeter == "PHOS" )
316     pl    = GetPHOSClusters();
317   else if (fCalorimeter == "EMCAL")
318     pl    = GetEMCALClusters();
319   
320   if(!pl) return ;
321   
322   //Get vertex for cluster momentum calculation
323   Double_t vertex[] = {0,0,0} ; //vertex ;
324   if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
325     GetReader()->GetVertex(vertex);
326   
327   Float_t ptTrig    = pCandidate->Pt() ;
328   Float_t phiTrig   = pCandidate->Phi();
329   Float_t etaTrig   = pCandidate->Eta();
330   
331   for(Int_t icluster=0; icluster < pl->GetEntriesFast(); icluster++)
332   {
333     AliVCluster* cluster = (AliVCluster *) pl->At(icluster);
334     
335     if(!cluster)
336     {
337       printf("AliAnaParticleIsolation::MakeAnalysisFillHistograms() - Cluster not available?");
338       continue;
339     }
340         
341     //Do not count the candidate (photon or pi0) or the daughters of the candidate
342     if(cluster->GetID() == pCandidate->GetCaloLabel(0) ||
343        cluster->GetID() == pCandidate->GetCaloLabel(1)   ) continue ;
344     
345     //Remove matched clusters to tracks if Neutral and Track info is used
346     if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kNeutralAndCharged &&
347         IsTrackMatched(cluster,GetReader()->GetInputEvent())) continue ;
348     
349     cluster->GetMomentum(mom,vertex) ;//Assume that come from vertex in straight line
350     
351     //exclude particles in cone
352     Float_t rad = GetIsolationCut()->Radius(etaTrig, phiTrig, mom.Eta(), mom.Phi());
353     
354     // histo of eta and phi for all clusters
355     fhEtaPhiCluster->Fill(mom.Eta(), mom.Phi());
356     if(rad < conesize) {
357         // histos for all clusters in cone
358      fhEtaPhiInConeCluster->Fill(mom.Eta(), mom.Phi());
359     continue ;
360     }
361     //fill histogram for UE in phi band in EMCal acceptance
362     if(mom.Eta() > (etaTrig-conesize) && mom.Eta()  < (etaTrig+conesize))
363     {
364       phiBandPtSum+=mom.Pt();
365       fhPhiBandCluster->Fill(mom.Eta(),mom.Phi());
366       
367 }
368     
369     //fill histogram for UE in eta band in EMCal acceptance
370     if(mom.Phi() > (phiTrig-conesize) && mom.Phi() < (phiTrig+conesize))
371     {
372       etaBandPtSum+=mom.Pt();
373       fhEtaBandCluster->Fill(mom.Eta(),mom.Phi());
374     }
375   }
376   
377   fhConeSumPtEtaBandUECluster          ->Fill(ptTrig  ,       etaBandPtSum);
378   fhConeSumPtPhiBandUECluster          ->Fill(ptTrig  ,       phiBandPtSum);
379   fhConeSumPtEtaBandUEClusterTrigEtaPhi->Fill(etaTrig,phiTrig,etaBandPtSum);
380   fhConeSumPtPhiBandUEClusterTrigEtaPhi->Fill(etaTrig,phiTrig,phiBandPtSum);
381
382 }
383
384 //________________________________________________________________________________________________
385 void AliAnaParticleIsolation::CalculateCaloCellUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
386                                                       Float_t & etaBandPtSumCells, Float_t & phiBandPtSumCells)
387 {
388   // Get the cells amplitude or sum of amplitude in phi/eta bands or at 45 degrees from trigger
389   
390   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
391   
392   Float_t conesize = GetIsolationCut()->GetConeSize();
393   
394   Float_t phiTrig = pCandidate->Phi();
395   if(phiTrig<0) phiTrig += TMath::TwoPi();
396   Float_t etaTrig = pCandidate->Eta();
397   
398   if(pCandidate->GetDetector()=="EMCAL")
399   {
400     AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
401     Int_t absId = -999;
402     
403     if (eGeom->GetAbsCellIdFromEtaPhi(etaTrig,phiTrig,absId))
404     {
405       if(!eGeom->CheckAbsCellId(absId)) return ;
406       
407       // Get absolute (col,row) of trigger particle
408       Int_t nSupMod = eGeom->GetSuperModuleNumber(absId);
409       Int_t nModule = -1;
410       Int_t imEta=-1, imPhi=-1;
411       Int_t ieta =-1, iphi =-1;
412
413       if (eGeom->GetCellIndex(absId,nSupMod,nModule,imPhi,imEta))
414       {
415         eGeom->GetCellPhiEtaIndexInSModule(nSupMod,nModule,imPhi,imEta,iphi,ieta);
416         
417         Int_t colTrig = ieta;
418         if (nSupMod % 2) colTrig = AliEMCALGeoParams::fgkEMCALCols + ieta ;
419         Int_t rowTrig = iphi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
420         
421         Int_t sqrSize = int(conesize/0.0143);
422         
423         AliVCaloCells * cells = GetEMCALCells();
424         
425         Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 24*(16/3) 5 full-size Sectors (2 SM) + 1 one-third Sector (2 SM)
426         Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols;
427         //  printf("nTotalRows %i, nTotalCols %i\n",nTotalRows,nTotalCols);
428         // Loop on cells in eta band
429           
430                   Int_t irowmin = rowTrig-sqrSize;
431           if(irowmin<0) irowmin=0;
432   Int_t irowmax = rowTrig+sqrSize;
433           if(irowmax>AliEMCALGeoParams::fgkEMCALRows) irowmax=AliEMCALGeoParams::fgkEMCALRows;
434
435
436         for(Int_t irow = irowmin; irow <irowmax; irow++)
437         {
438           for(Int_t icol = 0; icol < nTotalCols; icol++)
439           {
440             Int_t inSector = int(irow/AliEMCALGeoParams::fgkEMCALRows);
441         if(inSector==5) continue;
442           Int_t inSupMod = -1;
443             Int_t icolLoc  = -1;
444             if(icol < AliEMCALGeoParams::fgkEMCALCols)
445             {
446               inSupMod = 2*inSector + 1;
447               icolLoc  = icol;
448             }
449             else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
450             {
451               inSupMod = 2*inSector;
452               icolLoc  = icol-AliEMCALGeoParams::fgkEMCALCols;
453             }
454             
455             Int_t irowLoc  = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ;
456
457             // Exclude cells in cone
458             if(TMath::Abs(icol-colTrig) < sqrSize || TMath::Abs(irow-rowTrig) < sqrSize){
459                  continue ;
460             }
461             Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
462             if(!eGeom->CheckAbsCellId(iabsId)) continue;
463             etaBandPtSumCells += cells->GetCellAmplitude(iabsId);
464                 fhEtaBandCell->Fill(colTrig,rowTrig);
465                 
466     //          printf("ETA inSupMod %i,irowLoc %i,icolLoc %i, iabsId %i, etaBandPtSumCells %f\n",nSupMod,irowLoc,icolLoc,iabsId,etaBandPtSumCells);
467   }
468         }
469     Int_t icolmin = colTrig-sqrSize;
470           if(icolmin<0) icolmin=0;
471           Int_t icolmax = colTrig+sqrSize;
472           if(icolmax>AliEMCALGeoParams::fgkEMCALCols) icolmax=AliEMCALGeoParams::fgkEMCALCols;
473               
474         // Loop on cells in phi band
475         for(Int_t icol = icolmin; icol < icolmax; icol++)
476         {
477           for(Int_t irow = 0; irow < nTotalRows; irow++)
478           {       
479             Int_t inSector = int(irow/AliEMCALGeoParams::fgkEMCALRows);
480                 if(inSector==5) continue;
481             Int_t inSupMod = -1;
482             Int_t icolLoc  = -1;
483         //    printf("icol %i, irow %i, inSector %i\n",icol,irow ,inSector);
484             if(icol < AliEMCALGeoParams::fgkEMCALCols)
485             {
486         //      printf("icol < AliEMCALGeoParams::fgkEMCALCols %i\n",AliEMCALGeoParams::fgkEMCALCols );
487               inSupMod = 2*inSector + 1;
488               icolLoc  = icol;
489             }
490             else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
491             {
492      //      printf("icol > AliEMCALGeoParams::fgkEMCALCols -1 %i\n",AliEMCALGeoParams::fgkEMCALCols -1 );
493              inSupMod = 2*inSector;
494               icolLoc  = icol-AliEMCALGeoParams::fgkEMCALCols;
495             }
496             
497             Int_t irowLoc  = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ;   // Stesso problema di sopra //
498
499             // Exclude cells in cone
500             if(TMath::Abs(icol-colTrig) < sqrSize) {
501                 //printf("TMath::Abs(icol-colTrig) %i < sqrSize %i\n",TMath::Abs(icol-colTrig) ,sqrSize);continue ;
502                 }      
503             if(TMath::Abs(irow-rowTrig) < sqrSize) {
504                 //printf("TMath::Abs(irow-rowTrig) %i < sqrSize %i\n",TMath::Abs(irow-rowTrig) ,sqrSize);continue ;
505                 }      
506             
507             Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
508             if(!eGeom->CheckAbsCellId(iabsId)) {printf("!eGeom->CheckAbsCellId(iabsId=%i) inSupMod %i irowLoc %i icolLoc %i \n",iabsId,inSupMod, irowLoc, icolLoc);continue;}
509             phiBandPtSumCells += cells->GetCellAmplitude(iabsId);
510                 fhPhiBandCell->Fill(colTrig,rowTrig);
511          //printf("inSupMod %i,irowLoc %i,icolLoc %i, iabsId %i, phiBandPtSumCells %f\n",nSupMod,irowLoc,icolLoc,iabsId,phiBandPtSumCells);
512             }
513         }
514       }
515     }
516   }
517   
518   Float_t ptTrig = pCandidate->Pt();
519   
520   fhConeSumPtEtaBandUECell          ->Fill(ptTrig ,        etaBandPtSumCells);
521   fhConeSumPtPhiBandUECell          ->Fill(ptTrig ,        phiBandPtSumCells);
522   fhConeSumPtEtaBandUECellTrigEtaPhi->Fill(etaTrig,phiTrig,etaBandPtSumCells);
523   fhConeSumPtPhiBandUECellTrigEtaPhi->Fill(etaTrig,phiTrig,phiBandPtSumCells);
524   
525 }
526
527 //________________________________________________________________________________________________
528 void AliAnaParticleIsolation::CalculateTrackUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
529                                                    Float_t & etaBandPtSum, Float_t & phiBandPtSum)
530 {
531   // Get the track pT or sum of pT in phi/eta bands or at 45 degrees from trigger
532   
533   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyNeutral ) return ;
534   
535   Float_t conesize   = GetIsolationCut()->GetConeSize();
536   
537   Double_t sumptPerp= 0. ;
538   Float_t ptTrig    = pCandidate->Pt() ;
539   Float_t phiTrig   = pCandidate->Phi();
540   Float_t etaTrig   = pCandidate->Eta();
541   
542   TObjArray * trackList   = GetCTSTracks() ;
543   for(Int_t itrack=0; itrack < trackList->GetEntriesFast(); itrack++)
544   {
545     AliVTrack* track = (AliVTrack *) trackList->At(itrack);
546     
547     if(!track)
548     {
549       printf("AliAnaParticleIsolation::CalculateTrackUEBand() - Track not available?");
550       continue;
551     }
552     
553     //Do not count the candidate (pion, conversion photon) or the daughters of the candidate
554     if(track->GetID() == pCandidate->GetTrackLabel(0) || track->GetID() == pCandidate->GetTrackLabel(1) ||
555        track->GetID() == pCandidate->GetTrackLabel(2) || track->GetID() == pCandidate->GetTrackLabel(3)   ) continue ;
556    
557    // histo of eta:phi for all tracks 
558     fhEtaPhiTrack->Fill(track->Eta(),track->Phi());
559    
560     //exclude particles in cone
561     Float_t rad = GetIsolationCut()->Radius(etaTrig, phiTrig, track->Eta(), track->Phi());
562     if(rad < conesize) {
563         // histo of eta:phi for all tracks in cone
564         fhEtaPhiInConeTrack->Fill(track->Eta(),track->Phi());
565       continue ;
566     }
567     
568     //fill histogram for UE in phi band
569     if(track->Eta() > (etaTrig-conesize) && track->Eta()  < (etaTrig+conesize))
570     {
571       phiBandPtSum+=track->Pt();
572       fhPhiBandTrack->Fill(track->Eta(),track->Phi());
573     }
574     
575     //fill histogram for UE in eta band in EMCal acceptance
576     if(track->Phi() > (phiTrig-conesize) && track->Phi() < (phiTrig+conesize)) 
577     {
578       etaBandPtSum+=track->Pt();
579       fhEtaBandTrack->Fill(track->Eta(),track->Phi());
580     }
581     
582     //fill the histograms at +-45 degrees in phi from trigger particle, perpedicular to trigger axis in phi
583     Double_t dPhi = phiTrig - track->Phi() + TMath::PiOver2();
584     Double_t dEta = etaTrig - track->Eta();
585     Double_t arg  = dPhi*dPhi + dEta*dEta;
586     if(TMath::Sqrt(arg) < conesize)
587     {
588       fhPtInPerpCone->Fill(ptTrig,TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py()));
589       sumptPerp+=track->Pt();
590     }
591     
592     dPhi = phiTrig - track->Phi() - TMath::PiOver2();
593     arg  = dPhi*dPhi + dEta*dEta;
594     if(TMath::Sqrt(arg) < conesize)
595     {
596       fhPtInPerpCone->Fill(ptTrig,TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py()));
597       sumptPerp+=track->Pt();
598     }
599   }
600   
601   fhPerpConeSumPt                    ->Fill(ptTrig ,        sumptPerp   );
602   fhConeSumPtEtaBandUETrack          ->Fill(ptTrig ,        etaBandPtSum);
603   fhConeSumPtPhiBandUETrack          ->Fill(ptTrig ,        phiBandPtSum);
604   fhConeSumPtEtaBandUETrackTrigEtaPhi->Fill(etaTrig,phiTrig,etaBandPtSum);
605   fhConeSumPtPhiBandUETrackTrigEtaPhi->Fill(etaTrig,phiTrig,phiBandPtSum);
606
607 }
608
609
610
611 //_____________________________________________________________________________________________________________________________________
612 void AliAnaParticleIsolation::CalculateNormalizeUEBandPerUnitArea(AliAODPWG4ParticleCorrelation * pCandidate, Float_t coneptsumCluster,
613                                                                   Float_t coneptsumCell,          Float_t coneptsumTrack,
614                                                                   Float_t &etaBandptsumTrackNorm, Float_t &etaBandptsumClusterNorm)
615 {
616   //normalize phi/eta band per area unit
617
618   Float_t etaUEptsumTrack   = 0 ;
619   Float_t phiUEptsumTrack   = 0 ;
620   Float_t etaUEptsumCluster = 0 ;
621   Float_t phiUEptsumCluster = 0 ;
622   Float_t etaUEptsumCell    = 0 ;
623   Float_t phiUEptsumCell    = 0 ;
624   
625   Int_t   partTypeInCone    = GetIsolationCut()->GetParticleTypeInCone();
626   
627   // Do the normalization
628   
629   Float_t conesize  = GetIsolationCut()->GetConeSize();
630   Float_t coneA     = conesize*conesize*TMath::Pi(); // A = pi R^2, isolation cone area
631   Float_t ptTrig    = pCandidate->Pt() ;
632   Float_t phiTrig   = pCandidate->Phi();
633   Float_t etaTrig   = pCandidate->Eta();
634   
635
636   // ------ //
637   // Tracks //
638   // ------ //
639   Float_t phiUEptsumTrackNorm  = 0 ;
640   Float_t etaUEptsumTrackNorm  = 0 ;
641   Float_t coneptsumTrackSubPhi = 0 ;
642   Float_t coneptsumTrackSubEta = 0 ;
643   Float_t coneptsumTrackSubPhiNorm = 0 ;
644   Float_t coneptsumTrackSubEtaNorm = 0 ;
645   etaBandptsumTrackNorm = 0 ;
646
647   if( partTypeInCone!=AliIsolationCut::kOnlyNeutral )
648   {
649     // Sum the pT in the phi or eta band for clusters or tracks
650     CalculateTrackUEBand   (pCandidate,etaUEptsumTrack  ,phiUEptsumTrack  );// rajouter ici l'histo eta phi
651
652   //Fill histos
653   fhConeSumPtVSUETracksEtaBand->Fill(coneptsumTrack,etaUEptsumTrack);
654   fhConeSumPtVSUETracksPhiBand->Fill(coneptsumTrack,phiUEptsumTrack);
655
656
657     Float_t correctConeSumTrack    = 1;
658     Float_t correctConeSumTrackPhi = 1;
659
660     GetIsolationCut()->CalculateUEBandTrackNormalization(GetReader(),etaTrig, phiTrig,
661                                                            phiUEptsumTrack,etaUEptsumTrack,
662                                                            phiUEptsumTrackNorm,etaUEptsumTrackNorm,
663                                                            correctConeSumTrack,correctConeSumTrackPhi);
664
665     coneptsumTrackSubPhi = coneptsumTrack - phiUEptsumTrackNorm;
666     coneptsumTrackSubEta = coneptsumTrack - etaUEptsumTrackNorm;
667
668     etaBandptsumTrackNorm = etaUEptsumTrackNorm;
669     
670     fhConeSumPtPhiUESubTrack           ->Fill(ptTrig ,          coneptsumTrackSubPhi);
671     fhConeSumPtPhiUESubTrackTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumTrackSubPhi);
672     fhConeSumPtEtaUESubTrack           ->Fill(ptTrig ,          coneptsumTrackSubEta);
673     fhConeSumPtEtaUESubTrackTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumTrackSubEta);
674     
675     fhFractionTrackOutConeEta          ->Fill(ptTrig ,         correctConeSumTrack-1);
676     fhFractionTrackOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig,correctConeSumTrack-1);
677     
678     if(coneptsumTrack > 0)
679     {
680       coneptsumTrackSubPhiNorm = coneptsumTrackSubPhi/coneptsumTrack;
681         coneptsumTrackSubEtaNorm = coneptsumTrackSubEta/coneptsumTrack;
682     }
683     
684     fhConeSumPtSubvsConeSumPtTotPhiTrack    ->Fill(coneptsumTrack,coneptsumTrackSubPhi);
685     fhConeSumPtSubNormvsConeSumPtTotPhiTrack->Fill(coneptsumTrack,coneptsumTrackSubPhiNorm);
686     fhConeSumPtSubvsConeSumPtTotEtaTrack    ->Fill(coneptsumTrack,coneptsumTrackSubEta);
687     fhConeSumPtSubNormvsConeSumPtTotEtaTrack->Fill(coneptsumTrack,coneptsumTrackSubEtaNorm);
688     
689   }
690   
691   // ------------------------ //
692   // EMCal Clusters and cells //
693   // ------------------------ //
694   Float_t phiUEptsumClusterNorm  = 0 ;
695   Float_t etaUEptsumClusterNorm  = 0 ;
696   Float_t coneptsumClusterSubPhi = 0 ;
697   Float_t coneptsumClusterSubEta = 0 ;
698   Float_t coneptsumClusterSubPhiNorm = 0 ;
699   Float_t coneptsumClusterSubEtaNorm = 0 ;
700   Float_t phiUEptsumCellNorm     = 0 ;
701   Float_t etaUEptsumCellNorm     = 0 ;
702   Float_t coneptsumCellSubPhi    = 0 ;
703   Float_t coneptsumCellSubEta    = 0 ;
704   Float_t coneptsumCellSubPhiNorm = 0 ;
705   Float_t coneptsumCellSubEtaNorm = 0 ;
706   etaBandptsumClusterNorm = 0;
707
708   if( partTypeInCone!=AliIsolationCut::kOnlyCharged )
709   {
710
711     // -------------- //
712     // EMCal clusters //
713     // -------------- //
714     
715     // Sum the pT in the phi or eta band for clusters or tracks
716     CalculateCaloUEBand    (pCandidate,etaUEptsumCluster,phiUEptsumCluster);// rajouter ici l'histo eta phi
717
718   //Fill histos
719   fhConeSumPtVSUEClusterEtaBand->Fill(coneptsumCluster,etaUEptsumCluster);
720   fhConeSumPtVSUEClusterPhiBand->Fill(coneptsumCluster,phiUEptsumCluster);
721
722
723     Float_t correctConeSumClusterEta = 1;
724     Float_t correctConeSumClusterPhi = 1;
725
726     GetIsolationCut()->CalculateUEBandClusterNormalization(GetReader(),etaTrig, phiTrig,
727                                                            phiUEptsumCluster,etaUEptsumCluster,
728                                                            phiUEptsumClusterNorm,etaUEptsumClusterNorm,
729                                                            correctConeSumClusterEta,correctConeSumClusterPhi);
730     
731     // In case that cone is out of eta and phi side, we are over correcting, not too often with the current cuts ...
732     // Comment if not used
733     //  Float_t coneBadCellsCoeff   =1;
734     //  Float_t etaBandBadCellsCoeff=1;
735     //  Float_t phiBandBadCellsCoeff=1;
736     //  GetIsolationCut()->GetCoeffNormBadCell(pCandidate,   GetReader(),coneBadCellsCoeff,etaBandBadCellsCoeff,phiBandBadCellsCoeff) ;
737
738     //coneptsumCluster=coneptsumCluster*coneBadCellsCoeff*correctConeSumClusterEta*correctConeSumClusterPhi;
739     
740     coneptsumClusterSubPhi = coneptsumCluster - phiUEptsumClusterNorm;
741     coneptsumClusterSubEta = coneptsumCluster - etaUEptsumClusterNorm;
742     
743     etaBandptsumClusterNorm = etaUEptsumClusterNorm;
744
745     fhConeSumPtPhiUESubCluster           ->Fill(ptTrig ,          coneptsumClusterSubPhi);
746     fhConeSumPtPhiUESubClusterTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumClusterSubPhi);
747     fhConeSumPtEtaUESubCluster           ->Fill(ptTrig ,          coneptsumClusterSubEta);
748     fhConeSumPtEtaUESubClusterTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumClusterSubEta);
749     
750     fhFractionClusterOutConeEta          ->Fill(ptTrig ,          correctConeSumClusterEta-1);
751     fhFractionClusterOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumClusterEta-1);
752     fhFractionClusterOutConePhi          ->Fill(ptTrig ,          correctConeSumClusterPhi-1);
753     fhFractionClusterOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumClusterPhi-1);
754     
755     if(coneptsumCluster!=0)
756     {
757             coneptsumClusterSubPhiNorm = coneptsumClusterSubPhi/coneptsumCluster;
758         coneptsumClusterSubEtaNorm = coneptsumClusterSubEta/coneptsumCluster;
759     }
760     
761     fhConeSumPtSubvsConeSumPtTotPhiCluster    ->Fill(coneptsumCluster,coneptsumClusterSubPhi);
762     fhConeSumPtSubNormvsConeSumPtTotPhiCluster->Fill(coneptsumCluster,coneptsumClusterSubPhiNorm);
763     fhConeSumPtSubvsConeSumPtTotEtaCluster    ->Fill(coneptsumCluster,coneptsumClusterSubEta);
764     fhConeSumPtSubNormvsConeSumPtTotEtaCluster->Fill(coneptsumCluster,coneptsumClusterSubEtaNorm);
765     
766     // ----------- //
767     // EMCal Cells //
768     // ----------- //
769     
770     // Sum the pT in the phi or eta band for clusters or tracks
771     CalculateCaloCellUEBand(pCandidate,etaUEptsumCell   ,phiUEptsumCell   );
772
773     // Move to AliIsolationCut the calculation not the histograms??
774     
775     //Careful here if EMCal limits changed .. 2010 (4 SM) to 2011-12 (10 SM), for the moment consider 100 deg in phi
776     Float_t emcEtaSize = 0.7*2; // TO FIX
777     Float_t emcPhiSize = TMath::DegToRad()*100.; // TO FIX
778     
779     if(((2*conesize*emcPhiSize)-coneA)!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*conesize*emcPhiSize)-coneA));
780     if(((2*conesize*emcEtaSize)-coneA)!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*conesize*emcEtaSize)-coneA));
781     
782     // Need to correct coneptsumCluster by the fraction of the cone out of the calorimeter cut acceptance!
783     
784     Float_t correctConeSumCellEta = 1;
785     if(TMath::Abs(etaTrig)+conesize > emcEtaSize/2.)
786     {
787       Float_t excess = TMath::Abs(etaTrig) + conesize - emcEtaSize/2.;
788       correctConeSumCellEta = GetIsolationCut()->CalculateExcessAreaFraction(excess);
789       //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);
790       // Need to correct phi band surface if part of the cone falls out of track cut acceptance!
791       if(((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta))!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta)));
792     }
793     
794     Float_t correctConeSumCellPhi = 1;
795     //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() );
796     if((phiTrig+conesize > 180*TMath::DegToRad()) ||
797        (phiTrig-conesize <  80*TMath::DegToRad()))
798     {
799       Float_t excess = 0;
800       if( phiTrig+conesize > 180*TMath::DegToRad() ) excess = conesize + phiTrig - 180*TMath::DegToRad() ;
801       else                                           excess = conesize - phiTrig +  80*TMath::DegToRad() ;
802       
803       correctConeSumCellPhi = GetIsolationCut()->CalculateExcessAreaFraction(excess);
804       //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);
805       
806       // Need to correct eta band surface if part of the cone falls out of track cut acceptance!
807       if(((2*(conesize-excess)*emcEtaSize)-(coneA-correctConeSumCellPhi))!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*(conesize-excess)*emcEtaSize)-(coneA-correctConeSumCellPhi)));
808
809     }
810     
811     // In case that cone is out of eta and phi side, we are over correcting, not too often with the current cuts ...
812     coneptsumCellSubPhi = coneptsumCell*correctConeSumCellEta*correctConeSumCellPhi - phiUEptsumCellNorm;
813     coneptsumCellSubEta = coneptsumCell*correctConeSumCellEta*correctConeSumCellPhi - etaUEptsumCellNorm;
814     
815     fhConeSumPtPhiUESubCell           ->Fill(ptTrig ,          coneptsumCellSubPhi);
816     fhConeSumPtPhiUESubCellTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumCellSubPhi);
817     fhConeSumPtEtaUESubCell           ->Fill(ptTrig ,          coneptsumCellSubEta);
818     fhConeSumPtEtaUESubCellTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumCellSubEta);
819     
820     fhFractionCellOutConeEta          ->Fill(ptTrig ,          correctConeSumCellEta-1);
821     fhFractionCellOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellEta-1);
822     fhFractionCellOutConePhi          ->Fill(ptTrig ,          correctConeSumCellPhi-1);
823     fhFractionCellOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellPhi-1);
824     if(coneptsumCell!=0)
825     {
826       coneptsumCellSubPhiNorm = coneptsumCellSubPhi/coneptsumCell;
827         coneptsumCellSubEtaNorm = coneptsumCellSubEta/coneptsumCell;
828     }
829     
830     fhConeSumPtSubvsConeSumPtTotPhiCell    ->Fill(coneptsumCell,coneptsumCellSubPhi);
831     fhConeSumPtSubNormvsConeSumPtTotPhiCell->Fill(coneptsumCell,coneptsumCellSubPhiNorm);
832     fhConeSumPtSubvsConeSumPtTotEtaCell    ->Fill(coneptsumCell,coneptsumCellSubEta);
833     fhConeSumPtSubNormvsConeSumPtTotEtaCell->Fill(coneptsumCell,coneptsumCellSubEtaNorm);
834   }
835     
836   if( partTypeInCone==AliIsolationCut::kNeutralAndCharged )
837   {
838     
839     // --------------------------- //
840     // Tracks and clusters in cone //
841     // --------------------------- //
842     
843     Double_t sumPhiUESub = coneptsumClusterSubPhi + coneptsumTrackSubPhi;
844     Double_t sumEtaUESub = coneptsumClusterSubEta + coneptsumTrackSubEta;
845     
846     fhConeSumPtPhiUESub          ->Fill(ptTrig ,          sumPhiUESub);
847     fhConeSumPtPhiUESubTrigEtaPhi->Fill(etaTrig, phiTrig, sumPhiUESub);
848     fhConeSumPtEtaUESub          ->Fill(ptTrig ,          sumEtaUESub);
849     fhConeSumPtEtaUESubTrigEtaPhi->Fill(etaTrig, phiTrig, sumEtaUESub);
850     
851     fhEtaBandClustervsTrack    ->Fill(etaUEptsumCluster    ,etaUEptsumTrack    );
852     fhPhiBandClustervsTrack    ->Fill(phiUEptsumCluster    ,phiUEptsumTrack    );
853     fhEtaBandNormClustervsTrack->Fill(etaUEptsumClusterNorm,etaUEptsumTrackNorm);
854     fhPhiBandNormClustervsTrack->Fill(phiUEptsumClusterNorm,phiUEptsumTrackNorm);
855     
856     fhConeSumPtEtaUESubClustervsTrack->Fill(coneptsumClusterSubEta,coneptsumTrackSubEta);
857     fhConeSumPtPhiUESubClustervsTrack->Fill(coneptsumClusterSubPhi,coneptsumTrackSubPhi);
858         
859     // ------------------------ //
860     // Tracks and cells in cone //
861     // ------------------------ //
862     
863     Double_t sumPhiUESubTrackCell = coneptsumCellSubPhi + coneptsumTrackSubPhi;
864     Double_t sumEtaUESubTrackCell = coneptsumCellSubEta + coneptsumTrackSubEta;
865     
866     fhConeSumPtPhiUESubTrackCell          ->Fill(ptTrig ,          sumPhiUESubTrackCell);
867     fhConeSumPtPhiUESubTrackCellTrigEtaPhi->Fill(etaTrig, phiTrig, sumPhiUESubTrackCell);
868     fhConeSumPtEtaUESubTrackCell          ->Fill(ptTrig ,          sumEtaUESubTrackCell);
869     fhConeSumPtEtaUESubTrackCellTrigEtaPhi->Fill(etaTrig, phiTrig, sumEtaUESubTrackCell);
870     
871     fhEtaBandCellvsTrack    ->Fill(etaUEptsumCell    ,etaUEptsumTrack    );
872     fhPhiBandCellvsTrack    ->Fill(phiUEptsumCell    ,phiUEptsumTrack    );
873     fhEtaBandNormCellvsTrack->Fill(etaUEptsumCellNorm,etaUEptsumTrackNorm);
874     fhPhiBandNormCellvsTrack->Fill(phiUEptsumCellNorm,phiUEptsumTrackNorm);
875     
876     fhConeSumPtEtaUESubCellvsTrack->Fill(coneptsumCellSubEta,coneptsumTrackSubEta);
877     fhConeSumPtPhiUESubCellvsTrack->Fill(coneptsumCellSubPhi,coneptsumTrackSubPhi);
878  
879     
880   }
881 }
882
883
884 //__________________________________________________________________________________________________
885 void AliAnaParticleIsolation::CalculateCaloSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
886                                                         Float_t & coneptsumCluster)
887 {
888   // Get the cluster pT or sum of pT in isolation cone
889   
890   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
891   
892   //Recover reference arrays with clusters and tracks
893   TObjArray * refclusters = aodParticle->GetObjArray(GetAODObjArrayName()+"Clusters");  
894   if(!refclusters) return ;
895   
896   Float_t ptTrig = aodParticle->Pt();
897
898   //Get vertex for cluster momentum calculation
899   Double_t vertex[] = {0,0,0} ; //vertex ;
900   if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
901     GetReader()->GetVertex(vertex);
902   
903   TLorentzVector mom ;
904   for(Int_t icalo=0; icalo < refclusters->GetEntriesFast(); icalo++)
905   {
906     AliVCluster* calo = (AliVCluster *) refclusters->At(icalo);
907     calo->GetMomentum(mom,vertex) ;//Assume that come from vertex in straight line
908     
909     fhPtInCone       ->Fill(ptTrig, mom.Pt());
910     fhPtClusterInCone->Fill(ptTrig, mom.Pt());
911     
912     if(fFillPileUpHistograms)
913     {
914       if(GetReader()->IsPileUpFromSPD())               fhPtInConePileUp[0]->Fill(ptTrig,mom.Pt());
915       if(GetReader()->IsPileUpFromEMCal())             fhPtInConePileUp[1]->Fill(ptTrig,mom.Pt());
916       if(GetReader()->IsPileUpFromSPDOrEMCal())        fhPtInConePileUp[2]->Fill(ptTrig,mom.Pt());
917       if(GetReader()->IsPileUpFromSPDAndEMCal())       fhPtInConePileUp[3]->Fill(ptTrig,mom.Pt());
918       if(GetReader()->IsPileUpFromSPDAndNotEMCal())    fhPtInConePileUp[4]->Fill(ptTrig,mom.Pt());
919       if(GetReader()->IsPileUpFromEMCalAndNotSPD())    fhPtInConePileUp[5]->Fill(ptTrig,mom.Pt());
920       if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtInConePileUp[6]->Fill(ptTrig,mom.Pt());
921     }
922     
923     fhPtInConeCent->Fill(GetEventCentrality(),mom.Pt());
924     coneptsumCluster+=mom.Pt();
925   }
926
927   fhConeSumPtCluster   ->Fill(ptTrig,     coneptsumCluster);
928 }
929
930 //______________________________________________________________________________________________________
931 void AliAnaParticleIsolation::CalculateCaloCellSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
932                                                             Float_t & coneptsumCell)
933 {
934   // Get the cell amplityde or sum of amplitudes in isolation cone
935   // Mising: Remove signal cells in cone in case the trigger is a cluster!
936   
937   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
938   
939   Float_t conesize = GetIsolationCut()->GetConeSize();
940   
941   Float_t  ptTrig  = aodParticle->Pt();
942   Float_t  phiTrig = aodParticle->Phi();
943   if(phiTrig<0) phiTrig += TMath::TwoPi();
944   Float_t  etaTrig = aodParticle->Eta();
945   
946   if(aodParticle->GetDetector()=="EMCAL")
947   {
948     AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
949     Int_t absId = -999;
950     
951     if (eGeom->GetAbsCellIdFromEtaPhi(etaTrig,phiTrig,absId))
952     {
953       if(!eGeom->CheckAbsCellId(absId)) return ;
954       
955       // Get absolute (col,row) of trigger particle
956       Int_t nSupMod = eGeom->GetSuperModuleNumber(absId);
957       Int_t nModule = -1;
958       Int_t imEta=-1, imPhi=-1;
959       Int_t ieta =-1, iphi =-1;
960
961       if (eGeom->GetCellIndex(absId,nSupMod,nModule,imPhi,imEta))
962       {
963         Int_t iEta=-1, iPhi=-1;
964         eGeom->GetCellPhiEtaIndexInSModule(nSupMod,nModule,imPhi,imEta,iphi,ieta);
965         
966         Int_t colTrig = iEta;
967         if (nSupMod % 2) colTrig = AliEMCALGeoParams::fgkEMCALCols + iEta ;
968         Int_t rowTrig = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
969         
970         Int_t sqrSize = int(conesize/0.0143);
971         
972         AliVCaloCells * cells = GetEMCALCells();
973         
974         // Loop on cells in cone
975         for(Int_t irow = rowTrig-sqrSize; irow < rowTrig+sqrSize; irow++)
976         {
977           for(Int_t icol = colTrig-sqrSize; icol < colTrig+sqrSize; icol++)
978           {
979             Int_t inSector = int(irow/AliEMCALGeoParams::fgkEMCALRows);
980      if(inSector==5) continue;
981    
982                   Int_t inSupMod = -1;
983             Int_t icolLoc  = -1;
984             if(icol < AliEMCALGeoParams::fgkEMCALCols)
985             {
986               inSupMod = 2*inSector + 1;
987               icolLoc  = icol;
988             }
989             else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
990             {
991               inSupMod = 2*inSector;
992               icolLoc  = icol-AliEMCALGeoParams::fgkEMCALCols;
993             }
994             
995             Int_t irowLoc  = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ;
996             
997             Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
998             if(!eGeom->CheckAbsCellId(iabsId)) continue;
999             
1000             fhPtCellInCone->Fill(ptTrig, cells->GetCellAmplitude(iabsId));
1001             coneptsumCell += cells->GetCellAmplitude(iabsId);
1002           }
1003         }
1004       }
1005     }
1006   }
1007   
1008   fhConeSumPtCell->Fill(ptTrig,coneptsumCell);
1009   
1010 }
1011
1012 //___________________________________________________________________________________________________
1013 void AliAnaParticleIsolation::CalculateTrackSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
1014                                                          Float_t & coneptsumTrack)
1015 {
1016   // Get the track pT or sum of pT in isolation cone
1017   
1018   if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyNeutral ) return ;
1019   
1020   //Recover reference arrays with clusters and tracks
1021   TObjArray * reftracks   = aodParticle->GetObjArray(GetAODObjArrayName()+"Tracks");
1022   if(!reftracks) return ;
1023   
1024   Float_t  ptTrig = aodParticle->Pt();
1025   Double_t bz     = GetReader()->GetInputEvent()->GetMagneticField();
1026
1027   for(Int_t itrack=0; itrack < reftracks->GetEntriesFast(); itrack++)
1028   {
1029     AliVTrack* track = (AliVTrack *) reftracks->At(itrack);
1030     Float_t pTtrack = track->Pt();
1031     
1032     fhPtInCone     ->Fill(ptTrig,pTtrack);
1033     fhPtTrackInCone->Fill(ptTrig,pTtrack);
1034     
1035     if(fFillPileUpHistograms)
1036     {
1037       ULong_t status = track->GetStatus();
1038       Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
1039       //Double32_t tof = track->GetTOFsignal()*1e-3;
1040       Int_t trackBC = track->GetTOFBunchCrossing(bz);
1041       
1042       if     ( okTOF && trackBC!=0 ) fhPtTrackInConeOtherBC->Fill(ptTrig,pTtrack);
1043       else if( okTOF && trackBC==0 ) fhPtTrackInConeBC0    ->Fill(ptTrig,pTtrack);
1044       
1045       Int_t vtxBC = GetReader()->GetVertexBC();
1046       if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA) fhPtTrackInConeVtxBC0->Fill(ptTrig,pTtrack);
1047       
1048       if(GetReader()->IsPileUpFromSPD())             { fhPtInConePileUp[0]->Fill(ptTrig,pTtrack);
1049       if(okTOF && trackBC!=0 )                         fhPtTrackInConeOtherBCPileUpSPD->Fill(ptTrig,pTtrack);
1050       if(okTOF && trackBC==0 )                         fhPtTrackInConeBC0PileUpSPD    ->Fill(ptTrig,pTtrack); }
1051       if(GetReader()->IsPileUpFromEMCal())             fhPtInConePileUp[1]->Fill(ptTrig,pTtrack);
1052       if(GetReader()->IsPileUpFromSPDOrEMCal())        fhPtInConePileUp[2]->Fill(ptTrig,pTtrack);
1053       if(GetReader()->IsPileUpFromSPDAndEMCal())       fhPtInConePileUp[3]->Fill(ptTrig,pTtrack);
1054       if(GetReader()->IsPileUpFromSPDAndNotEMCal())    fhPtInConePileUp[4]->Fill(ptTrig,pTtrack);
1055       if(GetReader()->IsPileUpFromEMCalAndNotSPD())    fhPtInConePileUp[5]->Fill(ptTrig,pTtrack);
1056       if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtInConePileUp[6]->Fill(ptTrig,pTtrack);
1057     }
1058     
1059     fhPtInConeCent->Fill(GetEventCentrality(),pTtrack);
1060     coneptsumTrack+=pTtrack;
1061   }
1062   
1063   fhConeSumPtTrack->Fill(ptTrig, coneptsumTrack);
1064
1065 }
1066
1067 //_________________________________________________________________
1068 void AliAnaParticleIsolation::FillPileUpHistograms(Int_t clusterID)
1069 {
1070   // Fill some histograms to understand pile-up
1071   if(!fFillPileUpHistograms) return;
1072   
1073   if(clusterID < 0 ) 
1074   {
1075     printf("AliAnaParticleIsolation::FillPileUpHistograms(), ID of cluster = %d, not possible! ", clusterID);
1076     return;
1077   }
1078   
1079   Int_t iclus = -1;
1080   TObjArray* clusters = 0x0;
1081   if     (fCalorimeter == "EMCAL") clusters = GetEMCALClusters();
1082   else if(fCalorimeter == "PHOS" ) clusters = GetPHOSClusters();
1083   
1084   Float_t energy = 0;
1085   Float_t time   = -1000;
1086
1087   if(clusters)
1088   {
1089     AliVCluster *cluster = FindCluster(clusters,clusterID,iclus); 
1090     energy = cluster->E();
1091     time   = cluster->GetTOF()*1e9;
1092   } 
1093   
1094   //printf("E %f, time %f\n",energy,time);
1095   AliVEvent * event = GetReader()->GetInputEvent();
1096   
1097   fhTimeENoCut->Fill(energy,time);
1098   if(GetReader()->IsPileUpFromSPD())     fhTimeESPD     ->Fill(energy,time);
1099   if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
1100   
1101   if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
1102   
1103   AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1104   AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1105   
1106   // N pile up vertices
1107   Int_t nVerticesSPD    = -1;
1108   Int_t nVerticesTracks = -1;
1109   
1110   if      (esdEv)
1111   {
1112     nVerticesSPD    = esdEv->GetNumberOfPileupVerticesSPD();
1113     nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
1114     
1115   }//ESD
1116   else if (aodEv)
1117   {
1118     nVerticesSPD    = aodEv->GetNumberOfPileupVerticesSPD();
1119     nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
1120   }//AOD
1121   
1122   fhTimeNPileUpVertSPD  ->Fill(time,nVerticesSPD);
1123   fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
1124   
1125   //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n", 
1126   //       GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
1127   
1128   Int_t ncont = -1;
1129   Float_t z1 = -1, z2 = -1;
1130   Float_t diamZ = -1;
1131   for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
1132   {
1133     if      (esdEv)
1134     {
1135       const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1136       ncont=pv->GetNContributors();
1137       z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1138       z2 = pv->GetZ();
1139       diamZ = esdEv->GetDiamondZ();
1140     }//ESD
1141     else if (aodEv)
1142     {
1143       AliAODVertex *pv=aodEv->GetVertex(iVert);
1144       if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1145       ncont=pv->GetNContributors();
1146       z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1147       z2=pv->GetZ();
1148       diamZ = aodEv->GetDiamondZ();
1149     }// AOD
1150     
1151     Double_t distZ  = TMath::Abs(z2-z1);
1152     diamZ  = TMath::Abs(z2-diamZ);
1153     
1154     fhTimeNPileUpVertContributors  ->Fill(time,ncont);
1155     fhTimePileUpMainVertexZDistance->Fill(time,distZ);
1156     fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
1157     
1158   }// loop
1159 }
1160
1161 //_____________________________________________________________________________________________________________________
1162 void AliAnaParticleIsolation::FillTrackMatchingShowerShapeControlHistograms(AliAODPWG4ParticleCorrelation  *pCandidate)
1163 {
1164   // Fill Track matching and Shower Shape control histograms  
1165   if(!fFillTMHisto &&  !fFillSSHisto) return;
1166   
1167   Int_t  clusterID = pCandidate->GetCaloLabel(0) ;
1168   Int_t  nMaxima   = pCandidate->GetFiducialArea(); // bad name, just place holder for the moment
1169   Int_t  mcTag     = pCandidate->GetTag() ;
1170   Bool_t isolated  = pCandidate->IsIsolated();
1171   
1172   if(clusterID < 0 )
1173   {
1174     printf("AliAnaParticleIsolation::FillTrackMatchingShowerShapeControlHistograms(), ID of cluster = %d, not possible! \n", clusterID);
1175     return;
1176   }
1177   
1178   Int_t iclus = -1;
1179   TObjArray* clusters = 0x0;
1180   if     (fCalorimeter == "EMCAL") clusters = GetEMCALClusters();
1181   else if(fCalorimeter == "PHOS" ) clusters = GetPHOSClusters();
1182   
1183   Float_t energy = pCandidate->E();
1184   Float_t pt     = pCandidate->Pt();
1185   
1186   if(clusters)
1187   {
1188     AliVCluster *cluster = FindCluster(clusters,clusterID,iclus); 
1189     
1190     if(fFillSSHisto)
1191     {
1192       fhELambda0 [isolated]->Fill(energy, cluster->GetM02() );
1193       fhPtLambda0[isolated]->Fill(pt,     cluster->GetM02() ); 
1194       fhELambda1 [isolated]->Fill(energy, cluster->GetM20() );
1195       
1196       if(IsDataMC())
1197       {
1198         if     (GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPrompt) ||
1199                 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCFragmentation))
1200         {
1201           fhELambda0MCPhoton    [isolated]->Fill(energy, cluster->GetM02());
1202           
1203           if      (GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPrompt))
1204             fhPtLambda0MCPhotonPrompt  [isolated]->Fill(pt, cluster->GetM02());
1205           else if (GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCFragmentation))
1206             fhPtLambda0MCPhotonFrag    [isolated]->Fill(pt, cluster->GetM02());
1207         }
1208         else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0))           fhELambda0MCPi0       [isolated]->Fill(energy, cluster->GetM02());
1209         else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0Decay))      fhELambda0MCPi0Decay  [isolated]->Fill(energy, cluster->GetM02());
1210         else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEtaDecay))      fhELambda0MCEtaDecay  [isolated]->Fill(energy, cluster->GetM02());
1211         else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCOtherDecay))    fhELambda0MCOtherDecay[isolated]->Fill(energy, cluster->GetM02());
1212         
1213         //        else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion))    fhPtNoIsoConversion   ->Fill(energy, cluster->GetM02());
1214         else if(!GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))     fhELambda0MCHadron    [isolated]->Fill(energy, cluster->GetM02());
1215       }
1216       
1217       if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5) // TO DO: CHANGE FOR 2012
1218       {
1219         fhELambda0TRD [isolated]->Fill(energy, cluster->GetM02() );
1220         fhPtLambda0TRD[isolated]->Fill(pt    , cluster->GetM02() ); 
1221         fhELambda1TRD [isolated]->Fill(energy, cluster->GetM20() );
1222       }
1223       
1224       fhNLocMax[isolated]->Fill(energy,nMaxima);
1225       if     (nMaxima==1) { fhELambda0LocMax1[isolated]->Fill(energy,cluster->GetM02()); fhELambda1LocMax1[isolated]->Fill(energy,cluster->GetM20()); }
1226       else if(nMaxima==2) { fhELambda0LocMax2[isolated]->Fill(energy,cluster->GetM02()); fhELambda1LocMax2[isolated]->Fill(energy,cluster->GetM20()); }
1227       else                { fhELambda0LocMaxN[isolated]->Fill(energy,cluster->GetM02()); fhELambda1LocMaxN[isolated]->Fill(energy,cluster->GetM20()); }
1228     } // SS histo fill        
1229     
1230     
1231     if(fFillTMHisto)
1232     {
1233       Float_t dZ  = cluster->GetTrackDz();
1234       Float_t dR  = cluster->GetTrackDx();
1235       
1236       if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1237       {
1238         dR = 2000., dZ = 2000.;
1239         GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1240       }
1241       
1242       //printf("ParticleIsolation: dPhi %f, dEta %f\n",dR,dZ);
1243       if(fhTrackMatchedDEta[isolated] && TMath::Abs(dR) < 999)
1244       {
1245         fhTrackMatchedDEta[isolated]->Fill(energy,dZ);
1246         fhTrackMatchedDPhi[isolated]->Fill(energy,dR);
1247         if(energy > 0.5) fhTrackMatchedDEtaDPhi[isolated]->Fill(dZ,dR);
1248       }
1249       
1250       // Check dEdx and E/p of matched clusters
1251       
1252       if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1253       {
1254         
1255         AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1256         
1257         if(track) 
1258         {
1259           Float_t dEdx = track->GetTPCsignal();
1260           fhdEdx[isolated]->Fill(cluster->E(), dEdx);
1261           
1262           Float_t eOverp = cluster->E()/track->P();
1263           fhEOverP[isolated]->Fill(cluster->E(),  eOverp);
1264         }
1265         //else 
1266         //  printf("AliAnaParticleIsolation::FillTrackMatchingShowerShapeHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
1267         
1268         
1269         if(IsDataMC())
1270         {
1271           if ( !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion)  )
1272           {
1273             if       ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)      ||
1274                        GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 2.5 );
1275             else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton)    ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 0.5 );
1276             else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron)  ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 1.5 );
1277             else                                                                                   fhTrackMatchedMCParticle[isolated]->Fill(energy, 3.5 );
1278             
1279           }
1280           else
1281           {
1282             if       ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0)      ||
1283                        GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)       ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 6.5 );
1284             else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton)    ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 4.5 );
1285             else if  ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron)  ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 5.5 );
1286             else                                                                                   fhTrackMatchedMCParticle[isolated]->Fill(energy, 7.5 );
1287           }                    
1288           
1289         }  // MC           
1290         
1291       } // match window            
1292       
1293     }// TM histos fill
1294     
1295   } // clusters array available
1296   
1297 }
1298
1299 //______________________________________________________
1300 TObjString *  AliAnaParticleIsolation::GetAnalysisCuts()
1301
1302   //Save parameters used for analysis
1303   TString parList ; //this will be list of parameters used for this analysis.
1304   const Int_t buffersize = 255;
1305   char onePar[buffersize] ;
1306   
1307   snprintf(onePar, buffersize,"--- AliAnaParticleIsolation ---\n") ;
1308   parList+=onePar ;     
1309   snprintf(onePar, buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1310   parList+=onePar ;
1311   snprintf(onePar, buffersize,"fReMakeIC =%d (Flag for reisolation during histogram filling) \n",fReMakeIC) ;
1312   parList+=onePar ;
1313   snprintf(onePar, buffersize,"fMakeSeveralIC=%d (Flag for isolation with several cuts at the same time ) \n",fMakeSeveralIC) ;
1314   parList+=onePar ;  
1315   snprintf(onePar, buffersize,"fFillTMHisto=%d (Flag for track matching histograms) \n",fFillTMHisto) ;
1316   parList+=onePar ;
1317   snprintf(onePar, buffersize,"fFillSSHisto=%d (Flag for shower shape histograms) \n",fFillSSHisto) ;
1318   parList+=onePar ;
1319   
1320   if(fMakeSeveralIC)
1321   {
1322     snprintf(onePar, buffersize,"fNCones =%d (Number of cone sizes) \n",fNCones) ;
1323     parList+=onePar ;
1324     snprintf(onePar, buffersize,"fNPtThresFrac=%d (Flag for isolation with several cuts at the same time ) \n",fNPtThresFrac) ;
1325     parList+=onePar ;
1326     
1327     for(Int_t icone = 0; icone < fNCones ; icone++)
1328     {
1329       snprintf(onePar, buffersize,"fConeSizes[%d]=%1.2f (isolation cone size) \n",icone, fConeSizes[icone]) ;
1330       parList+=onePar ; 
1331     }
1332     for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1333     {
1334       snprintf(onePar, buffersize,"fPtThresholds[%d]=%1.2f (isolation pt threshold) \n",ipt, fPtThresholds[ipt]) ;
1335       parList+=onePar ; 
1336     }
1337     for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1338     {
1339       snprintf(onePar, buffersize,"fPtFractions[%d]=%1.2f (isolation pt fraction threshold) \n",ipt, fPtFractions[ipt]) ;
1340       parList+=onePar ; 
1341     }
1342     for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1343     {
1344       snprintf(onePar, buffersize,"fSumPtThresholds[%d]=%1.2f (isolation sum pt threshold) \n",ipt, fSumPtThresholds[ipt]) ;
1345       parList+=onePar ; 
1346     }           
1347   }
1348   
1349   //Get parameters set in base class.
1350   parList += GetBaseParametersList() ;
1351   
1352   //Get parameters set in IC class.
1353   if(!fMakeSeveralIC)parList += GetIsolationCut()->GetICParametersList() ;
1354   
1355   return new TObjString(parList) ;
1356   
1357 }
1358
1359 //________________________________________________________
1360 TList *  AliAnaParticleIsolation::GetCreateOutputObjects()
1361 {  
1362   // Create histograms to be saved in output file and 
1363   // store them in outputContainer
1364   TList * outputContainer = new TList() ; 
1365   outputContainer->SetName("IsolatedParticleHistos") ; 
1366   
1367   Int_t   nptbins  = GetHistogramRanges()->GetHistoPtBins();
1368   Int_t   nphibins = GetHistogramRanges()->GetHistoPhiBins();
1369   Int_t   netabins = GetHistogramRanges()->GetHistoEtaBins();
1370   Float_t ptmax    = GetHistogramRanges()->GetHistoPtMax();
1371   Float_t phimax   = GetHistogramRanges()->GetHistoPhiMax();
1372   Float_t etamax   = GetHistogramRanges()->GetHistoEtaMax();
1373   Float_t ptmin    = GetHistogramRanges()->GetHistoPtMin();
1374   Float_t phimin   = GetHistogramRanges()->GetHistoPhiMin();
1375   Float_t etamin   = GetHistogramRanges()->GetHistoEtaMin();    
1376   Int_t   ssbins   = GetHistogramRanges()->GetHistoShowerShapeBins(); 
1377   Float_t ssmax    = GetHistogramRanges()->GetHistoShowerShapeMax();  
1378   Float_t ssmin    = GetHistogramRanges()->GetHistoShowerShapeMin();
1379   Int_t   ntimebins= GetHistogramRanges()->GetHistoTimeBins();         
1380   Float_t timemax  = GetHistogramRanges()->GetHistoTimeMax();         
1381   Float_t timemin  = GetHistogramRanges()->GetHistoTimeMin();       
1382
1383   Int_t   nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();          
1384   Float_t resetamax   = GetHistogramRanges()->GetHistoTrackResidualEtaMax();          
1385   Float_t resetamin   = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1386   Int_t   nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();          
1387   Float_t resphimax   = GetHistogramRanges()->GetHistoTrackResidualPhiMax();          
1388   Float_t resphimin   = GetHistogramRanges()->GetHistoTrackResidualPhiMin();  
1389   
1390   Int_t   ndedxbins   = GetHistogramRanges()->GetHistodEdxBins();         
1391   Float_t dedxmax     = GetHistogramRanges()->GetHistodEdxMax();         
1392   Float_t dedxmin     = GetHistogramRanges()->GetHistodEdxMin();
1393   Int_t   nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();       
1394   Float_t pOverEmax   = GetHistogramRanges()->GetHistoPOverEMax();       
1395   Float_t pOverEmin   = GetHistogramRanges()->GetHistoPOverEMin();
1396   
1397   Int_t   nptsumbins    = fHistoNPtSumBins;
1398   Float_t ptsummax      = fHistoPtSumMax;
1399   Float_t ptsummin      = fHistoPtSumMin;       
1400   Int_t   nptinconebins = fHistoNPtInConeBins;
1401   Float_t ptinconemax   = fHistoPtInConeMax;
1402   Float_t ptinconemin   = fHistoPtInConeMin;
1403   
1404   //Float_t ptthre    = GetIsolationCut()->GetPtThreshold();
1405   //Float_t ptsumthre = GetIsolationCut()->GetSumPtThreshold();
1406   //Float_t ptfrac    = GetIsolationCut()->GetPtFraction();
1407   Float_t r         = GetIsolationCut()->GetConeSize();
1408   Int_t   method    = GetIsolationCut()->GetICMethod() ;
1409   Int_t   particle  = GetIsolationCut()->GetParticleTypeInCone() ;
1410   
1411   TString sThreshold = "";
1412   if      ( method == AliIsolationCut::kSumPtIC )  sThreshold = Form(", %2.2f < #Sigma #it{p}_{T}^{in cone} < %2.2f GeV/#it{c}", GetIsolationCut()->GetSumPtThreshold(), GetIsolationCut()->GetSumPtThresholdMax());
1413   else if ( method == AliIsolationCut::kPtThresIC) sThreshold = Form(", %2.2f < #it{p}_{T}^{th} < %2.2f GeV/#it{c}"            , GetIsolationCut()->GetPtThreshold(),    GetIsolationCut()->GetPtThresholdMax());
1414   else if ( method == AliIsolationCut::kPtFracIC)  sThreshold = Form(", #Sigma #it{p}_{T}^{in cone}/#it{p}_{T}^{trig} = %2.2f" , GetIsolationCut()->GetPtFraction());
1415
1416   TString sParticle = ", x^{0,#pm}";
1417   if      ( particle == AliIsolationCut::kOnlyNeutral )  sParticle = ", x^{0}";
1418   else if ( particle == AliIsolationCut::kOnlyCharged )  sParticle = ", x^{#pm}";
1419   
1420   TString parTitle = Form("#it{R} = %2.2f%s%s",GetIsolationCut()->GetConeSize(), sThreshold.Data(),sParticle.Data());
1421   
1422   TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1423   
1424   if(!fMakeSeveralIC)
1425   {
1426     TString isoName [] = {"NoIso",""};
1427     TString isoTitle[] = {"Not isolated"  ,"isolated"};
1428     
1429     fhEIso   = new TH1F("hE",
1430                         Form("Number of isolated particles vs E, %s",parTitle.Data()),
1431                         nptbins,ptmin,ptmax);
1432     fhEIso->SetYTitle("d$it{N} / d#it{E}");
1433     fhEIso->SetXTitle("#it{E} (GeV/#it{c})");
1434     outputContainer->Add(fhEIso) ;
1435     
1436     fhPtIso  = new TH1F("hPt",
1437                         Form("Number of isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
1438                         nptbins,ptmin,ptmax);
1439     fhPtIso->SetYTitle("d#it{N} / #it{p}_{T}");
1440     fhPtIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1441     outputContainer->Add(fhPtIso) ;
1442     
1443     fhPtCentralityIso  = new TH2F("hPtCentrality",
1444                                   Form("centrality vs #it{p}_{T} for isolated particles, %s",parTitle.Data()),
1445                                   nptbins,ptmin,ptmax, 100,0,100);
1446     fhPtCentralityIso->SetYTitle("centrality");
1447     fhPtCentralityIso->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1448     outputContainer->Add(fhPtCentralityIso) ;
1449     
1450     fhPtEventPlaneIso  = new TH2F("hPtEventPlane",
1451                                   Form("event plane angle vs #it{p}_{T} for isolated particles, %s",parTitle.Data()),
1452                                   nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1453     fhPtEventPlaneIso->SetYTitle("Event plane angle (rad)");
1454     fhPtEventPlaneIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1455     outputContainer->Add(fhPtEventPlaneIso) ;
1456     
1457     
1458     fhPtNLocMaxIso  = new TH2F("hPtNLocMax",
1459                                Form("Number of isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
1460                                nptbins,ptmin,ptmax,10,0,10);
1461     fhPtNLocMaxIso->SetYTitle("#it{NLM}");
1462     fhPtNLocMaxIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1463     outputContainer->Add(fhPtNLocMaxIso) ;
1464     
1465     fhPhiIso  = new TH2F("hPhi",
1466                          Form("Number of isolated particles vs #phi, %s",parTitle.Data()),
1467                          nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1468     fhPhiIso->SetYTitle("#phi");
1469     fhPhiIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1470     outputContainer->Add(fhPhiIso) ;
1471     
1472     fhEtaIso  = new TH2F("hEta",
1473                          Form("Number of isolated particles vs #eta, %s",parTitle.Data()),
1474                          nptbins,ptmin,ptmax,netabins,etamin,etamax);
1475     fhEtaIso->SetYTitle("#eta");
1476     fhEtaIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1477     outputContainer->Add(fhEtaIso) ;
1478     
1479     fhEtaPhiIso  = new TH2F("hEtaPhiIso",
1480                             Form("Number of isolated particles #eta vs #phi, %s",parTitle.Data()),
1481                             netabins,etamin,etamax,nphibins,phimin,phimax);
1482     fhEtaPhiIso->SetXTitle("#eta");
1483     fhEtaPhiIso->SetYTitle("#phi");
1484     outputContainer->Add(fhEtaPhiIso) ;
1485     
1486     fhPtDecayIso  = new TH1F("hPtDecayIso",
1487                              Form("Number of isolated #pi^{0} decay particles vs #it{p}_{T}, %s",parTitle.Data()),
1488                              nptbins,ptmin,ptmax);
1489     fhPtDecayIso->SetYTitle("#it{counts}");
1490     fhPtDecayIso->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1491     outputContainer->Add(fhPtDecayIso) ;
1492     
1493     fhEtaPhiDecayIso  = new TH2F("hEtaPhiDecayIso",
1494                                  Form("Number of isolated Pi0 decay particles #eta vs #phi, %s",parTitle.Data()),
1495                                  netabins,etamin,etamax,nphibins,phimin,phimax);
1496     fhEtaPhiDecayIso->SetXTitle("#eta");
1497     fhEtaPhiDecayIso->SetYTitle("#phi");
1498     outputContainer->Add(fhEtaPhiDecayIso) ;
1499     
1500     fhConeSumPt  = new TH2F("hConePtSum",
1501                             Form("Track and Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1502                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1503     fhConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
1504     fhConeSumPt->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1505     outputContainer->Add(fhConeSumPt) ;
1506     
1507     fhConeSumPtTrigEtaPhi  = new TH2F("hConePtSumTrigEtaPhi",
1508                             Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1509                             netabins,etamin,etamax,nphibins,phimin,phimax);
1510     fhConeSumPtTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1511     fhConeSumPtTrigEtaPhi->SetXTitle("#eta_{trigger}");
1512     fhConeSumPtTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1513     outputContainer->Add(fhConeSumPtTrigEtaPhi) ;
1514     
1515     fhPtInCone  = new TH2F("hPtInCone",
1516                            Form("#it{p}_{T} of clusters and tracks in isolation cone for #it{R} =  %2.2f",r),
1517                            nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1518     fhPtInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1519     fhPtInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1520     outputContainer->Add(fhPtInCone) ;
1521     
1522     fhPtInConeCent  = new TH2F("hPtInConeCent",
1523                                Form("#it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1524                                100,0,100,nptinconebins,ptinconemin,ptinconemax);
1525     fhPtInConeCent->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1526     fhPtInConeCent->SetXTitle("centrality");
1527     outputContainer->Add(fhPtInConeCent) ;
1528     
1529     // Cluster only histograms
1530     if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyCharged)
1531     {
1532       fhConeSumPtCluster  = new TH2F("hConePtSumCluster",
1533                                      Form("Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1534                                      nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1535       fhConeSumPtCluster->SetYTitle("#Sigma #it{p}_{T}");
1536       fhConeSumPtCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1537       outputContainer->Add(fhConeSumPtCluster) ;
1538       
1539       fhConeSumPtCell  = new TH2F("hConePtSumCell",
1540                                   Form("Cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1541                                   nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1542       fhConeSumPtCell->SetYTitle("#Sigma #it{p}_{T}");
1543       fhConeSumPtCell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1544       outputContainer->Add(fhConeSumPtCell) ;
1545       
1546       fhConeSumPtEtaBandUECluster  = new TH2F("hConePtSumEtaBandUECluster",
1547                                               "#Sigma cluster #it{p}_{T} in UE Eta Band",
1548                                               nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1549       fhConeSumPtEtaBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
1550       fhConeSumPtEtaBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1551       outputContainer->Add(fhConeSumPtEtaBandUECluster) ;
1552       
1553       fhConeSumPtPhiBandUECluster  = new TH2F("hConePtSumPhiBandUECluster",
1554                                               "#Sigma cluster #it{p}_{T} UE Phi Band",
1555                                               nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1556       fhConeSumPtPhiBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
1557       fhConeSumPtPhiBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1558       outputContainer->Add(fhConeSumPtPhiBandUECluster) ;
1559       
1560       fhConeSumPtEtaBandUEClusterTrigEtaPhi  = new TH2F("hConePtSumEtaBandUEClusterTrigEtaPhi",
1561                                                         "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} in UE Eta Band",
1562                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1563       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1564       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1565       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1566       outputContainer->Add(fhConeSumPtEtaBandUEClusterTrigEtaPhi) ;
1567       
1568       fhConeSumPtPhiBandUEClusterTrigEtaPhi  = new TH2F("hConePtSumPhiBandUEClusterTrigEtaPhi",
1569                                                         "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} UE Phi Band",
1570                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1571       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1572       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1573       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1574       outputContainer->Add(fhConeSumPtPhiBandUEClusterTrigEtaPhi) ;
1575       
1576       
1577       fhConeSumPtEtaBandUECell  = new TH2F("hConePtSumEtaBandUECell",
1578                                            "#Sigma cell #it{p}_{T} in UE Eta Band",
1579                                            nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1580       fhConeSumPtEtaBandUECell->SetYTitle("#Sigma #it{p}_{T}");
1581       fhConeSumPtEtaBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1582       outputContainer->Add(fhConeSumPtEtaBandUECell) ;
1583       
1584       fhConeSumPtPhiBandUECell  = new TH2F("hConePtSumPhiBandUECell",
1585                                            "#Sigma cell #it{p}_{T} UE Phi Band",
1586                                            nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1587       fhConeSumPtPhiBandUECell->SetYTitle("#Sigma #it{p}_{T}");
1588       fhConeSumPtPhiBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1589       outputContainer->Add(fhConeSumPtPhiBandUECell) ;
1590       
1591       fhConeSumPtEtaBandUECellTrigEtaPhi  = new TH2F("hConePtSumEtaBandUECellTrigEtaPhi",
1592                                                      "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} in UE Eta Band",
1593                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1594       fhConeSumPtEtaBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1595       fhConeSumPtEtaBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1596       fhConeSumPtEtaBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1597       outputContainer->Add(fhConeSumPtEtaBandUECellTrigEtaPhi) ;
1598       
1599       fhConeSumPtPhiBandUECellTrigEtaPhi  = new TH2F("hConePtSumPhiBandUECellTrigEtaPhi",
1600                                                      "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} UE Phi Band",
1601                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1602       fhConeSumPtPhiBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1603       fhConeSumPtPhiBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1604       fhConeSumPtPhiBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1605       outputContainer->Add(fhConeSumPtPhiBandUECellTrigEtaPhi) ;
1606
1607       
1608       fhPtClusterInCone  = new TH2F("hPtClusterInCone",
1609                                     Form("#it{p}_{T} of clusters in isolation cone for #it{R} =  %2.2f",r),
1610                                     nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1611       fhPtClusterInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1612       fhPtClusterInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1613       outputContainer->Add(fhPtClusterInCone) ;
1614       
1615       fhEtaBandCluster  = new TH2F("hEtaBandCluster",
1616                                    Form("#eta vs #phi of clusters in #eta band isolation cone for #it{R} =  %2.2f",r),
1617                                    netabins,-1,1,nphibins,0,TMath::TwoPi());
1618       fhEtaBandCluster->SetXTitle("#eta");
1619       fhEtaBandCluster->SetYTitle("#phi");
1620       outputContainer->Add(fhEtaBandCluster) ;
1621       
1622       fhPhiBandCluster  = new TH2F("hPhiBandCluster",
1623                                    Form("#eta vs #phi of clusters in #phi band isolation cone for #it{R} =  %2.2f",r),
1624                                    netabins,-1,1,nphibins,0,TMath::TwoPi());
1625       fhPhiBandCluster->SetXTitle("#eta");
1626       fhPhiBandCluster->SetYTitle("#phi");
1627       outputContainer->Add(fhPhiBandCluster) ;
1628       
1629       fhEtaPhiInConeCluster= new TH2F("hEtaPhiInConeCluster",
1630                                       Form("#eta vs #phi of clusters in cone for #it{R} =  %2.2f",r),
1631                                       netabins,-1,1,nphibins,0,TMath::TwoPi());
1632       fhEtaPhiInConeCluster->SetXTitle("#eta");
1633       fhEtaPhiInConeCluster->SetYTitle("#phi");
1634       outputContainer->Add(fhEtaPhiInConeCluster) ;
1635         
1636       fhEtaPhiCluster= new TH2F("hEtaPhiCluster",
1637                                 Form("#eta vs #phi of all clusters"),
1638                                 netabins,-1,1,nphibins,0,TMath::TwoPi());
1639       fhEtaPhiCluster->SetXTitle("#eta");
1640       fhEtaPhiCluster->SetYTitle("#phi");
1641       outputContainer->Add(fhEtaPhiCluster) ;
1642
1643       fhPtCellInCone  = new TH2F("hPtCellInCone",
1644                                  Form("#it{p}_{T} of cells in isolation cone for #it{R} =  %2.2f",r),
1645                                  nptbins,ptmin,ptmax,1000,0,50);
1646       fhPtCellInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1647       fhPtCellInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1648       outputContainer->Add(fhPtCellInCone) ;
1649
1650       fhEtaBandCell  = new TH2F("hEtaBandCell",
1651                                 Form("#col vs #row of cells in #eta band isolation cone for #it{R} =  %2.2f",r),
1652                                 96,0,95,128,0,127);
1653       fhEtaBandCell->SetXTitle("#col");
1654       fhEtaBandCell->SetYTitle("#row");
1655       outputContainer->Add(fhEtaBandCell) ;
1656       
1657       fhPhiBandCell  = new TH2F("hPhiBandCell",
1658                                 Form("#col vs #row of cells in #phi band isolation cone for #it{R} =  %2.2f",r),
1659                                 96,0,95,128,0,127);
1660       fhPhiBandCell->SetXTitle("#col");
1661       fhPhiBandCell->SetYTitle("#row");
1662       outputContainer->Add(fhPhiBandCell) ;
1663       
1664       fhConeSumPtEtaUESubCluster  = new TH2F("hConeSumPtEtaUESubCluster",
1665                                              Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1666                                              nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1667       fhConeSumPtEtaUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
1668       fhConeSumPtEtaUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1669       outputContainer->Add(fhConeSumPtEtaUESubCluster) ;
1670       
1671       fhConeSumPtPhiUESubCluster  = new TH2F("hConeSumPtPhiUESubCluster",
1672                                              Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1673                                              nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1674       fhConeSumPtPhiUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
1675       fhConeSumPtPhiUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1676       outputContainer->Add(fhConeSumPtPhiUESubCluster) ;
1677       
1678       fhConeSumPtEtaUESubClusterTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubClusterTrigEtaPhi",
1679                                                        Form("Trigger #eta vs #phi, Clusters #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1680                                                        netabins,etamin,etamax,nphibins,phimin,phimax);
1681       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1682       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1683       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1684       outputContainer->Add(fhConeSumPtEtaUESubClusterTrigEtaPhi) ;
1685       
1686       fhConeSumPtPhiUESubClusterTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubClusterTrigEtaPhi",
1687                                                        Form("Trigger #eta vs #phi, Clusters #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1688                                                        netabins,etamin,etamax,nphibins,phimin,phimax);
1689       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1690       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1691       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1692       outputContainer->Add(fhConeSumPtPhiUESubClusterTrigEtaPhi) ;
1693       
1694       
1695       fhConeSumPtEtaUESubCell  = new TH2F("hConeSumPtEtaUESubCell",
1696                                           Form("Cells #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1697                                           nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1698       fhConeSumPtEtaUESubCell->SetYTitle("#Sigma #it{p}_{T}");
1699       fhConeSumPtEtaUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1700       outputContainer->Add(fhConeSumPtEtaUESubCell) ;
1701       
1702       fhConeSumPtPhiUESubCell  = new TH2F("hConeSumPtPhiUESubCell",
1703                                           Form("Cells #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1704                                           nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1705       fhConeSumPtPhiUESubCell->SetYTitle("#Sigma #it{p}_{T}");
1706       fhConeSumPtPhiUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1707       outputContainer->Add(fhConeSumPtPhiUESubCell) ;
1708       
1709       fhConeSumPtEtaUESubCellTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubCellTrigEtaPhi",
1710                                                     Form("Trigger #eta vs #phi, Cells #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1711                                                     netabins,etamin,etamax,nphibins,phimin,phimax);
1712       fhConeSumPtEtaUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1713       fhConeSumPtEtaUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1714       fhConeSumPtEtaUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1715       outputContainer->Add(fhConeSumPtEtaUESubCellTrigEtaPhi) ;
1716       
1717       fhConeSumPtPhiUESubCellTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubCellTrigEtaPhi",
1718                                                     Form("Trigger #eta vs #phi, Cells #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1719                                                     netabins,etamin,etamax,nphibins,phimin,phimax);
1720       fhConeSumPtPhiUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1721       fhConeSumPtPhiUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1722       fhConeSumPtPhiUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1723       outputContainer->Add(fhConeSumPtPhiUESubCellTrigEtaPhi) ;
1724       
1725       
1726       fhFractionClusterOutConeEta  = new TH2F("hFractionClusterOutConeEta",
1727                                               Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #eta acceptance",r),
1728                                               nptbins,ptmin,ptmax,100,0,1);
1729       fhFractionClusterOutConeEta->SetYTitle("#it{fraction}");
1730       fhFractionClusterOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1731       outputContainer->Add(fhFractionClusterOutConeEta) ;
1732       
1733       fhFractionClusterOutConeEtaTrigEtaPhi  = new TH2F("hFractionClusterOutConeEtaTrigEtaPhi",
1734                                                         Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #eta acceptance, in trigger #eta-#phi ",r),
1735                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1736       fhFractionClusterOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1737       fhFractionClusterOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1738       fhFractionClusterOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1739       outputContainer->Add(fhFractionClusterOutConeEtaTrigEtaPhi) ;
1740       
1741       fhFractionClusterOutConePhi  = new TH2F("hFractionClusterOutConePhi",
1742                                               Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #phi acceptance",r),
1743                                               nptbins,ptmin,ptmax,100,0,1);
1744       fhFractionClusterOutConePhi->SetYTitle("#it{fraction}");
1745       fhFractionClusterOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1746       outputContainer->Add(fhFractionClusterOutConePhi) ;
1747       
1748       fhFractionClusterOutConePhiTrigEtaPhi  = new TH2F("hFractionClusterOutConePhiTrigEtaPhi",
1749                                                         Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #phi acceptance, in trigger #eta-#phi ",r),
1750                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1751       fhFractionClusterOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
1752       fhFractionClusterOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1753       fhFractionClusterOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1754       outputContainer->Add(fhFractionClusterOutConePhiTrigEtaPhi) ;
1755       
1756       fhConeSumPtSubvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCluster",
1757                                                         Form("#Sigma #it{p}_{T} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1758                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1759       fhConeSumPtSubvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1760       fhConeSumPtSubvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1761       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCluster);
1762       
1763       fhConeSumPtSubNormvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCluster",
1764                                                             Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1765                                                             nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1766       fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1767       fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1768       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCluster);
1769       
1770       fhConeSumPtSubvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCluster",
1771                                                         Form("#Sigma #it{p}_{T} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1772                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1773       fhConeSumPtSubvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1774       fhConeSumPtSubvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1775       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCluster);
1776       
1777       fhConeSumPtSubNormvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCluster",
1778                                                             Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1779                                                             nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1780       fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1781       fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1782       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCluster);
1783
1784       
1785       fhFractionCellOutConeEta  = new TH2F("hFractionCellOutConeEta",
1786                                            Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #eta acceptance",r),
1787                                            nptbins,ptmin,ptmax,100,0,1);
1788       fhFractionCellOutConeEta->SetYTitle("#it{fraction}");
1789       fhFractionCellOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1790       outputContainer->Add(fhFractionCellOutConeEta) ;
1791       
1792       fhFractionCellOutConeEtaTrigEtaPhi  = new TH2F("hFractionCellOutConeEtaTrigEtaPhi",
1793                                                      Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #eta acceptance, in trigger #eta-#phi ",r),
1794                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1795       fhFractionCellOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1796       fhFractionCellOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1797       fhFractionCellOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1798       outputContainer->Add(fhFractionCellOutConeEtaTrigEtaPhi) ;
1799       
1800       fhFractionCellOutConePhi  = new TH2F("hFractionCellOutConePhi",
1801                                            Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #phi acceptance",r),
1802                                            nptbins,ptmin,ptmax,100,0,1);
1803       fhFractionCellOutConePhi->SetYTitle("#it{fraction}");
1804       fhFractionCellOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1805       outputContainer->Add(fhFractionCellOutConePhi) ;
1806       
1807       fhFractionCellOutConePhiTrigEtaPhi  = new TH2F("hFractionCellOutConePhiTrigEtaPhi",
1808                                                      Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #phi acceptance, in trigger #eta-#phi ",r),
1809                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1810       fhFractionCellOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
1811       fhFractionCellOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1812       fhFractionCellOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1813       outputContainer->Add(fhFractionCellOutConePhiTrigEtaPhi) ;
1814       
1815       
1816       fhConeSumPtSubvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCell",
1817                                                      Form("#Sigma #it{p}_{T} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1818                                                      nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1819       fhConeSumPtSubvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1820       fhConeSumPtSubvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1821       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCell);
1822       
1823       fhConeSumPtSubNormvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCell",
1824                                                          Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1825                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1826       fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1827       fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1828       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCell);
1829       
1830       fhConeSumPtSubvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCell",
1831                                                      Form("#Sigma #it{p}_{T} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1832                                                      nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1833       fhConeSumPtSubvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1834       fhConeSumPtSubvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1835       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCell);
1836       
1837       fhConeSumPtSubNormvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCell",
1838                                                          Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1839                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1840       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1841       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1842       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCell);
1843
1844       fhConeSumPtVSUEClusterEtaBand  = new TH2F("hConeSumPtVSUEClusterEtaBand",
1845                                                          Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for cluster (before normalization), R=%2.2f",r),
1846                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
1847       fhConeSumPtVSUEClusterEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1848       fhConeSumPtVSUEClusterEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1849       outputContainer->Add(fhConeSumPtVSUEClusterEtaBand);
1850
1851       fhConeSumPtVSUEClusterPhiBand  = new TH2F("hConeSumPtVSUEClusterPhiBand",
1852                                                          Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for cluster (before normalization), R=%2.2f",r),
1853                                                          nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
1854       fhConeSumPtVSUEClusterPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1855       fhConeSumPtVSUEClusterPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1856       outputContainer->Add(fhConeSumPtVSUEClusterPhiBand);
1857       
1858     }
1859     
1860     // Track only histograms
1861     if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyNeutral)
1862     {
1863       fhConeSumPtTrack  = new TH2F("hConePtSumTrack",
1864                                    Form("Track #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1865                                    nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1866       fhConeSumPtTrack->SetYTitle("#Sigma #it{p}_{T}");
1867       fhConeSumPtTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1868       outputContainer->Add(fhConeSumPtTrack) ;
1869       
1870       
1871       fhConeSumPtEtaBandUETrack  = new TH2F("hConePtSumEtaBandUETrack",
1872                                             "#Sigma track #it{p}_{T} in UE Eta Band",
1873                                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1874       fhConeSumPtEtaBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
1875       fhConeSumPtEtaBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1876       outputContainer->Add(fhConeSumPtEtaBandUETrack) ;
1877       
1878       fhConeSumPtPhiBandUETrack  = new TH2F("hConePtSumPhiBandUETrack",
1879                                             "#Sigma track #it{p}_{T} in UE Phi Band",
1880                                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax*8);
1881       fhConeSumPtPhiBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
1882       fhConeSumPtPhiBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1883       outputContainer->Add(fhConeSumPtPhiBandUETrack) ;
1884       
1885       
1886       fhConeSumPtEtaBandUETrackTrigEtaPhi  = new TH2F("hConePtSumEtaBandUETrackTrigEtaPhi",
1887                                                       "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Eta Band",
1888                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1889       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1890       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1891       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1892       outputContainer->Add(fhConeSumPtEtaBandUETrackTrigEtaPhi) ;
1893       
1894       fhConeSumPtPhiBandUETrackTrigEtaPhi  = new TH2F("hConePtSumPhiBandUETrackTrigEtaPhi",
1895                                                       "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Phi Band",
1896                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1897       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1898       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1899       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1900       outputContainer->Add(fhConeSumPtPhiBandUETrackTrigEtaPhi) ;
1901       
1902       
1903       fhPtTrackInCone  = new TH2F("hPtTrackInCone",
1904                                   Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f",r),
1905                                   nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1906       fhPtTrackInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1907       fhPtTrackInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1908       outputContainer->Add(fhPtTrackInCone) ;
1909       
1910       
1911       fhEtaBandTrack  = new TH2F("hEtaBandTrack",
1912                                  Form("#eta vs #phi of tracks in #eta band isolation cone for #it{R} =  %2.2f",r),
1913                                  netabins,-1,1,nphibins,0,TMath::TwoPi());
1914       fhEtaBandTrack->SetXTitle("#eta");
1915       fhEtaBandTrack->SetYTitle("#phi");
1916       outputContainer->Add(fhEtaBandTrack) ;
1917       
1918       fhPhiBandTrack  = new TH2F("hPhiBandTrack",
1919                                  Form("#eta vs #phi of tracks in #phi band isolation cone for #it{R} =  %2.2f",r),
1920                                  netabins,-1,1,nphibins,0,TMath::TwoPi());
1921       fhPhiBandTrack->SetXTitle("#eta");
1922       fhPhiBandTrack->SetYTitle("#phi");
1923       outputContainer->Add(fhPhiBandTrack) ;
1924       
1925       
1926       fhConeSumPtEtaUESubTrack  = new TH2F("hConeSumPtEtaUESubTrack",
1927                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1928                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1929       fhConeSumPtEtaUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
1930       fhConeSumPtEtaUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1931       outputContainer->Add(fhConeSumPtEtaUESubTrack) ;
1932       
1933       fhConeSumPtPhiUESubTrack  = new TH2F("hConeSumPtPhiUESubTrack",
1934                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1935                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1936       fhConeSumPtPhiUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
1937       fhConeSumPtPhiUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1938       outputContainer->Add(fhConeSumPtPhiUESubTrack) ;
1939       
1940       fhConeSumPtEtaUESubTrackTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrackTrigEtaPhi",
1941                                                      Form("Trigger #eta vs #phi, Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1942                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1943       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1944       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1945       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1946       outputContainer->Add(fhConeSumPtEtaUESubTrackTrigEtaPhi) ;
1947       
1948       fhConeSumPtPhiUESubTrackTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrackTrigEtaPhi",
1949                                                      Form("Trigger #eta vs #phi, Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1950                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1951       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1952       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1953       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1954       outputContainer->Add(fhConeSumPtPhiUESubTrackTrigEtaPhi) ;
1955       
1956       fhFractionTrackOutConeEta  = new TH2F("hFractionTrackOutConeEta",
1957                                             Form("Fraction of the isolation cone #it{R} =  %2.2f, out of tracks #eta acceptance",r),
1958                                             nptbins,ptmin,ptmax,100,0,1);
1959       fhFractionTrackOutConeEta->SetYTitle("#it{fraction}");
1960       fhFractionTrackOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1961       outputContainer->Add(fhFractionTrackOutConeEta) ;
1962       
1963       fhFractionTrackOutConeEtaTrigEtaPhi  = new TH2F("hFractionTrackOutConeEtaTrigEtaPhi",
1964                                                       Form("Fraction of the isolation cone #it{R} =  %2.2f, out of tracks #eta acceptance, in trigger #eta-#phi ",r),
1965                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1966       fhFractionTrackOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1967       fhFractionTrackOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1968       fhFractionTrackOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1969       outputContainer->Add(fhFractionTrackOutConeEtaTrigEtaPhi) ;
1970       
1971       fhConeSumPtSubvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubvsConeSumPtTotPhiTrack",
1972                                                       Form("#Sigma #it{p}_{T} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1973                                                       nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1974       fhConeSumPtSubvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1975       fhConeSumPtSubvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1976       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiTrack);
1977       
1978       fhConeSumPtSubNormvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiTrack",
1979                                                           Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #phi band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1980                                                           nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1981       fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1982       fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1983       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiTrack);
1984       
1985       fhConeSumPtSubvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubvsConeSumPtTotEtaTrack",
1986                                                       Form("#Sigma #it{p}_{T} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1987                                                       nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1988       fhConeSumPtSubvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1989       fhConeSumPtSubvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1990       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaTrack);
1991       
1992       fhConeSumPtSubNormvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaTrack",
1993                                                           Form("#Sigma #it{p}_{T, norm} in cone after bkg sub from #eta band vs #Sigma #it{p}_{T} in cone before bkg sub, R=%2.2f",r),
1994                                                           nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1995       fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1996       fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1997       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaTrack);
1998       
1999       // UE in perpendicular cone
2000       fhPerpConeSumPt  = new TH2F("hPerpConePtSum",
2001                                   Form("#Sigma #it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} =  %2.2f",r),
2002                                   nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2003       fhPerpConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
2004       fhPerpConeSumPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2005       outputContainer->Add(fhPerpConeSumPt) ;
2006       
2007       fhPtInPerpCone  = new TH2F("hPtInPerpCone",
2008                                  Form("#it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} =  %2.2f",r),
2009                                  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2010       fhPtInPerpCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2011       fhPtInPerpCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2012       outputContainer->Add(fhPtInPerpCone) ;
2013
2014       fhEtaPhiTrack= new TH2F("hEtaPhiTrack",
2015                               Form("#eta vs #phi of all Tracks"),
2016                               netabins,-1,1,nphibins,0,TMath::TwoPi());
2017       fhEtaPhiTrack->SetXTitle("#eta");
2018       fhEtaPhiTrack->SetYTitle("#phi");
2019       outputContainer->Add(fhEtaPhiTrack) ;
2020       
2021       fhEtaPhiInConeTrack= new TH2F("hEtaPhiInConeTrack",
2022                                     Form("#eta vs #phi of Tracks in cone for #it{R} =  %2.2f",r),
2023                                     netabins,-1,1,nphibins,0,TMath::TwoPi());
2024       fhEtaPhiInConeTrack->SetXTitle("#eta");
2025       fhEtaPhiInConeTrack->SetYTitle("#phi");
2026       outputContainer->Add(fhEtaPhiInConeTrack) ;
2027       
2028       fhConeSumPtVSUETracksEtaBand  = new TH2F("hConeSumPtVSUETracksEtaBand",
2029                                                Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for tracks (before normalization), R=%2.2f",r),
2030                                                nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
2031       fhConeSumPtVSUETracksEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2032       fhConeSumPtVSUETracksEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2033       outputContainer->Add(fhConeSumPtVSUETracksEtaBand);
2034       
2035       fhConeSumPtVSUETracksPhiBand  = new TH2F("hConeSumPtVSUETracksPhiBand",
2036                                                Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for tracks (before normalization), R=%2.2f",r),
2037                                                nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
2038       fhConeSumPtVSUETracksPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2039       fhConeSumPtVSUETracksPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2040       outputContainer->Add(fhConeSumPtVSUETracksPhiBand); 
2041     }
2042     
2043     if(GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kNeutralAndCharged)
2044     {
2045       fhConeSumPtEtaUESub  = new TH2F("hConeSumPtEtaUESub",
2046                                       Form("#Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2047                                       nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2048       fhConeSumPtEtaUESub->SetYTitle("#Sigma #it{p}_{T}");
2049       fhConeSumPtEtaUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2050       outputContainer->Add(fhConeSumPtEtaUESub) ;
2051       
2052       fhConeSumPtPhiUESub  = new TH2F("hConeSumPtPhiUESub",
2053                                       Form("#Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2054                                       nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2055       fhConeSumPtPhiUESub->SetYTitle("#Sigma #it{p}_{T}");
2056       fhConeSumPtPhiUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2057       outputContainer->Add(fhConeSumPtPhiUESub) ;
2058       
2059       fhConeSumPtEtaUESubTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrigEtaPhi",
2060                                                 Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2061                                                 netabins,etamin,etamax,nphibins,phimin,phimax);
2062       fhConeSumPtEtaUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2063       fhConeSumPtEtaUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
2064       fhConeSumPtEtaUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2065       outputContainer->Add(fhConeSumPtEtaUESubTrigEtaPhi) ;
2066       
2067       fhConeSumPtPhiUESubTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrigEtaPhi",
2068                                                 Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2069                                                 netabins,etamin,etamax,nphibins,phimin,phimax);
2070       fhConeSumPtPhiUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2071       fhConeSumPtPhiUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
2072       fhConeSumPtPhiUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2073       outputContainer->Add(fhConeSumPtPhiUESubTrigEtaPhi) ;
2074       
2075       fhConeSumPtClustervsTrack   = new TH2F("hConePtSumClustervsTrack",
2076                                              Form("Track vs Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2077                                              nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2078       fhConeSumPtClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2079       fhConeSumPtClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2080       outputContainer->Add(fhConeSumPtClustervsTrack) ;
2081       
2082       fhConeSumPtEtaUESubClustervsTrack   = new TH2F("hConePtSumEtaUESubClustervsTrack",
2083                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2084                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2085       fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2086       fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2087       outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
2088       
2089       fhConeSumPtPhiUESubClustervsTrack   = new TH2F("hConePhiUESubPtSumClustervsTrack",
2090                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2091                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2092       fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2093       fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2094       outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
2095       
2096       fhEtaBandClustervsTrack   = new TH2F("hEtaBandClustervsTrack",
2097                                            Form("Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",r),
2098                                            nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2099       fhEtaBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2100       fhEtaBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2101       outputContainer->Add(fhEtaBandClustervsTrack) ;
2102       
2103       fhPhiBandClustervsTrack   = new TH2F("hPhiBandClustervsTrack",
2104                                            Form("Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",r),
2105                                            nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
2106       fhPhiBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2107       fhPhiBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2108       outputContainer->Add(fhPhiBandClustervsTrack) ;
2109       
2110       fhEtaBandNormClustervsTrack   = new TH2F("hEtaBandNormClustervsTrack",
2111                                                Form("Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",r),
2112                                                nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2113       fhEtaBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2114       fhEtaBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2115       outputContainer->Add(fhEtaBandNormClustervsTrack) ;
2116       
2117       fhPhiBandNormClustervsTrack   = new TH2F("hPhiBandNormClustervsTrack",
2118                                                Form("Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",r),
2119                                                nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2120       fhPhiBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2121       fhPhiBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2122       outputContainer->Add(fhPhiBandNormClustervsTrack) ;
2123       
2124             
2125       fhConeSumPtCellTrack = new TH2F("hConePtSumCellTrack",
2126                                       Form("Track and Cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2127                                       nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2128       fhConeSumPtCellTrack->SetYTitle("#Sigma #it{p}_{T}");
2129       fhConeSumPtCellTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2130       outputContainer->Add(fhConeSumPtCellTrack) ;
2131
2132       fhConeSumPtCellTrackTrigEtaPhi  = new TH2F("hConePtSumCellTrackTrigEtaPhi",
2133                                                  Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2134                                                  netabins,etamin,etamax,nphibins,phimin,phimax);
2135       fhConeSumPtCellTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2136       fhConeSumPtCellTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2137       fhConeSumPtCellTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2138       outputContainer->Add(fhConeSumPtCellTrackTrigEtaPhi) ;
2139
2140       
2141       fhConeSumPtEtaUESubClustervsTrack   = new TH2F("hConePtSumEtaUESubClustervsTrack",
2142                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2143                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2144       fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2145       fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2146       outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
2147       
2148       fhConeSumPtPhiUESubClustervsTrack   = new TH2F("hConePhiUESubPtSumClustervsTrack",
2149                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2150                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2151       fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2152       fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2153       outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
2154       
2155       fhConeSumPtCellvsTrack   = new TH2F("hConePtSumCellvsTrack",
2156                                              Form("Track vs cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2157                                              nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2158       fhConeSumPtCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2159       fhConeSumPtCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2160       outputContainer->Add(fhConeSumPtCellvsTrack) ;
2161       
2162       fhConeSumPtEtaUESubCellvsTrack   = new TH2F("hConePtSumEtaUESubCellvsTrack",
2163                                                   Form("Track vs Cell #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2164                                                   2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2165       fhConeSumPtEtaUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2166       fhConeSumPtEtaUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2167       outputContainer->Add(fhConeSumPtEtaUESubCellvsTrack) ;
2168       
2169       fhConeSumPtPhiUESubCellvsTrack   = new TH2F("hConePhiUESubPtSumCellvsTrack",
2170                                                   Form("Track vs Cell #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2171                                                   2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2172       fhConeSumPtPhiUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2173       fhConeSumPtPhiUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2174       outputContainer->Add(fhConeSumPtPhiUESubCellvsTrack) ;
2175       
2176       fhEtaBandCellvsTrack   = new TH2F("hEtaBandCellvsTrack",
2177                                         Form("Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",r),
2178                                         nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2179       fhEtaBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2180       fhEtaBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2181       outputContainer->Add(fhEtaBandCellvsTrack) ;
2182       
2183       fhPhiBandCellvsTrack   = new TH2F("hPhiBandCellvsTrack",
2184                                         Form("Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",r),
2185                                         nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
2186       fhPhiBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2187       fhPhiBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2188       outputContainer->Add(fhPhiBandCellvsTrack) ;
2189
2190       fhEtaBandNormCellvsTrack   = new TH2F("hEtaBandNormCellvsTrack",
2191                                             Form("Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",r),
2192                                             nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2193       fhEtaBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2194       fhEtaBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2195       outputContainer->Add(fhEtaBandNormCellvsTrack) ;
2196       
2197       fhPhiBandNormCellvsTrack   = new TH2F("hPhiBandNormCellvsTrack",
2198                                             Form("Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",r),
2199                                             nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2200       fhPhiBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2201       fhPhiBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2202       outputContainer->Add(fhPhiBandNormCellvsTrack) ;
2203       
2204       fhConeSumPtEtaUESubTrackCell  = new TH2F("hConeSumPtEtaUESubTrackCell",
2205                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2206                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2207       fhConeSumPtEtaUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
2208       fhConeSumPtEtaUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2209       outputContainer->Add(fhConeSumPtEtaUESubTrackCell) ;
2210       
2211       fhConeSumPtPhiUESubTrackCell  = new TH2F("hConeSumPtPhiUESubTrackCell",
2212                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2213                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2214       fhConeSumPtPhiUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
2215       fhConeSumPtPhiUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2216       outputContainer->Add(fhConeSumPtPhiUESubTrackCell) ;
2217       
2218       fhConeSumPtEtaUESubTrackCellTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrackCellTrigEtaPhi",
2219                                                      Form("Trigger #eta vs #phi, Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2220                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
2221       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2222       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2223       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2224       outputContainer->Add(fhConeSumPtEtaUESubTrackCellTrigEtaPhi) ;
2225       
2226       fhConeSumPtPhiUESubTrackCellTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrackCellTrigEtaPhi",
2227                                                      Form("Trigger #eta vs #phi, Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2228                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
2229       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2230       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2231       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2232       outputContainer->Add(fhConeSumPtPhiUESubTrackCellTrigEtaPhi) ;
2233       
2234     }
2235             
2236     for(Int_t iso = 0; iso < 2; iso++)
2237     {
2238       if(fFillTMHisto)
2239       {
2240         fhTrackMatchedDEta[iso]  = new TH2F
2241         (Form("hTrackMatchedDEta%s",isoName[iso].Data()),
2242          Form("%s - d#eta of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
2243          nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2244         fhTrackMatchedDEta[iso]->SetYTitle("d#eta");
2245         fhTrackMatchedDEta[iso]->SetXTitle("E_{cluster} (GeV)");
2246         
2247         fhTrackMatchedDPhi[iso]  = new TH2F
2248         (Form("hTrackMatchedDPhi%s",isoName[iso].Data()),
2249          Form("%s - d#phi of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
2250          nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2251         fhTrackMatchedDPhi[iso]->SetYTitle("d#phi (rad)");
2252         fhTrackMatchedDPhi[iso]->SetXTitle("E_{cluster} (GeV)");
2253         
2254         fhTrackMatchedDEtaDPhi[iso]  = new TH2F
2255         (Form("hTrackMatchedDEtaDPhi%s",isoName[iso].Data()),
2256          Form("%s - d#eta vs d#phi of cluster-track, %s",isoTitle[iso].Data(),parTitle.Data()),
2257          nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2258         fhTrackMatchedDEtaDPhi[iso]->SetYTitle("d#phi (rad)");
2259         fhTrackMatchedDEtaDPhi[iso]->SetXTitle("d#eta");
2260         
2261         outputContainer->Add(fhTrackMatchedDEta[iso]) ;
2262         outputContainer->Add(fhTrackMatchedDPhi[iso]) ;
2263         outputContainer->Add(fhTrackMatchedDEtaDPhi[iso]) ;
2264         
2265         fhdEdx[iso]  = new TH2F
2266         (Form("hdEdx%s",isoName[iso].Data()),
2267          Form("%s - Matched track <d#it{E}/d#it{x}> vs cluster #it{E}, %s",isoTitle[iso].Data(),parTitle.Data()),
2268          nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2269         fhdEdx[iso]->SetXTitle("#it{E} (GeV)");
2270         fhdEdx[iso]->SetYTitle("<d#it{E}/d#it{x}>");
2271         outputContainer->Add(fhdEdx[iso]);
2272         
2273         fhEOverP[iso]  = new TH2F
2274         (Form("hEOverP%s",isoName[iso].Data()),
2275          Form("%s - Matched track #it{E}/#it{p} vs cluster, %s",isoTitle[iso].Data(),parTitle.Data()),
2276          nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2277         fhEOverP[iso]->SetXTitle("#it{E} (GeV)");
2278         fhEOverP[iso]->SetYTitle("#it{E}/#it{p}");
2279         outputContainer->Add(fhEOverP[iso]);
2280         
2281         if(IsDataMC())
2282         {
2283           fhTrackMatchedMCParticle[iso]  = new TH2F
2284           (Form("hTrackMatchedMCParticle%s",isoName[iso].Data()),
2285            Form("%s - Origin of particle vs cluster #it{E}, %s",isoTitle[iso].Data(),parTitle.Data()),
2286            nptbins,ptmin,ptmax,8,0,8);
2287           fhTrackMatchedMCParticle[iso]->SetXTitle("#it{E} (GeV)");
2288           //fhTrackMatchedMCParticle[iso]->SetYTitle("Particle type");
2289           
2290           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(1 ,"Photon");
2291           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(2 ,"Electron");
2292           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
2293           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(4 ,"Rest");
2294           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
2295           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
2296           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
2297           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
2298           
2299           outputContainer->Add(fhTrackMatchedMCParticle[iso]);
2300         }
2301       }
2302       
2303       if(fFillSSHisto)
2304       {
2305         fhELambda0[iso]  = new TH2F
2306         (Form("hELambda0%s",isoName[iso].Data()),
2307          Form("%s cluster : #it{E} vs #lambda_{0}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2308         fhELambda0[iso]->SetYTitle("#lambda_{0}^{2}");
2309         fhELambda0[iso]->SetXTitle("#it{E} (GeV)");
2310         outputContainer->Add(fhELambda0[iso]) ;
2311
2312         fhPtLambda0[iso]  = new TH2F
2313         (Form("hPtLambda0%s",isoName[iso].Data()),
2314          Form("%s cluster : #it{p}_{T} vs #lambda_{0}, %s",isoTitle[iso].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2315         fhPtLambda0[iso]->SetYTitle("#lambda_{0}^{2}");
2316         fhPtLambda0[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2317         outputContainer->Add(fhPtLambda0[iso]) ;
2318         
2319         if(IsDataMC())
2320         {
2321           fhPtLambda0MCPhotonPrompt[iso]  = new TH2F
2322           (Form("hPtLambda0%s_MCPhotonPrompt",isoName[iso].Data()),
2323            Form("%s cluster : #it{p}_{T} vs #lambda_{0}: #gamma_{prompt}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2324           fhPtLambda0MCPhotonPrompt[iso]->SetYTitle("#lambda_{0}^{2}");
2325           fhPtLambda0MCPhotonPrompt[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2326           outputContainer->Add(fhPtLambda0MCPhotonPrompt[iso]) ; 
2327
2328           fhPtLambda0MCPhotonFrag[iso]  = new TH2F
2329           (Form("hPtLambda0%s_MCPhotonFrag",isoName[iso].Data()),
2330            Form("%s cluster : #it{p}_{T} vs #lambda_{0}: #gamma_{fragment}, %s",isoTitle[iso].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2331           fhPtLambda0MCPhotonFrag[iso]->SetYTitle("#lambda_{0}^{2}");
2332           fhPtLambda0MCPhotonFrag[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2333           outputContainer->Add(fhPtLambda0MCPhotonFrag[iso]) ; 
2334
2335
2336           fhELambda0MCPhoton[iso]  = new TH2F
2337           (Form("hELambda0%s_MCPhoton",isoName[iso].Data()),
2338            Form("%s cluster : #it{E} vs #lambda_{0}: #gamma_{final state}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2339           fhELambda0MCPhoton[iso]->SetYTitle("#lambda_{0}^{2}");
2340           fhELambda0MCPhoton[iso]->SetXTitle("#it{E} (GeV)");
2341           outputContainer->Add(fhELambda0MCPhoton[iso]) ;
2342           
2343           fhELambda0MCPi0[iso]  = new TH2F
2344           (Form("hELambda0%s_MCPi0",isoName[iso].Data()),
2345            Form("%s cluster : #it{E} vs #lambda_{0}: Merged #pi^{0}_{2 #gamma}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2346           fhELambda0MCPi0[iso]->SetYTitle("#lambda_{0}^{2}");
2347           fhELambda0MCPi0[iso]->SetXTitle("#it{E} (GeV)");
2348           outputContainer->Add(fhELambda0MCPi0[iso]) ;
2349           
2350           fhELambda0MCPi0Decay[iso]  = new TH2F
2351           (Form("hELambda0%s_MCPi0Decay",isoName[iso].Data()),
2352            Form("%s cluster : #it{E} vs #lambda_{0}: #pi^{0}_{1 #gamma}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2353           fhELambda0MCPi0Decay[iso]->SetYTitle("#lambda_{0}^{2}");
2354           fhELambda0MCPi0Decay[iso]->SetXTitle("#it{E} (GeV)");
2355           outputContainer->Add(fhELambda0MCPi0Decay[iso]) ;
2356           
2357           fhELambda0MCEtaDecay[iso]  = new TH2F
2358           (Form("hELambda0%s_MCEtaDecay",isoName[iso].Data()),
2359            Form("%s cluster : #it{E} vs #lambda_{0}: #eta_{1 #gamma}, %s",isoTitle[iso].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2360           fhELambda0MCEtaDecay[iso]->SetYTitle("#lambda_{0}^{2}");
2361           fhELambda0MCEtaDecay[iso]->SetXTitle("#it{E} (GeV)");
2362           outputContainer->Add(fhELambda0MCEtaDecay[iso]) ;
2363           
2364           fhELambda0MCOtherDecay[iso]  = new TH2F
2365           (Form("hELambda0%s_MCOtherDecay",isoName[iso].Data()),
2366            Form("%s cluster : #it{E} vs #lambda_{0}: #gamma_{other decay}, %s",isoTitle[iso].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2367           fhELambda0MCOtherDecay[iso]->SetYTitle("#lambda_{0}^{2}");
2368           fhELambda0MCOtherDecay[iso]->SetXTitle("#it{E} (GeV)");
2369           outputContainer->Add(fhELambda0MCOtherDecay[iso]) ;
2370           
2371           fhELambda0MCHadron[iso]  = new TH2F
2372           (Form("hELambda0%s_MCHadron",isoName[iso].Data()),
2373            Form("%s cluster : #it{E} vs #lambda_{0}: hadron, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2374           fhELambda0MCHadron[iso]->SetYTitle("#lambda_{0}^{2}");
2375           fhELambda0MCHadron[iso]->SetXTitle("#it{E} (GeV)");
2376           outputContainer->Add(fhELambda0MCHadron[iso]) ;
2377         }
2378         
2379         fhELambda1[iso]  = new TH2F
2380         (Form("hELambda1%s",isoName[iso].Data()),
2381          Form("%s cluster: #it{E} vs #lambda_{1}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2382         fhELambda1[iso]->SetYTitle("#lambda_{1}^{2}");
2383         fhELambda1[iso]->SetXTitle("#it{E} (GeV)");
2384         outputContainer->Add(fhELambda1[iso]) ;
2385         
2386         if(fCalorimeter=="EMCAL")
2387         {
2388           fhPtLambda0TRD[iso]  = new TH2F
2389           (Form("hPtLambda0TRD%s",isoName[iso].Data()),
2390            Form("%s cluster: #it{p}_{T} vs #lambda_{0}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2391           fhPtLambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
2392           fhPtLambda0TRD[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2393           outputContainer->Add(fhPtLambda0TRD[iso]) ;
2394
2395           fhELambda0TRD[iso]  = new TH2F
2396           (Form("hELambda0TRD%s",isoName[iso].Data()),
2397            Form("%s cluster: #it{E} vs #lambda_{0}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2398           fhELambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
2399           fhELambda0TRD[iso]->SetXTitle("#it{E} (GeV)");
2400           outputContainer->Add(fhELambda0TRD[iso]) ;
2401           
2402           fhELambda1TRD[iso]  = new TH2F
2403           (Form("hELambda1TRD%s",isoName[iso].Data()),
2404            Form("%s cluster: #it{E} vs #lambda_{1}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2405           fhELambda1TRD[iso]->SetYTitle("#lambda_{1}^{2}");
2406           fhELambda1TRD[iso]->SetXTitle("#it{E} (GeV)");
2407           outputContainer->Add(fhELambda1TRD[iso]) ;
2408         }
2409         
2410         fhNLocMax[iso] = new TH2F
2411         (Form("hNLocMax%s",isoName[iso].Data()),
2412          Form("%s - Number of local maxima in cluster, %s",isoTitle[iso].Data(),parTitle.Data()),
2413          nptbins,ptmin,ptmax,10,0,10);
2414         fhNLocMax[iso]->SetYTitle("#it{NLM}");
2415         fhNLocMax[iso]->SetXTitle("#it{E} (GeV)");
2416         outputContainer->Add(fhNLocMax[iso]) ;
2417         
2418         fhELambda0LocMax1[iso]  = new TH2F
2419         (Form("hELambda0LocMax1%s",isoName[iso].Data()),
2420          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}=1, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2421         fhELambda0LocMax1[iso]->SetYTitle("#lambda_{0}^{2}");
2422         fhELambda0LocMax1[iso]->SetXTitle("#it{E} (GeV)");
2423         outputContainer->Add(fhELambda0LocMax1[iso]) ;
2424         
2425         fhELambda1LocMax1[iso]  = new TH2F
2426         (Form("hELambda1LocMax1%s",isoName[iso].Data()),
2427          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}=1, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2428         fhELambda1LocMax1[iso]->SetYTitle("#lambda_{1}^{2}");
2429         fhELambda1LocMax1[iso]->SetXTitle("#it{E} (GeV)");
2430         outputContainer->Add(fhELambda1LocMax1[iso]) ;
2431         
2432         fhELambda0LocMax2[iso]  = new TH2F
2433         (Form("hELambda0LocMax2%s",isoName[iso].Data()),
2434          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}=2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2435         fhELambda0LocMax2[iso]->SetYTitle("#lambda_{0}^{2}");
2436         fhELambda0LocMax2[iso]->SetXTitle("#it{E} (GeV)");
2437         outputContainer->Add(fhELambda0LocMax2[iso]) ;
2438         
2439         fhELambda1LocMax2[iso]  = new TH2F
2440         (Form("hELambda1LocMax2%s",isoName[iso].Data()),
2441          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}=2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2442         fhELambda1LocMax2[iso]->SetYTitle("#lambda_{1}^{2}");
2443         fhELambda1LocMax2[iso]->SetXTitle("#it{E} (GeV)");
2444         outputContainer->Add(fhELambda1LocMax2[iso]) ;
2445         
2446         fhELambda0LocMaxN[iso]  = new TH2F
2447         ( Form("hELambda0LocMaxN%s",isoName[iso].Data()),
2448          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}>2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2449         fhELambda0LocMaxN[iso]->SetYTitle("#lambda_{0}^{2}");
2450         fhELambda0LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
2451         outputContainer->Add(fhELambda0LocMaxN[iso]) ;
2452         
2453         fhELambda1LocMaxN[iso]  = new TH2F
2454         (Form("hELambda1LocMaxN%s",isoName[iso].Data()),
2455          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}>2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2456         fhELambda1LocMaxN[iso]->SetYTitle("#lambda_{1}^{2}");
2457         fhELambda1LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
2458         outputContainer->Add(fhELambda1LocMaxN[iso]) ;
2459       }
2460     } // control histograms for isolated and non isolated objects
2461     
2462     
2463     if(fFillPileUpHistograms)
2464     {
2465       fhPtTrackInConeOtherBC  = new TH2F("hPtTrackInConeOtherBC",
2466                                          Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC!=0",r),
2467                                          nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2468       fhPtTrackInConeOtherBC->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2469       fhPtTrackInConeOtherBC->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2470       outputContainer->Add(fhPtTrackInConeOtherBC) ;
2471       
2472       fhPtTrackInConeOtherBCPileUpSPD  = new TH2F("hPtTrackInConeOtherBCPileUpSPD",
2473                                                   Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC!=0, pile-up from SPD",r),
2474                                                   nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2475       fhPtTrackInConeOtherBCPileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2476       fhPtTrackInConeOtherBCPileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2477       outputContainer->Add(fhPtTrackInConeOtherBCPileUpSPD) ;
2478       
2479       fhPtTrackInConeBC0  = new TH2F("hPtTrackInConeBC0",
2480                                      Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0",r),
2481                                      nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2482       fhPtTrackInConeBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2483       fhPtTrackInConeBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2484       outputContainer->Add(fhPtTrackInConeBC0) ;
2485       
2486       fhPtTrackInConeVtxBC0  = new TH2F("hPtTrackInConeVtxBC0",
2487                                         Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0",r),
2488                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2489       fhPtTrackInConeVtxBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2490       fhPtTrackInConeVtxBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2491       outputContainer->Add(fhPtTrackInConeVtxBC0) ;
2492       
2493       
2494       fhPtTrackInConeBC0PileUpSPD  = new TH2F("hPtTrackInConeBC0PileUpSPD",
2495                                               Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0, pile-up from SPD",r),
2496                                               nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2497       fhPtTrackInConeBC0PileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2498       fhPtTrackInConeBC0PileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2499       outputContainer->Add(fhPtTrackInConeBC0PileUpSPD) ;
2500       
2501       
2502       for (Int_t i = 0; i < 7 ; i++)
2503       {
2504         fhPtInConePileUp[i]  = new TH2F(Form("hPtInConePileUp%s",pileUpName[i].Data()),
2505                                         Form("#it{p}_{T} in isolation cone for #it{R} =  %2.2f, from pile-up (%s)",r,pileUpName[i].Data()),
2506                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2507         fhPtInConePileUp[i]->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2508         fhPtInConePileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2509         outputContainer->Add(fhPtInConePileUp[i]) ;
2510       }
2511     }
2512     
2513     if(IsDataMC())
2514     {
2515       fhPtIsoPrompt  = new TH1F
2516       ("hPtMCPrompt",Form("Number of isolated #gamma_{prompt}, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2517       fhPtIsoPrompt->SetYTitle("#it{counts}");
2518       fhPtIsoPrompt->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2519       outputContainer->Add(fhPtIsoPrompt) ; 
2520       
2521       fhPhiIsoPrompt  = new TH2F
2522       ("hPhiMCPrompt",Form("Number of isolated #gamma_{prompt}, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2523       fhPhiIsoPrompt->SetYTitle("#phi");
2524       fhPhiIsoPrompt->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2525       outputContainer->Add(fhPhiIsoPrompt) ; 
2526       
2527       fhEtaIsoPrompt  = new TH2F
2528       ("hEtaMCPrompt",Form("Number of isolated #gamma_{prompt}, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2529       fhEtaIsoPrompt->SetYTitle("#eta");
2530       fhEtaIsoPrompt->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2531       outputContainer->Add(fhEtaIsoPrompt) ;
2532       
2533       fhPtIsoFragmentation  = new TH1F
2534       ("hPtMCFragmentation",Form("Number of isolated #gamma_{fragment}, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2535       fhPtIsoFragmentation->SetYTitle("#it{counts}");
2536       fhPtIsoFragmentation->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2537       outputContainer->Add(fhPtIsoFragmentation) ; 
2538       
2539       fhPhiIsoFragmentation  = new TH2F
2540       ("hPhiMCFragmentation",Form("Number of isolated #gamma_{fragment}, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2541       fhPhiIsoFragmentation->SetYTitle("#phi");
2542       fhPhiIsoFragmentation->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2543       outputContainer->Add(fhPhiIsoFragmentation) ; 
2544       
2545       fhEtaIsoFragmentation  = new TH2F
2546       ("hEtaMCFragmentation",Form("Number of isolated #gamma_{fragment}, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2547       fhEtaIsoFragmentation->SetYTitle("#eta");
2548       fhEtaIsoFragmentation->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2549       outputContainer->Add(fhEtaIsoFragmentation) ;
2550       
2551       fhPtIsoPi0  = new TH1F
2552       ("hPtMCPi0",Form("Number of isolated #gamma from #pi^{0} (2 #gamma), %s",parTitle.Data()),nptbins,ptmin,ptmax);
2553       fhPtIsoPi0->SetYTitle("#it{counts}");
2554       fhPtIsoPi0->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2555       outputContainer->Add(fhPtIsoPi0) ; 
2556       
2557       fhPhiIsoPi0  = new TH2F
2558       ("hPhiMCPi0",Form("Number of isolated #gamma from #pi^{0} (2 #gamma), %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2559       fhPhiIsoPi0->SetYTitle("#phi");
2560       fhPhiIsoPi0->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2561       outputContainer->Add(fhPhiIsoPi0) ; 
2562       
2563       fhEtaIsoPi0  = new TH2F
2564       ("hEtaMCPi0",Form("Number of isolated #gamma from #pi^{0} (2 #gamma), %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2565       fhEtaIsoPi0->SetYTitle("#eta");
2566       fhEtaIsoPi0->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2567       outputContainer->Add(fhEtaIsoPi0) ;
2568       
2569       fhPtIsoPi0Decay  = new TH1F
2570       ("hPtMCPi0Decay",Form("Number of isolated #gamma from #pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2571       fhPtIsoPi0Decay->SetYTitle("#it{counts}");
2572       fhPtIsoPi0Decay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2573       outputContainer->Add(fhPtIsoPi0Decay) ; 
2574       
2575       fhPhiIsoPi0Decay  = new TH2F
2576       ("hPhiMCPi0Decay",Form("Number of isolated #gamma from #pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2577       fhPhiIsoPi0Decay->SetYTitle("#phi");
2578       fhPhiIsoPi0Decay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2579       outputContainer->Add(fhPhiIsoPi0Decay) ; 
2580       
2581       fhEtaIsoPi0Decay  = new TH2F
2582       ("hEtaMCPi0Decay",Form("Number of isolated #gamma from #pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2583       fhEtaIsoPi0Decay->SetYTitle("#eta");
2584       fhEtaIsoPi0Decay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2585       outputContainer->Add(fhEtaIsoPi0Decay) ;
2586       
2587       fhPtIsoEtaDecay  = new TH1F
2588       ("hPtMCEtaDecay",Form("Number of isolated #gamma from #eta decay, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2589       fhPtIsoEtaDecay->SetYTitle("#it{counts}");
2590       fhPtIsoEtaDecay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2591       outputContainer->Add(fhPtIsoEtaDecay) ; 
2592       
2593       fhPhiIsoEtaDecay  = new TH2F
2594       ("hPhiMCEtaDecay",Form("Number of isolated #gamma from #eta decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2595       fhPhiIsoEtaDecay->SetYTitle("#phi");
2596       fhPhiIsoEtaDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2597       outputContainer->Add(fhPhiIsoEtaDecay) ; 
2598       
2599       fhEtaIsoEtaDecay  = new TH2F
2600       ("hEtaMCEtaDecay",Form("Number of isolated #gamma from #eta decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2601       fhEtaIsoEtaDecay->SetYTitle("#eta");
2602       fhEtaIsoEtaDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2603       outputContainer->Add(fhEtaIsoEtaDecay) ;
2604       
2605       fhPtIsoOtherDecay  = new TH1F
2606       ("hPtMCOtherDecay",Form("Number of isolated #gamma from non-#pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2607       fhPtIsoOtherDecay->SetYTitle("#it{counts}");
2608       fhPtIsoOtherDecay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2609       outputContainer->Add(fhPtIsoOtherDecay) ; 
2610       
2611       fhPhiIsoOtherDecay  = new TH2F
2612       ("hPhiMCOtherDecay",Form("Number of isolated #gamma from non-#pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2613       fhPhiIsoOtherDecay->SetYTitle("#phi");
2614       fhPhiIsoOtherDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2615       outputContainer->Add(fhPhiIsoOtherDecay) ; 
2616       
2617       fhEtaIsoOtherDecay  = new TH2F
2618       ("hEtaMCOtherDecay",Form("Number of isolated #gamma non-#pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2619       fhEtaIsoOtherDecay->SetYTitle("#eta");
2620       fhEtaIsoOtherDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2621       outputContainer->Add(fhEtaIsoOtherDecay) ;
2622       
2623       //      fhPtIsoConversion  = new TH1F("hPtMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax); 
2624       //      fhPtIsoConversion->SetYTitle("#it{counts}");
2625       //      fhPtIsoConversion->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2626       //      outputContainer->Add(fhPtIsoConversion) ; 
2627       //      
2628       //      fhPhiIsoConversion  = new TH2F
2629       //      ("hPhiMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2630       //      fhPhiIsoConversion->SetYTitle("#phi");
2631       //      fhPhiIsoConversion->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2632       //      outputContainer->Add(fhPhiIsoConversion) ; 
2633       //      
2634       //      fhEtaIsoConversion  = new TH2F
2635       //      ("hEtaMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2636       //      fhEtaIsoConversion->SetYTitle("#eta");
2637       //      fhEtaIsoConversion->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2638       //      outputContainer->Add(fhEtaIsoConversion) ;
2639       
2640       fhPtIsoHadron  = new TH1F
2641       ("hPtMCHadron",Form("Number of isolated non-#gamma particles, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2642       fhPtIsoHadron->SetYTitle("#it{counts}");
2643       fhPtIsoHadron->SetXTitle("#it{p}_{T}(GeV/#it{c})");
2644       outputContainer->Add(fhPtIsoHadron) ; 
2645       
2646       
2647       fhPhiIsoHadron  = new TH2F
2648       ("hPhiMCHadron",Form("Number of isolated non-#gamma particles, %s",parTitle.Data()),nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2649       fhPhiIsoHadron->SetYTitle("#phi");
2650       fhPhiIsoHadron->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2651       outputContainer->Add(fhPhiIsoHadron) ; 
2652       
2653       fhEtaIsoHadron  = new TH2F
2654       ("hEtaMCHadron",Form("Number of isolated non-#gamma particles, %s",parTitle.Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
2655       fhEtaIsoHadron->SetYTitle("#eta");
2656       fhEtaIsoHadron->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2657       outputContainer->Add(fhEtaIsoHadron) ;
2658
2659       
2660       TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
2661         "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
2662       
2663       TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
2664         "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
2665       
2666       for(Int_t i = 0; i < 7; i++)
2667       {
2668         fhEPrimMC[i]  = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
2669                                  Form("primary photon  %s : #it{E}, %s",pptype[i].Data(),parTitle.Data()),
2670                                  nptbins,ptmin,ptmax);
2671         fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
2672         outputContainer->Add(fhEPrimMC[i]) ;
2673         
2674         fhPtPrimMCiso[i]  = new TH1F(Form("hPtPrim_MCiso%s",ppname[i].Data()),
2675                                      Form("primary isolated photon %s : #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
2676                                      nptbins,ptmin,ptmax);
2677         fhPtPrimMCiso[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2678         outputContainer->Add(fhPtPrimMCiso[i]) ;
2679         
2680         fhEtaPrimMC[i]  = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
2681                                    Form("primary photon %s : #eta vs #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
2682                                    nptbins,ptmin,ptmax,200,-2,2);
2683         fhEtaPrimMC[i]->SetYTitle("#eta");
2684         fhEtaPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2685         outputContainer->Add(fhEtaPrimMC[i]) ;
2686         
2687         fhPhiPrimMC[i]  = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
2688                                    Form("primary photon %s : #phi vs #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
2689                                    nptbins,ptmin,ptmax,200,0.,TMath::TwoPi());
2690         fhPhiPrimMC[i]->SetYTitle("#phi");
2691         fhPhiPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2692         outputContainer->Add(fhPhiPrimMC[i]) ;
2693       }
2694       
2695     }//Histos with MC
2696     
2697   }
2698   
2699   // Not Isolated histograms, reference histograms
2700   
2701   fhENoIso  = new TH1F("hENoIso",
2702                         Form("Number of not isolated leading particles vs #it{p}_{T}, %s",parTitle.Data()),
2703                         nptbins,ptmin,ptmax); 
2704   fhENoIso->SetYTitle("#it{counts}");
2705   fhENoIso->SetXTitle("E (GeV/#it{c})");
2706   outputContainer->Add(fhENoIso) ;
2707   
2708   fhPtNoIso  = new TH1F("hPtNoIso",
2709                         Form("Number of not isolated leading particles vs #it{p}_{T}, %s",parTitle.Data()),
2710                         nptbins,ptmin,ptmax); 
2711   fhPtNoIso->SetYTitle("#it{counts}");
2712   fhPtNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2713   outputContainer->Add(fhPtNoIso) ;
2714   
2715   fhPtNLocMaxNoIso  = new TH2F("hPtNLocMaxNoIso",
2716                                Form("Number of not isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
2717                                nptbins,ptmin,ptmax,10,0,10); 
2718   fhPtNLocMaxNoIso->SetYTitle("#it{NLM}");
2719   fhPtNLocMaxNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2720   outputContainer->Add(fhPtNLocMaxNoIso) ;   
2721   
2722   fhEtaPhiNoIso  = new TH2F("hEtaPhiNoIso",
2723                             Form("Number of not isolated leading particles #eta vs #phi, %s",parTitle.Data()),
2724                             netabins,etamin,etamax,nphibins,phimin,phimax); 
2725   fhEtaPhiNoIso->SetXTitle("#eta");
2726   fhEtaPhiNoIso->SetYTitle("#phi");
2727   outputContainer->Add(fhEtaPhiNoIso) ;    
2728   
2729   fhPtDecayNoIso  = new TH1F("hPtDecayNoIso",
2730                              Form("Number of not isolated leading pi0 decay particles vs #it{p}_{T}, %s",parTitle.Data()),
2731                              nptbins,ptmin,ptmax); 
2732   fhPtDecayNoIso->SetYTitle("#it{counts}");
2733   fhPtDecayNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2734   outputContainer->Add(fhPtDecayNoIso) ;
2735   
2736   fhEtaPhiDecayNoIso  = new TH2F("hEtaPhiDecayNoIso",
2737                                  Form("Number of not isolated leading Pi0 decay particles #eta vs #phi, %s",parTitle.Data()),
2738                                  netabins,etamin,etamax,nphibins,phimin,phimax); 
2739   fhEtaPhiDecayNoIso->SetXTitle("#eta");
2740   fhEtaPhiDecayNoIso->SetYTitle("#phi");
2741   outputContainer->Add(fhEtaPhiDecayNoIso) ;
2742   
2743  
2744   if(IsDataMC())
2745   {
2746     fhPtNoIsoPi0  = new TH1F
2747     ("hPtNoIsoPi0",Form("Number of not isolated leading #gamma from #pi^{0} (2 #gamma), %s",parTitle.Data()),nptbins,ptmin,ptmax);
2748     fhPtNoIsoPi0->SetYTitle("#it{counts}");
2749     fhPtNoIsoPi0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2750     outputContainer->Add(fhPtNoIsoPi0) ;
2751     
2752     fhPtNoIsoPi0Decay  = new TH1F
2753     ("hPtNoIsoPi0Decay",Form("Number of not isolated leading #gamma from #pi^{0} decay, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2754     fhPtNoIsoPi0Decay->SetYTitle("#it{counts}");
2755     fhPtNoIsoPi0Decay->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2756     outputContainer->Add(fhPtNoIsoPi0Decay) ;
2757     
2758     fhPtNoIsoEtaDecay  = new TH1F
2759     ("hPtNoIsoEtaDecay",Form("Number of not isolated leading #gamma from eta decay, %s",parTitle.Data()),nptbins,ptmin,ptmax);
2760     fhPtNoIsoEtaDecay->SetYTitle("#it{co