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