0068e5a1ca2f6739a8a41f2ecc5f1e109b9439b0
[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 ptfrac = GetIsolationCut()->GetPtFraction();
1434   Float_t r      = GetIsolationCut()->GetConeSize();
1435   
1436   TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1437   
1438   if(!fMakeSeveralIC)
1439   {
1440     TString hName [] = {"NoIso",""};
1441     TString hTitle[] = {"Not isolated"  ,"isolated"};
1442     
1443     fhEIso   = new TH1F("hE",
1444                         Form("Number of isolated particles vs E for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1445                         nptbins,ptmin,ptmax);
1446     fhEIso->SetYTitle("d$it{N} / d#it{E}");
1447     fhEIso->SetXTitle("#it{E} (GeV/#it{c})");
1448     outputContainer->Add(fhEIso) ;
1449     
1450     fhPtIso  = new TH1F("hPt",
1451                         Form("Number of isolated particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1452                         nptbins,ptmin,ptmax);
1453     fhPtIso->SetYTitle("d#it{N} / #it{p}_{T}");
1454     fhPtIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1455     outputContainer->Add(fhPtIso) ;
1456     
1457     fhPtCentralityIso  = new TH2F("hPtCentrality","centrality vs #it{p}_{T} for isolated particles",nptbins,ptmin,ptmax, 100,0,100);
1458     fhPtCentralityIso->SetYTitle("centrality");
1459     fhPtCentralityIso->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1460     outputContainer->Add(fhPtCentralityIso) ;
1461     
1462     fhPtEventPlaneIso  = new TH2F("hPtEventPlane","event plane angle vs #it{p}_{T} for isolated particles",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1463     fhPtEventPlaneIso->SetYTitle("Event plane angle (rad)");
1464     fhPtEventPlaneIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1465     outputContainer->Add(fhPtEventPlaneIso) ;
1466     
1467     
1468     fhPtNLocMaxIso  = new TH2F("hPtNLocMax",
1469                                Form("Number of isolated particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f vs NLM, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1470                                nptbins,ptmin,ptmax,10,0,10);
1471     fhPtNLocMaxIso->SetYTitle("#it{NLM}");
1472     fhPtNLocMaxIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1473     outputContainer->Add(fhPtNLocMaxIso) ;
1474     
1475     fhPhiIso  = new TH2F("hPhi",
1476                          Form("Number of isolated particles vs #phi for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1477                          nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1478     fhPhiIso->SetYTitle("#phi");
1479     fhPhiIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1480     outputContainer->Add(fhPhiIso) ;
1481     
1482     fhEtaIso  = new TH2F("hEta",
1483                          Form("Number of isolated particles vs #eta for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1484                          nptbins,ptmin,ptmax,netabins,etamin,etamax);
1485     fhEtaIso->SetYTitle("#eta");
1486     fhEtaIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1487     outputContainer->Add(fhEtaIso) ;
1488     
1489     fhEtaPhiIso  = new TH2F("hEtaPhiIso",
1490                             Form("Number of isolated particles #eta vs #phi for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1491                             netabins,etamin,etamax,nphibins,phimin,phimax);
1492     fhEtaPhiIso->SetXTitle("#eta");
1493     fhEtaPhiIso->SetYTitle("#phi");
1494     outputContainer->Add(fhEtaPhiIso) ;
1495     
1496     fhPtDecayIso  = new TH1F("hPtDecayIso",
1497                              Form("Number of isolated #pi^{0} decay particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1498                              nptbins,ptmin,ptmax);
1499     fhPtDecayIso->SetYTitle("#it{counts}");
1500     fhPtDecayIso->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1501     outputContainer->Add(fhPtDecayIso) ;
1502     
1503     fhEtaPhiDecayIso  = new TH2F("hEtaPhiDecayIso",
1504                                  Form("Number of isolated Pi0 decay particles #eta vs #phi for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
1505                                  netabins,etamin,etamax,nphibins,phimin,phimax);
1506     fhEtaPhiDecayIso->SetXTitle("#eta");
1507     fhEtaPhiDecayIso->SetYTitle("#phi");
1508     outputContainer->Add(fhEtaPhiDecayIso) ;
1509     
1510     fhConeSumPt  = new TH2F("hConePtSum",
1511                             Form("Track and Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1512                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1513     fhConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
1514     fhConeSumPt->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1515     outputContainer->Add(fhConeSumPt) ;
1516     
1517     fhConeSumPtTrigEtaPhi  = new TH2F("hConePtSumTrigEtaPhi",
1518                             Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1519                             netabins,etamin,etamax,nphibins,phimin,phimax);
1520     fhConeSumPtTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1521     fhConeSumPtTrigEtaPhi->SetXTitle("#eta_{trigger}");
1522     fhConeSumPtTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1523     outputContainer->Add(fhConeSumPtTrigEtaPhi) ;
1524     
1525     fhPtInCone  = new TH2F("hPtInCone",
1526                            Form("#it{p}_{T} of clusters and tracks in isolation cone for #it{R} =  %2.2f",r),
1527                            nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1528     fhPtInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1529     fhPtInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1530     outputContainer->Add(fhPtInCone) ;
1531     
1532     fhPtInConeCent  = new TH2F("hPtInConeCent",
1533                                Form("#it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1534                                100,0,100,nptinconebins,ptinconemin,ptinconemax);
1535     fhPtInConeCent->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1536     fhPtInConeCent->SetXTitle("centrality");
1537     outputContainer->Add(fhPtInConeCent) ;
1538     
1539     // Cluster only histograms
1540     if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyCharged)
1541     {
1542       fhConeSumPtCluster  = new TH2F("hConePtSumCluster",
1543                                      Form("Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1544                                      nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1545       fhConeSumPtCluster->SetYTitle("#Sigma #it{p}_{T}");
1546       fhConeSumPtCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1547       outputContainer->Add(fhConeSumPtCluster) ;
1548       
1549       fhConeSumPtCell  = new TH2F("hConePtSumCell",
1550                                   Form("Cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1551                                   nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1552       fhConeSumPtCell->SetYTitle("#Sigma #it{p}_{T}");
1553       fhConeSumPtCell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1554       outputContainer->Add(fhConeSumPtCell) ;
1555       
1556       fhConeSumPtEtaBandUECluster  = new TH2F("hConePtSumEtaBandUECluster",
1557                                               "#Sigma cluster #it{p}_{T} in UE Eta Band",
1558                                               nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1559       fhConeSumPtEtaBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
1560       fhConeSumPtEtaBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1561       outputContainer->Add(fhConeSumPtEtaBandUECluster) ;
1562       
1563       fhConeSumPtPhiBandUECluster  = new TH2F("hConePtSumPhiBandUECluster",
1564                                               "#Sigma cluster #it{p}_{T} UE Phi Band",
1565                                               nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1566       fhConeSumPtPhiBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
1567       fhConeSumPtPhiBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1568       outputContainer->Add(fhConeSumPtPhiBandUECluster) ;
1569       
1570       fhConeSumPtEtaBandUEClusterTrigEtaPhi  = new TH2F("hConePtSumEtaBandUEClusterTrigEtaPhi",
1571                                                         "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} in UE Eta Band",
1572                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1573       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1574       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1575       fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1576       outputContainer->Add(fhConeSumPtEtaBandUEClusterTrigEtaPhi) ;
1577       
1578       fhConeSumPtPhiBandUEClusterTrigEtaPhi  = new TH2F("hConePtSumPhiBandUEClusterTrigEtaPhi",
1579                                                         "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} UE Phi Band",
1580                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1581       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1582       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1583       fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1584       outputContainer->Add(fhConeSumPtPhiBandUEClusterTrigEtaPhi) ;
1585       
1586       
1587       fhConeSumPtEtaBandUECell  = new TH2F("hConePtSumEtaBandUECell",
1588                                            "#Sigma cell #it{p}_{T} in UE Eta Band",
1589                                            nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1590       fhConeSumPtEtaBandUECell->SetYTitle("#Sigma #it{p}_{T}");
1591       fhConeSumPtEtaBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1592       outputContainer->Add(fhConeSumPtEtaBandUECell) ;
1593       
1594       fhConeSumPtPhiBandUECell  = new TH2F("hConePtSumPhiBandUECell",
1595                                            "#Sigma cell #it{p}_{T} UE Phi Band",
1596                                            nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1597       fhConeSumPtPhiBandUECell->SetYTitle("#Sigma #it{p}_{T}");
1598       fhConeSumPtPhiBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1599       outputContainer->Add(fhConeSumPtPhiBandUECell) ;
1600       
1601       fhConeSumPtEtaBandUECellTrigEtaPhi  = new TH2F("hConePtSumEtaBandUECellTrigEtaPhi",
1602                                                      "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} in UE Eta Band",
1603                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1604       fhConeSumPtEtaBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1605       fhConeSumPtEtaBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1606       fhConeSumPtEtaBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1607       outputContainer->Add(fhConeSumPtEtaBandUECellTrigEtaPhi) ;
1608       
1609       fhConeSumPtPhiBandUECellTrigEtaPhi  = new TH2F("hConePtSumPhiBandUECellTrigEtaPhi",
1610                                                      "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} UE Phi Band",
1611                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1612       fhConeSumPtPhiBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1613       fhConeSumPtPhiBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1614       fhConeSumPtPhiBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1615       outputContainer->Add(fhConeSumPtPhiBandUECellTrigEtaPhi) ;
1616
1617       
1618       fhPtClusterInCone  = new TH2F("hPtClusterInCone",
1619                                     Form("#it{p}_{T} of clusters in isolation cone for #it{R} =  %2.2f",r),
1620                                     nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1621       fhPtClusterInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1622       fhPtClusterInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1623       outputContainer->Add(fhPtClusterInCone) ;
1624       
1625       fhEtaBandCluster  = new TH2F("hEtaBandCluster",
1626                                    Form("#eta vs #phi of clusters in #eta band isolation cone for #it{R} =  %2.2f",r),
1627                                    netabins,-1,1,nphibins,0,TMath::TwoPi());
1628       fhEtaBandCluster->SetXTitle("#eta");
1629       fhEtaBandCluster->SetYTitle("#phi");
1630       outputContainer->Add(fhEtaBandCluster) ;
1631       
1632       fhPhiBandCluster  = new TH2F("hPhiBandCluster",
1633                                    Form("#eta vs #phi of clusters in #phi band isolation cone for #it{R} =  %2.2f",r),
1634                                    netabins,-1,1,nphibins,0,TMath::TwoPi());
1635       fhPhiBandCluster->SetXTitle("#eta");
1636       fhPhiBandCluster->SetYTitle("#phi");
1637       outputContainer->Add(fhPhiBandCluster) ;
1638       
1639       fhEtaPhiInConeCluster= new TH2F("hEtaPhiInConeCluster",
1640                                       Form("#eta vs #phi of clusters in cone for #it{R} =  %2.2f",r),
1641                                       netabins,-1,1,nphibins,0,TMath::TwoPi());
1642       fhEtaPhiInConeCluster->SetXTitle("#eta");
1643       fhEtaPhiInConeCluster->SetYTitle("#phi");
1644       outputContainer->Add(fhEtaPhiInConeCluster) ;
1645         
1646       fhEtaPhiCluster= new TH2F("hEtaPhiCluster",
1647                                 Form("#eta vs #phi of all clusters"),
1648                                 netabins,-1,1,nphibins,0,TMath::TwoPi());
1649       fhEtaPhiCluster->SetXTitle("#eta");
1650       fhEtaPhiCluster->SetYTitle("#phi");
1651       outputContainer->Add(fhEtaPhiCluster) ;
1652
1653       fhPtCellInCone  = new TH2F("hPtCellInCone",
1654                                  Form("#it{p}_{T} of cells in isolation cone for #it{R} =  %2.2f",r),
1655                                  nptbins,ptmin,ptmax,1000,0,50);
1656       fhPtCellInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1657       fhPtCellInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1658       outputContainer->Add(fhPtCellInCone) ;
1659
1660       fhEtaBandCell  = new TH2F("hEtaBandCell",
1661                                 Form("#col vs #row of cells in #eta band isolation cone for #it{R} =  %2.2f",r),
1662                                 96,0,95,128,0,127);
1663       fhEtaBandCell->SetXTitle("#col");
1664       fhEtaBandCell->SetYTitle("#row");
1665       outputContainer->Add(fhEtaBandCell) ;
1666       
1667       fhPhiBandCell  = new TH2F("hPhiBandCell",
1668                                 Form("#col vs #row of cells in #phi band isolation cone for #it{R} =  %2.2f",r),
1669                                 96,0,95,128,0,127);
1670       fhPhiBandCell->SetXTitle("#col");
1671       fhPhiBandCell->SetYTitle("#row");
1672       outputContainer->Add(fhPhiBandCell) ;
1673       
1674       fhConeSumPtEtaUESubCluster  = new TH2F("hConeSumPtEtaUESubCluster",
1675                                              Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1676                                              nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1677       fhConeSumPtEtaUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
1678       fhConeSumPtEtaUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1679       outputContainer->Add(fhConeSumPtEtaUESubCluster) ;
1680       
1681       fhConeSumPtPhiUESubCluster  = new TH2F("hConeSumPtPhiUESubCluster",
1682                                              Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1683                                              nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1684       fhConeSumPtPhiUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
1685       fhConeSumPtPhiUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1686       outputContainer->Add(fhConeSumPtPhiUESubCluster) ;
1687       
1688       fhConeSumPtEtaUESubClusterTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubClusterTrigEtaPhi",
1689                                                        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),
1690                                                        netabins,etamin,etamax,nphibins,phimin,phimax);
1691       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1692       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1693       fhConeSumPtEtaUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1694       outputContainer->Add(fhConeSumPtEtaUESubClusterTrigEtaPhi) ;
1695       
1696       fhConeSumPtPhiUESubClusterTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubClusterTrigEtaPhi",
1697                                                        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),
1698                                                        netabins,etamin,etamax,nphibins,phimin,phimax);
1699       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1700       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1701       fhConeSumPtPhiUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1702       outputContainer->Add(fhConeSumPtPhiUESubClusterTrigEtaPhi) ;
1703       
1704       
1705       fhConeSumPtEtaUESubCell  = new TH2F("hConeSumPtEtaUESubCell",
1706                                           Form("Cells #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1707                                           nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1708       fhConeSumPtEtaUESubCell->SetYTitle("#Sigma #it{p}_{T}");
1709       fhConeSumPtEtaUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1710       outputContainer->Add(fhConeSumPtEtaUESubCell) ;
1711       
1712       fhConeSumPtPhiUESubCell  = new TH2F("hConeSumPtPhiUESubCell",
1713                                           Form("Cells #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1714                                           nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1715       fhConeSumPtPhiUESubCell->SetYTitle("#Sigma #it{p}_{T}");
1716       fhConeSumPtPhiUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1717       outputContainer->Add(fhConeSumPtPhiUESubCell) ;
1718       
1719       fhConeSumPtEtaUESubCellTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubCellTrigEtaPhi",
1720                                                     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),
1721                                                     netabins,etamin,etamax,nphibins,phimin,phimax);
1722       fhConeSumPtEtaUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1723       fhConeSumPtEtaUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1724       fhConeSumPtEtaUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1725       outputContainer->Add(fhConeSumPtEtaUESubCellTrigEtaPhi) ;
1726       
1727       fhConeSumPtPhiUESubCellTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubCellTrigEtaPhi",
1728                                                     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),
1729                                                     netabins,etamin,etamax,nphibins,phimin,phimax);
1730       fhConeSumPtPhiUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1731       fhConeSumPtPhiUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
1732       fhConeSumPtPhiUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1733       outputContainer->Add(fhConeSumPtPhiUESubCellTrigEtaPhi) ;
1734       
1735       
1736       fhFractionClusterOutConeEta  = new TH2F("hFractionClusterOutConeEta",
1737                                               Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #eta acceptance",r),
1738                                               nptbins,ptmin,ptmax,100,0,1);
1739       fhFractionClusterOutConeEta->SetYTitle("#it{fraction}");
1740       fhFractionClusterOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1741       outputContainer->Add(fhFractionClusterOutConeEta) ;
1742       
1743       fhFractionClusterOutConeEtaTrigEtaPhi  = new TH2F("hFractionClusterOutConeEtaTrigEtaPhi",
1744                                                         Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #eta acceptance, in trigger #eta-#phi ",r),
1745                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1746       fhFractionClusterOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1747       fhFractionClusterOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1748       fhFractionClusterOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1749       outputContainer->Add(fhFractionClusterOutConeEtaTrigEtaPhi) ;
1750       
1751       fhFractionClusterOutConePhi  = new TH2F("hFractionClusterOutConePhi",
1752                                               Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #phi acceptance",r),
1753                                               nptbins,ptmin,ptmax,100,0,1);
1754       fhFractionClusterOutConePhi->SetYTitle("#it{fraction}");
1755       fhFractionClusterOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1756       outputContainer->Add(fhFractionClusterOutConePhi) ;
1757       
1758       fhFractionClusterOutConePhiTrigEtaPhi  = new TH2F("hFractionClusterOutConePhiTrigEtaPhi",
1759                                                         Form("Fraction of the isolation cone #it{R} =  %2.2f, out of clusters #phi acceptance, in trigger #eta-#phi ",r),
1760                                                         netabins,etamin,etamax,nphibins,phimin,phimax);
1761       fhFractionClusterOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
1762       fhFractionClusterOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1763       fhFractionClusterOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1764       outputContainer->Add(fhFractionClusterOutConePhiTrigEtaPhi) ;
1765       
1766       fhConeSumPtSubvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCluster",
1767                                                         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),
1768                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1769       fhConeSumPtSubvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1770       fhConeSumPtSubvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1771       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCluster);
1772       
1773       fhConeSumPtSubNormvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCluster",
1774                                                             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),
1775                                                             nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1776       fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1777       fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1778       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCluster);
1779       
1780       fhConeSumPtSubvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCluster",
1781                                                         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),
1782                                                         nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1783       fhConeSumPtSubvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1784       fhConeSumPtSubvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1785       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCluster);
1786       
1787       fhConeSumPtSubNormvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCluster",
1788                                                             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),
1789                                                             nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1790       fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1791       fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1792       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCluster);
1793
1794       
1795       fhFractionCellOutConeEta  = new TH2F("hFractionCellOutConeEta",
1796                                            Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #eta acceptance",r),
1797                                            nptbins,ptmin,ptmax,100,0,1);
1798       fhFractionCellOutConeEta->SetYTitle("#it{fraction}");
1799       fhFractionCellOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1800       outputContainer->Add(fhFractionCellOutConeEta) ;
1801       
1802       fhFractionCellOutConeEtaTrigEtaPhi  = new TH2F("hFractionCellOutConeEtaTrigEtaPhi",
1803                                                      Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #eta acceptance, in trigger #eta-#phi ",r),
1804                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1805       fhFractionCellOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1806       fhFractionCellOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1807       fhFractionCellOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1808       outputContainer->Add(fhFractionCellOutConeEtaTrigEtaPhi) ;
1809       
1810       fhFractionCellOutConePhi  = new TH2F("hFractionCellOutConePhi",
1811                                            Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #phi acceptance",r),
1812                                            nptbins,ptmin,ptmax,100,0,1);
1813       fhFractionCellOutConePhi->SetYTitle("#it{fraction}");
1814       fhFractionCellOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1815       outputContainer->Add(fhFractionCellOutConePhi) ;
1816       
1817       fhFractionCellOutConePhiTrigEtaPhi  = new TH2F("hFractionCellOutConePhiTrigEtaPhi",
1818                                                      Form("Fraction of the isolation cone #it{R} =  %2.2f, out of cells #phi acceptance, in trigger #eta-#phi ",r),
1819                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1820       fhFractionCellOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
1821       fhFractionCellOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1822       fhFractionCellOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1823       outputContainer->Add(fhFractionCellOutConePhiTrigEtaPhi) ;
1824       
1825       
1826       fhConeSumPtSubvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCell",
1827                                                      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),
1828                                                      nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1829       fhConeSumPtSubvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1830       fhConeSumPtSubvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1831       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCell);
1832       
1833       fhConeSumPtSubNormvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCell",
1834                                                          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),
1835                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1836       fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1837       fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1838       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCell);
1839       
1840       fhConeSumPtSubvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCell",
1841                                                      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),
1842                                                      nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1843       fhConeSumPtSubvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1844       fhConeSumPtSubvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1845       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCell);
1846       
1847       fhConeSumPtSubNormvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCell",
1848                                                          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),
1849                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1850       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1851       fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1852       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCell);
1853
1854       fhConeSumPtVSUEClusterEtaBand  = new TH2F("hConeSumPtVSUEClusterEtaBand",
1855                                                          Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for cluster (before normalization), R=%2.2f",r),
1856                                                          nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
1857       fhConeSumPtVSUEClusterEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1858       fhConeSumPtVSUEClusterEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1859       outputContainer->Add(fhConeSumPtVSUEClusterEtaBand);
1860
1861       fhConeSumPtVSUEClusterPhiBand  = new TH2F("hConeSumPtVSUEClusterPhiBand",
1862                                                          Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for cluster (before normalization), R=%2.2f",r),
1863                                                          nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
1864       fhConeSumPtVSUEClusterPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1865       fhConeSumPtVSUEClusterPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1866       outputContainer->Add(fhConeSumPtVSUEClusterPhiBand);
1867       
1868     }
1869     
1870     // Track only histograms
1871     if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyNeutral)
1872     {
1873       fhConeSumPtTrack  = new TH2F("hConePtSumTrack",
1874                                    Form("Track #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
1875                                    nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1876       fhConeSumPtTrack->SetYTitle("#Sigma #it{p}_{T}");
1877       fhConeSumPtTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1878       outputContainer->Add(fhConeSumPtTrack) ;
1879       
1880       
1881       fhConeSumPtEtaBandUETrack  = new TH2F("hConePtSumEtaBandUETrack",
1882                                             "#Sigma track #it{p}_{T} in UE Eta Band",
1883                                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1884       fhConeSumPtEtaBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
1885       fhConeSumPtEtaBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1886       outputContainer->Add(fhConeSumPtEtaBandUETrack) ;
1887       
1888       fhConeSumPtPhiBandUETrack  = new TH2F("hConePtSumPhiBandUETrack",
1889                                             "#Sigma track #it{p}_{T} in UE Phi Band",
1890                                             nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax*8);
1891       fhConeSumPtPhiBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
1892       fhConeSumPtPhiBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1893       outputContainer->Add(fhConeSumPtPhiBandUETrack) ;
1894       
1895       
1896       fhConeSumPtEtaBandUETrackTrigEtaPhi  = new TH2F("hConePtSumEtaBandUETrackTrigEtaPhi",
1897                                                       "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Eta Band",
1898                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1899       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1900       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1901       fhConeSumPtEtaBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1902       outputContainer->Add(fhConeSumPtEtaBandUETrackTrigEtaPhi) ;
1903       
1904       fhConeSumPtPhiBandUETrackTrigEtaPhi  = new TH2F("hConePtSumPhiBandUETrackTrigEtaPhi",
1905                                                       "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Phi Band",
1906                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1907       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1908       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1909       fhConeSumPtPhiBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1910       outputContainer->Add(fhConeSumPtPhiBandUETrackTrigEtaPhi) ;
1911       
1912       
1913       fhPtTrackInCone  = new TH2F("hPtTrackInCone",
1914                                   Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f",r),
1915                                   nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1916       fhPtTrackInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1917       fhPtTrackInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1918       outputContainer->Add(fhPtTrackInCone) ;
1919       
1920       
1921       fhEtaBandTrack  = new TH2F("hEtaBandTrack",
1922                                  Form("#eta vs #phi of tracks in #eta band isolation cone for #it{R} =  %2.2f",r),
1923                                  netabins,-1,1,nphibins,0,TMath::TwoPi());
1924       fhEtaBandTrack->SetXTitle("#eta");
1925       fhEtaBandTrack->SetYTitle("#phi");
1926       outputContainer->Add(fhEtaBandTrack) ;
1927       
1928       fhPhiBandTrack  = new TH2F("hPhiBandTrack",
1929                                  Form("#eta vs #phi of tracks in #phi band isolation cone for #it{R} =  %2.2f",r),
1930                                  netabins,-1,1,nphibins,0,TMath::TwoPi());
1931       fhPhiBandTrack->SetXTitle("#eta");
1932       fhPhiBandTrack->SetYTitle("#phi");
1933       outputContainer->Add(fhPhiBandTrack) ;
1934       
1935       
1936       fhConeSumPtEtaUESubTrack  = new TH2F("hConeSumPtEtaUESubTrack",
1937                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
1938                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1939       fhConeSumPtEtaUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
1940       fhConeSumPtEtaUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1941       outputContainer->Add(fhConeSumPtEtaUESubTrack) ;
1942       
1943       fhConeSumPtPhiUESubTrack  = new TH2F("hConeSumPtPhiUESubTrack",
1944                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
1945                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
1946       fhConeSumPtPhiUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
1947       fhConeSumPtPhiUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1948       outputContainer->Add(fhConeSumPtPhiUESubTrack) ;
1949       
1950       fhConeSumPtEtaUESubTrackTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrackTrigEtaPhi",
1951                                                      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),
1952                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1953       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1954       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1955       fhConeSumPtEtaUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1956       outputContainer->Add(fhConeSumPtEtaUESubTrackTrigEtaPhi) ;
1957       
1958       fhConeSumPtPhiUESubTrackTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrackTrigEtaPhi",
1959                                                      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),
1960                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
1961       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1962       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1963       fhConeSumPtPhiUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1964       outputContainer->Add(fhConeSumPtPhiUESubTrackTrigEtaPhi) ;
1965       
1966       fhFractionTrackOutConeEta  = new TH2F("hFractionTrackOutConeEta",
1967                                             Form("Fraction of the isolation cone #it{R} =  %2.2f, out of tracks #eta acceptance",r),
1968                                             nptbins,ptmin,ptmax,100,0,1);
1969       fhFractionTrackOutConeEta->SetYTitle("#it{fraction}");
1970       fhFractionTrackOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1971       outputContainer->Add(fhFractionTrackOutConeEta) ;
1972       
1973       fhFractionTrackOutConeEtaTrigEtaPhi  = new TH2F("hFractionTrackOutConeEtaTrigEtaPhi",
1974                                                       Form("Fraction of the isolation cone #it{R} =  %2.2f, out of tracks #eta acceptance, in trigger #eta-#phi ",r),
1975                                                       netabins,etamin,etamax,nphibins,phimin,phimax);
1976       fhFractionTrackOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
1977       fhFractionTrackOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1978       fhFractionTrackOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
1979       outputContainer->Add(fhFractionTrackOutConeEtaTrigEtaPhi) ;
1980       
1981       fhConeSumPtSubvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubvsConeSumPtTotPhiTrack",
1982                                                       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),
1983                                                       nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1984       fhConeSumPtSubvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1985       fhConeSumPtSubvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1986       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiTrack);
1987       
1988       fhConeSumPtSubNormvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiTrack",
1989                                                           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),
1990                                                           nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1991       fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1992       fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
1993       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiTrack);
1994       
1995       fhConeSumPtSubvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubvsConeSumPtTotEtaTrack",
1996                                                       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),
1997                                                       nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
1998       fhConeSumPtSubvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
1999       fhConeSumPtSubvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2000       outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaTrack);
2001       
2002       fhConeSumPtSubNormvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaTrack",
2003                                                           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),
2004                                                           nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2005       fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2006       fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2007       outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaTrack);
2008       
2009       // UE in perpendicular cone
2010       fhPerpConeSumPt  = new TH2F("hPerpConePtSum",
2011                                   Form("#Sigma #it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} =  %2.2f",r),
2012                                   nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2013       fhPerpConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
2014       fhPerpConeSumPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2015       outputContainer->Add(fhPerpConeSumPt) ;
2016       
2017       fhPtInPerpCone  = new TH2F("hPtInPerpCone",
2018                                  Form("#it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} =  %2.2f",r),
2019                                  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2020       fhPtInPerpCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2021       fhPtInPerpCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2022       outputContainer->Add(fhPtInPerpCone) ;
2023
2024       fhEtaPhiTrack= new TH2F("hEtaPhiTrack",
2025                               Form("#eta vs #phi of all Tracks"),
2026                               netabins,-1,1,nphibins,0,TMath::TwoPi());
2027       fhEtaPhiTrack->SetXTitle("#eta");
2028       fhEtaPhiTrack->SetYTitle("#phi");
2029       outputContainer->Add(fhEtaPhiTrack) ;
2030       
2031       fhEtaPhiInConeTrack= new TH2F("hEtaPhiInConeTrack",
2032                                     Form("#eta vs #phi of Tracks in cone for #it{R} =  %2.2f",r),
2033                                     netabins,-1,1,nphibins,0,TMath::TwoPi());
2034       fhEtaPhiInConeTrack->SetXTitle("#eta");
2035       fhEtaPhiInConeTrack->SetYTitle("#phi");
2036       outputContainer->Add(fhEtaPhiInConeTrack) ;
2037       
2038       fhConeSumPtVSUETracksEtaBand  = new TH2F("hConeSumPtVSUETracksEtaBand",
2039                                                Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for tracks (before normalization), R=%2.2f",r),
2040                                                nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);         
2041       fhConeSumPtVSUETracksEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2042       fhConeSumPtVSUETracksEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2043       outputContainer->Add(fhConeSumPtVSUETracksEtaBand);
2044       
2045       fhConeSumPtVSUETracksPhiBand  = new TH2F("hConeSumPtVSUETracksPhiBand",
2046                                                Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for tracks (before normalization), R=%2.2f",r),
2047                                                nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);         
2048       fhConeSumPtVSUETracksPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2049       fhConeSumPtVSUETracksPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2050       outputContainer->Add(fhConeSumPtVSUETracksPhiBand); 
2051     }
2052     
2053     if(GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kNeutralAndCharged)
2054     {
2055       fhConeSumPtEtaUESub  = new TH2F("hConeSumPtEtaUESub",
2056                                       Form("#Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2057                                       nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2058       fhConeSumPtEtaUESub->SetYTitle("#Sigma #it{p}_{T}");
2059       fhConeSumPtEtaUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2060       outputContainer->Add(fhConeSumPtEtaUESub) ;
2061       
2062       fhConeSumPtPhiUESub  = new TH2F("hConeSumPtPhiUESub",
2063                                       Form("#Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2064                                       nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2065       fhConeSumPtPhiUESub->SetYTitle("#Sigma #it{p}_{T}");
2066       fhConeSumPtPhiUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2067       outputContainer->Add(fhConeSumPtPhiUESub) ;
2068       
2069       fhConeSumPtEtaUESubTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrigEtaPhi",
2070                                                 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),
2071                                                 netabins,etamin,etamax,nphibins,phimin,phimax);
2072       fhConeSumPtEtaUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2073       fhConeSumPtEtaUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
2074       fhConeSumPtEtaUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2075       outputContainer->Add(fhConeSumPtEtaUESubTrigEtaPhi) ;
2076       
2077       fhConeSumPtPhiUESubTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrigEtaPhi",
2078                                                 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),
2079                                                 netabins,etamin,etamax,nphibins,phimin,phimax);
2080       fhConeSumPtPhiUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2081       fhConeSumPtPhiUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
2082       fhConeSumPtPhiUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2083       outputContainer->Add(fhConeSumPtPhiUESubTrigEtaPhi) ;
2084       
2085       fhConeSumPtClustervsTrack   = new TH2F("hConePtSumClustervsTrack",
2086                                              Form("Track vs Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2087                                              nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2088       fhConeSumPtClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2089       fhConeSumPtClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2090       outputContainer->Add(fhConeSumPtClustervsTrack) ;
2091       
2092       fhConeSumPtEtaUESubClustervsTrack   = new TH2F("hConePtSumEtaUESubClustervsTrack",
2093                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2094                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2095       fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2096       fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2097       outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
2098       
2099       fhConeSumPtPhiUESubClustervsTrack   = new TH2F("hConePhiUESubPtSumClustervsTrack",
2100                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2101                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2102       fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2103       fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2104       outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
2105       
2106       fhEtaBandClustervsTrack   = new TH2F("hEtaBandClustervsTrack",
2107                                            "Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",
2108                                            nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2109       fhEtaBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2110       fhEtaBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2111       outputContainer->Add(fhEtaBandClustervsTrack) ;
2112       
2113       fhPhiBandClustervsTrack   = new TH2F("hPhiBandClustervsTrack",
2114                                            "Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",
2115                                            nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
2116       fhPhiBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2117       fhPhiBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2118       outputContainer->Add(fhPhiBandClustervsTrack) ;
2119       
2120       fhEtaBandNormClustervsTrack   = new TH2F("hEtaBandNormClustervsTrack",
2121                                                "Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",
2122                                                nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2123       fhEtaBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2124       fhEtaBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2125       outputContainer->Add(fhEtaBandNormClustervsTrack) ;
2126       
2127       fhPhiBandNormClustervsTrack   = new TH2F("hPhiBandNormClustervsTrack",
2128                                                "Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",
2129                                                nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2130       fhPhiBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2131       fhPhiBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2132       outputContainer->Add(fhPhiBandNormClustervsTrack) ;
2133       
2134             
2135       fhConeSumPtCellTrack = new TH2F("hConePtSumCellTrack",
2136                                       Form("Track and Cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2137                                       nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2138       fhConeSumPtCellTrack->SetYTitle("#Sigma #it{p}_{T}");
2139       fhConeSumPtCellTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2140       outputContainer->Add(fhConeSumPtCellTrack) ;
2141
2142       fhConeSumPtCellTrackTrigEtaPhi  = new TH2F("hConePtSumCellTrackTrigEtaPhi",
2143                                                  Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2144                                                  netabins,etamin,etamax,nphibins,phimin,phimax);
2145       fhConeSumPtCellTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2146       fhConeSumPtCellTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2147       fhConeSumPtCellTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2148       outputContainer->Add(fhConeSumPtCellTrackTrigEtaPhi) ;
2149
2150       
2151       fhConeSumPtEtaUESubClustervsTrack   = new TH2F("hConePtSumEtaUESubClustervsTrack",
2152                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2153                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2154       fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2155       fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2156       outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
2157       
2158       fhConeSumPtPhiUESubClustervsTrack   = new TH2F("hConePhiUESubPtSumClustervsTrack",
2159                                                      Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2160                                                      2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2161       fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
2162       fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2163       outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
2164       
2165       fhConeSumPtCellvsTrack   = new TH2F("hConePtSumCellvsTrack",
2166                                              Form("Track vs cell #Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",r),
2167                                              nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2168       fhConeSumPtCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2169       fhConeSumPtCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2170       outputContainer->Add(fhConeSumPtCellvsTrack) ;
2171       
2172       fhConeSumPtEtaUESubCellvsTrack   = new TH2F("hConePtSumEtaUESubCellvsTrack",
2173                                                   Form("Track vs Cell #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} =  %2.2f",r),
2174                                                   2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2175       fhConeSumPtEtaUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2176       fhConeSumPtEtaUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2177       outputContainer->Add(fhConeSumPtEtaUESubCellvsTrack) ;
2178       
2179       fhConeSumPtPhiUESubCellvsTrack   = new TH2F("hConePhiUESubPtSumCellvsTrack",
2180                                                   Form("Track vs Cell #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} =  %2.2f",r),
2181                                                   2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2182       fhConeSumPtPhiUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2183       fhConeSumPtPhiUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2184       outputContainer->Add(fhConeSumPtPhiUESubCellvsTrack) ;
2185       
2186       fhEtaBandCellvsTrack   = new TH2F("hEtaBandCellvsTrack",
2187                                         "Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",
2188                                         nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2189       fhEtaBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2190       fhEtaBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2191       outputContainer->Add(fhEtaBandCellvsTrack) ;
2192       
2193       fhPhiBandCellvsTrack   = new TH2F("hPhiBandCellvsTrack",
2194                                         "Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",
2195                                         nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
2196       fhPhiBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2197       fhPhiBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2198       outputContainer->Add(fhPhiBandCellvsTrack) ;
2199
2200       fhEtaBandNormCellvsTrack   = new TH2F("hEtaBandNormCellvsTrack",
2201                                             "Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} =  %2.2f",
2202                                             nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2203       fhEtaBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2204       fhEtaBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2205       outputContainer->Add(fhEtaBandNormCellvsTrack) ;
2206       
2207       fhPhiBandNormCellvsTrack   = new TH2F("hPhiBandNormCellvsTrack",
2208                                             "Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} =  %2.2f",
2209                                             nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2210       fhPhiBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2211       fhPhiBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2212       outputContainer->Add(fhPhiBandNormCellvsTrack) ;
2213       
2214       fhConeSumPtEtaUESubTrackCell  = new TH2F("hConeSumPtEtaUESubTrackCell",
2215                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} =  %2.2f",r),
2216                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2217       fhConeSumPtEtaUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
2218       fhConeSumPtEtaUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2219       outputContainer->Add(fhConeSumPtEtaUESubTrackCell) ;
2220       
2221       fhConeSumPtPhiUESubTrackCell  = new TH2F("hConeSumPtPhiUESubTrackCell",
2222                                            Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} =  %2.2f",r),
2223                                            nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2224       fhConeSumPtPhiUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
2225       fhConeSumPtPhiUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2226       outputContainer->Add(fhConeSumPtPhiUESubTrackCell) ;
2227       
2228       fhConeSumPtEtaUESubTrackCellTrigEtaPhi  = new TH2F("hConeSumPtEtaUESubTrackCellTrigEtaPhi",
2229                                                      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),
2230                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
2231       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2232       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2233       fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2234       outputContainer->Add(fhConeSumPtEtaUESubTrackCellTrigEtaPhi) ;
2235       
2236       fhConeSumPtPhiUESubTrackCellTrigEtaPhi  = new TH2F("hConeSumPtPhiUESubTrackCellTrigEtaPhi",
2237                                                      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),
2238                                                      netabins,etamin,etamax,nphibins,phimin,phimax);
2239       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2240       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2241       fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2242       outputContainer->Add(fhConeSumPtPhiUESubTrackCellTrigEtaPhi) ;
2243       
2244     }
2245         
2246     if(fFillSSHisto)
2247     {
2248         fhELambda0SSBkg  = new TH2F
2249       ("hELambda0SSBkg","Non isolated clusters : E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2250       fhELambda0SSBkg->SetYTitle("#lambda_{0}^{2}");
2251       fhELambda0SSBkg->SetXTitle("#it{E} (GeV)");
2252       outputContainer->Add(fhELambda0SSBkg) ;
2253     }
2254     
2255     for(Int_t iso = 0; iso < 2; iso++)
2256     {
2257       if(fFillTMHisto)
2258       {
2259         fhTrackMatchedDEta[iso]  = new TH2F
2260         (Form("hTrackMatchedDEta%s",hName[iso].Data()),
2261          Form("%s - d#eta of cluster-track vs cluster energy for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2262          nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2263         fhTrackMatchedDEta[iso]->SetYTitle("d#eta");
2264         fhTrackMatchedDEta[iso]->SetXTitle("E_{cluster} (GeV)");
2265         
2266         fhTrackMatchedDPhi[iso]  = new TH2F
2267         (Form("hTrackMatchedDPhi%s",hName[iso].Data()),
2268          Form("%s - d#phi of cluster-track vs cluster energy for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2269          nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2270         fhTrackMatchedDPhi[iso]->SetYTitle("d#phi (rad)");
2271         fhTrackMatchedDPhi[iso]->SetXTitle("E_{cluster} (GeV)");
2272         
2273         fhTrackMatchedDEtaDPhi[iso]  = new TH2F
2274         (Form("hTrackMatchedDEtaDPhi%s",hName[iso].Data()),
2275          Form("%s - d#eta vs d#phi of cluster-track for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2276          nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2277         fhTrackMatchedDEtaDPhi[iso]->SetYTitle("d#phi (rad)");
2278         fhTrackMatchedDEtaDPhi[iso]->SetXTitle("d#eta");
2279         
2280         outputContainer->Add(fhTrackMatchedDEta[iso]) ;
2281         outputContainer->Add(fhTrackMatchedDPhi[iso]) ;
2282         outputContainer->Add(fhTrackMatchedDEtaDPhi[iso]) ;
2283         
2284         fhdEdx[iso]  = new TH2F
2285         (Form("hdEdx%s",hName[iso].Data()),
2286          Form("%s - Matched track <d#it{E}/d#it{x}> vs cluster #it{E} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2287          nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2288         fhdEdx[iso]->SetXTitle("#it{E} (GeV)");
2289         fhdEdx[iso]->SetYTitle("<d#it{E}/d#it{x}>");
2290         outputContainer->Add(fhdEdx[iso]);
2291         
2292         fhEOverP[iso]  = new TH2F
2293         (Form("hEOverP%s",hName[iso].Data()),
2294          Form("%s - Matched track #it{E}/#it{p} vs cluster #it{E} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2295          nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2296         fhEOverP[iso]->SetXTitle("#it{E} (GeV)");
2297         fhEOverP[iso]->SetYTitle("#it{E}/#it{p}");
2298         outputContainer->Add(fhEOverP[iso]);
2299         
2300         if(IsDataMC())
2301         {
2302           fhTrackMatchedMCParticle[iso]  = new TH2F
2303           (Form("hTrackMatchedMCParticle%s",hName[iso].Data()),
2304            Form("%s - Origin of particle vs cluster #it{E} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",hTitle[iso].Data(),r,ptthre,ptfrac),
2305            nptbins,ptmin,ptmax,8,0,8);
2306           fhTrackMatchedMCParticle[iso]->SetXTitle("#it{E} (GeV)");
2307           //fhTrackMatchedMCParticle[iso]->SetYTitle("Particle type");
2308           
2309           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(1 ,"Photon");
2310           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(2 ,"Electron");
2311           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
2312           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(4 ,"Rest");
2313           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
2314           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
2315           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
2316           fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
2317           
2318           outputContainer->Add(fhTrackMatchedMCParticle[iso]);
2319         }
2320       }
2321       
2322       if(fFillSSHisto)
2323       {
2324         fhELambda0[iso]  = new TH2F
2325         (Form("hELambda0%s",hName[iso].Data()),
2326          Form("%s cluster : #it{E} vs #lambda_{0}",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2327         fhELambda0[iso]->SetYTitle("#lambda_{0}^{2}");
2328         fhELambda0[iso]->SetXTitle("#it{E} (GeV)");
2329         outputContainer->Add(fhELambda0[iso]) ;
2330
2331         fhPtLambda0[iso]  = new TH2F
2332         (Form("hPtLambda0%s",hName[iso].Data()),
2333          Form("%s cluster : #it{p}_{T} vs #lambda_{0}",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2334         fhPtLambda0[iso]->SetYTitle("#lambda_{0}^{2}");
2335         fhPtLambda0[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2336         outputContainer->Add(fhPtLambda0[iso]) ;
2337         
2338         if(IsDataMC())
2339         {
2340           fhPtLambda0MCPhotonPrompt[iso]  = new TH2F
2341           (Form("hPtLambda0%s_MCPhotonPrompt",hName[iso].Data()),
2342            Form("%s cluster : #it{p}_{T} vs #lambda_{0}: Origin is prompt photon",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2343           fhPtLambda0MCPhotonPrompt[iso]->SetYTitle("#lambda_{0}^{2}");
2344           fhPtLambda0MCPhotonPrompt[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2345           outputContainer->Add(fhPtLambda0MCPhotonPrompt[iso]) ; 
2346
2347           fhPtLambda0MCPhotonFrag[iso]  = new TH2F
2348           (Form("hPtLambda0%s_MCPhotonFrag",hName[iso].Data()),
2349            Form("%s cluster : #it{p}_{T} vs #lambda_{0}: Origin is fragmentation photon",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2350           fhPtLambda0MCPhotonFrag[iso]->SetYTitle("#lambda_{0}^{2}");
2351           fhPtLambda0MCPhotonFrag[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2352           outputContainer->Add(fhPtLambda0MCPhotonFrag[iso]) ; 
2353
2354
2355           fhELambda0MCPhoton[iso]  = new TH2F
2356           (Form("hELambda0%s_MCPhoton",hName[iso].Data()),
2357            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is final state photon",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2358           fhELambda0MCPhoton[iso]->SetYTitle("#lambda_{0}^{2}");
2359           fhELambda0MCPhoton[iso]->SetXTitle("#it{E} (GeV)");
2360           outputContainer->Add(fhELambda0MCPhoton[iso]) ;
2361           
2362           fhELambda0MCPi0[iso]  = new TH2F
2363           (Form("hELambda0%s_MCPi0",hName[iso].Data()),
2364            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is pi0 (2 #gamma)",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2365           fhELambda0MCPi0[iso]->SetYTitle("#lambda_{0}^{2}");
2366           fhELambda0MCPi0[iso]->SetXTitle("#it{E} (GeV)");
2367           outputContainer->Add(fhELambda0MCPi0[iso]) ;
2368           
2369           fhELambda0MCPi0Decay[iso]  = new TH2F
2370           (Form("hELambda0%s_MCPi0Decay",hName[iso].Data()),
2371            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is pi0 decay",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2372           fhELambda0MCPi0Decay[iso]->SetYTitle("#lambda_{0}^{2}");
2373           fhELambda0MCPi0Decay[iso]->SetXTitle("#it{E} (GeV)");
2374           outputContainer->Add(fhELambda0MCPi0Decay[iso]) ;
2375           
2376           fhELambda0MCEtaDecay[iso]  = new TH2F
2377           (Form("hELambda0%s_MCEtaDecay",hName[iso].Data()),
2378            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is eta decay",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2379           fhELambda0MCEtaDecay[iso]->SetYTitle("#lambda_{0}^{2}");
2380           fhELambda0MCEtaDecay[iso]->SetXTitle("#it{E} (GeV)");
2381           outputContainer->Add(fhELambda0MCEtaDecay[iso]) ;
2382           
2383           fhELambda0MCOtherDecay[iso]  = new TH2F
2384           (Form("hELambda0%s_MCOtherDecay",hName[iso].Data()),
2385            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is other decay",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2386           fhELambda0MCOtherDecay[iso]->SetYTitle("#lambda_{0}^{2}");
2387           fhELambda0MCOtherDecay[iso]->SetXTitle("#it{E} (GeV)");
2388           outputContainer->Add(fhELambda0MCOtherDecay[iso]) ;
2389           
2390           fhELambda0MCHadron[iso]  = new TH2F
2391           (Form("hELambda0%s_MCHadron",hName[iso].Data()),
2392            Form("%s cluster : #it{E} vs #lambda_{0}: Origin is hadron",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2393           fhELambda0MCHadron[iso]->SetYTitle("#lambda_{0}^{2}");
2394           fhELambda0MCHadron[iso]->SetXTitle("#it{E} (GeV)");
2395           outputContainer->Add(fhELambda0MCHadron[iso]) ;
2396         }
2397         
2398         fhELambda1[iso]  = new TH2F
2399         (Form("hELambda1%s",hName[iso].Data()),
2400          Form("%s cluster: #it{E} vs #lambda_{1}",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2401         fhELambda1[iso]->SetYTitle("#lambda_{1}^{2}");
2402         fhELambda1[iso]->SetXTitle("#it{E} (GeV)");
2403         outputContainer->Add(fhELambda1[iso]) ;
2404         
2405         if(fCalorimeter=="EMCAL")
2406         {     
2407
2408           fhPtLambda0TRD[iso]  = new TH2F
2409           (Form("hPtLambda0TRD%s",hName[iso].Data()),
2410            Form("%s cluster: #it{p}_{T} vs #lambda_{0}, SM behind TRD",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2411           fhPtLambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
2412           fhPtLambda0TRD[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2413           outputContainer->Add(fhPtLambda0TRD[iso]) ;
2414
2415           fhELambda0TRD[iso]  = new TH2F
2416           (Form("hELambda0TRD%s",hName[iso].Data()),
2417            Form("%s cluster: #it{E} vs #lambda_{0}, SM behind TRD",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2418           fhELambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
2419           fhELambda0TRD[iso]->SetXTitle("#it{E} (GeV)");
2420           outputContainer->Add(fhELambda0TRD[iso]) ;
2421           
2422           fhELambda1TRD[iso]  = new TH2F
2423           (Form("hELambda1TRD%s",hName[iso].Data()),
2424            Form("%s cluster: #it{E} vs #lambda_{1}, SM behind TRD",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2425           fhELambda1TRD[iso]->SetYTitle("#lambda_{1}^{2}");
2426           fhELambda1TRD[iso]->SetXTitle("#it{E} (GeV)");
2427           outputContainer->Add(fhELambda1TRD[iso]) ;
2428         }
2429         
2430         fhNLocMax[iso] = new TH2F
2431         (Form("hNLocMax%s",hName[iso].Data()),
2432          Form("%s - Number of local maxima in cluster",hTitle[iso].Data()),
2433          nptbins,ptmin,ptmax,10,0,10);
2434         fhNLocMax[iso]->SetYTitle("#it{NLM}");
2435         fhNLocMax[iso]->SetXTitle("#it{E} (GeV)");
2436         outputContainer->Add(fhNLocMax[iso]) ;
2437         
2438         fhELambda0LocMax1[iso]  = new TH2F
2439         (Form("hELambda0LocMax1%s",hName[iso].Data()),
2440          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, 1 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2441         fhELambda0LocMax1[iso]->SetYTitle("#lambda_{0}^{2}");
2442         fhELambda0LocMax1[iso]->SetXTitle("#it{E} (GeV)");
2443         outputContainer->Add(fhELambda0LocMax1[iso]) ;
2444         
2445         fhELambda1LocMax1[iso]  = new TH2F
2446         (Form("hELambda1LocMax1%s",hName[iso].Data()),
2447          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, 1 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2448         fhELambda1LocMax1[iso]->SetYTitle("#lambda_{1}^{2}");
2449         fhELambda1LocMax1[iso]->SetXTitle("#it{E} (GeV)");
2450         outputContainer->Add(fhELambda1LocMax1[iso]) ;
2451         
2452         fhELambda0LocMax2[iso]  = new TH2F
2453         (Form("hELambda0LocMax2%s",hName[iso].Data()),
2454          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, 2 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2455         fhELambda0LocMax2[iso]->SetYTitle("#lambda_{0}^{2}");
2456         fhELambda0LocMax2[iso]->SetXTitle("#it{E} (GeV)");
2457         outputContainer->Add(fhELambda0LocMax2[iso]) ;
2458         
2459         fhELambda1LocMax2[iso]  = new TH2F
2460         (Form("hELambda1LocMax2%s",hName[iso].Data()),
2461          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, 2 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2462         fhELambda1LocMax2[iso]->SetYTitle("#lambda_{1}^{2}");
2463         fhELambda1LocMax2[iso]->SetXTitle("#it{E} (GeV)");
2464         outputContainer->Add(fhELambda1LocMax2[iso]) ;
2465         
2466         fhELambda0LocMaxN[iso]  = new TH2F
2467         ( Form("hELambda0LocMaxN%s",hName[iso].Data()),
2468          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, N>2 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2469         fhELambda0LocMaxN[iso]->SetYTitle("#lambda_{0}^{2}");
2470         fhELambda0LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
2471         outputContainer->Add(fhELambda0LocMaxN[iso]) ;
2472         
2473         fhELambda1LocMaxN[iso]  = new TH2F
2474         (Form("hELambda1LocMaxN%s",hName[iso].Data()),
2475          Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, N>2 Local maxima",hTitle[iso].Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2476         fhELambda1LocMaxN[iso]->SetYTitle("#lambda_{1}^{2}");
2477         fhELambda1LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
2478         outputContainer->Add(fhELambda1LocMaxN[iso]) ;
2479         
2480       }
2481     } // control histograms for isolated and non isolated objects
2482     
2483     
2484     if(fFillPileUpHistograms)
2485     {
2486       fhPtTrackInConeOtherBC  = new TH2F("hPtTrackInConeOtherBC",
2487                                          Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC!=0",r),
2488                                          nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2489       fhPtTrackInConeOtherBC->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2490       fhPtTrackInConeOtherBC->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2491       outputContainer->Add(fhPtTrackInConeOtherBC) ;
2492       
2493       fhPtTrackInConeOtherBCPileUpSPD  = new TH2F("hPtTrackInConeOtherBCPileUpSPD",
2494                                                   Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC!=0, pile-up from SPD",r),
2495                                                   nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2496       fhPtTrackInConeOtherBCPileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2497       fhPtTrackInConeOtherBCPileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2498       outputContainer->Add(fhPtTrackInConeOtherBCPileUpSPD) ;
2499       
2500       fhPtTrackInConeBC0  = new TH2F("hPtTrackInConeBC0",
2501                                      Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0",r),
2502                                      nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2503       fhPtTrackInConeBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2504       fhPtTrackInConeBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2505       outputContainer->Add(fhPtTrackInConeBC0) ;
2506       
2507       fhPtTrackInConeVtxBC0  = new TH2F("hPtTrackInConeVtxBC0",
2508                                         Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0",r),
2509                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2510       fhPtTrackInConeVtxBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2511       fhPtTrackInConeVtxBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2512       outputContainer->Add(fhPtTrackInConeVtxBC0) ;
2513       
2514       
2515       fhPtTrackInConeBC0PileUpSPD  = new TH2F("hPtTrackInConeBC0PileUpSPD",
2516                                               Form("#it{p}_{T} of tracks in isolation cone for #it{R} =  %2.2f, TOF from BC==0, pile-up from SPD",r),
2517                                               nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2518       fhPtTrackInConeBC0PileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2519       fhPtTrackInConeBC0PileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2520       outputContainer->Add(fhPtTrackInConeBC0PileUpSPD) ;
2521       
2522       
2523       for (Int_t i = 0; i < 7 ; i++)
2524       {
2525         fhPtInConePileUp[i]  = new TH2F(Form("hPtInConePileUp%s",pileUpName[i].Data()),
2526                                         Form("#it{p}_{T} in isolation cone for #it{R} =  %2.2f, from pile-up (%s)",r,pileUpName[i].Data()),
2527                                         nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2528         fhPtInConePileUp[i]->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2529         fhPtInConePileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2530         outputContainer->Add(fhPtInConePileUp[i]) ;
2531       }
2532     }
2533     
2534     if(IsDataMC())
2535     {
2536       fhPtIsoPrompt  = new TH1F("hPtMCPrompt","Number of isolated prompt #gamma",nptbins,ptmin,ptmax); 
2537       fhPtIsoPrompt->SetYTitle("#it{counts}");
2538       fhPtIsoPrompt->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2539       outputContainer->Add(fhPtIsoPrompt) ; 
2540       
2541       fhPhiIsoPrompt  = new TH2F
2542       ("hPhiMCPrompt","Number of isolated prompt #gamma",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2543       fhPhiIsoPrompt->SetYTitle("#phi");
2544       fhPhiIsoPrompt->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2545       outputContainer->Add(fhPhiIsoPrompt) ; 
2546       
2547       fhEtaIsoPrompt  = new TH2F
2548       ("hEtaMCPrompt","Number of isolated prompt #gamma",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2549       fhEtaIsoPrompt->SetYTitle("#eta");
2550       fhEtaIsoPrompt->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2551       outputContainer->Add(fhEtaIsoPrompt) ;
2552       
2553       fhPtIsoFragmentation  = new TH1F("hPtMCFragmentation","Number of isolated #gamma",nptbins,ptmin,ptmax); 
2554       fhPtIsoFragmentation->SetYTitle("#it{counts}");
2555       fhPtIsoFragmentation->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2556       outputContainer->Add(fhPtIsoFragmentation) ; 
2557       
2558       fhPhiIsoFragmentation  = new TH2F
2559       ("hPhiMCFragmentation","Number of isolated fragmentation #gamma",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2560       fhPhiIsoFragmentation->SetYTitle("#phi");
2561       fhPhiIsoFragmentation->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2562       outputContainer->Add(fhPhiIsoFragmentation) ; 
2563       
2564       fhEtaIsoFragmentation  = new TH2F
2565       ("hEtaMCFragmentation","Number of isolated fragmentation #gamma",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2566       fhEtaIsoFragmentation->SetYTitle("#eta");
2567       fhEtaIsoFragmentation->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2568       outputContainer->Add(fhEtaIsoFragmentation) ;
2569       
2570       fhPtIsoPi0  = new TH1F("hPtMCPi0","Number of isolated #gamma from #pi^{0} (2 #gamma)",nptbins,ptmin,ptmax); 
2571       fhPtIsoPi0->SetYTitle("#it{counts}");
2572       fhPtIsoPi0->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2573       outputContainer->Add(fhPtIsoPi0) ; 
2574       
2575       fhPhiIsoPi0  = new TH2F
2576       ("hPhiMCPi0","Number of isolated #gamma from #pi^{0} (2 #gamma)",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2577       fhPhiIsoPi0->SetYTitle("#phi");
2578       fhPhiIsoPi0->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2579       outputContainer->Add(fhPhiIsoPi0) ; 
2580       
2581       fhEtaIsoPi0  = new TH2F
2582       ("hEtaMCPi0","Number of isolated #gamma from #pi^{0} (2 #gamma)",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2583       fhEtaIsoPi0->SetYTitle("#eta");
2584       fhEtaIsoPi0->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2585       outputContainer->Add(fhEtaIsoPi0) ;
2586       
2587       fhPtIsoPi0Decay  = new TH1F("hPtMCPi0Decay","Number of isolated #gamma from #pi^{0} decay",nptbins,ptmin,ptmax); 
2588       fhPtIsoPi0Decay->SetYTitle("#it{counts}");
2589       fhPtIsoPi0Decay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2590       outputContainer->Add(fhPtIsoPi0Decay) ; 
2591       
2592       fhPhiIsoPi0Decay  = new TH2F
2593       ("hPhiMCPi0Decay","Number of isolated #gamma from #pi^{0} decay",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2594       fhPhiIsoPi0Decay->SetYTitle("#phi");
2595       fhPhiIsoPi0Decay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2596       outputContainer->Add(fhPhiIsoPi0Decay) ; 
2597       
2598       fhEtaIsoPi0Decay  = new TH2F
2599       ("hEtaMCPi0Decay","Number of isolated #gamma from #pi^{0} decay",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2600       fhEtaIsoPi0Decay->SetYTitle("#eta");
2601       fhEtaIsoPi0Decay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2602       outputContainer->Add(fhEtaIsoPi0Decay) ;
2603       
2604       fhPtIsoEtaDecay  = new TH1F("hPtMCEtaDecay","Number of isolated #gamma from #eta decay",nptbins,ptmin,ptmax); 
2605       fhPtIsoEtaDecay->SetYTitle("#it{counts}");
2606       fhPtIsoEtaDecay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2607       outputContainer->Add(fhPtIsoEtaDecay) ; 
2608       
2609       fhPhiIsoEtaDecay  = new TH2F
2610       ("hPhiMCEtaDecay","Number of isolated #gamma from #eta decay",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2611       fhPhiIsoEtaDecay->SetYTitle("#phi");
2612       fhPhiIsoEtaDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2613       outputContainer->Add(fhPhiIsoEtaDecay) ; 
2614       
2615       fhEtaIsoEtaDecay  = new TH2F
2616       ("hEtaMCEtaDecay","Number of isolated #gamma from #eta decay",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2617       fhEtaIsoEtaDecay->SetYTitle("#eta");
2618       fhEtaIsoEtaDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2619       outputContainer->Add(fhEtaIsoEtaDecay) ;
2620       
2621       fhPtIsoOtherDecay  = new TH1F("hPtMCOtherDecay","Number of isolated #gamma from non-#pi^{0} decay",nptbins,ptmin,ptmax); 
2622       fhPtIsoOtherDecay->SetYTitle("#it{counts}");
2623       fhPtIsoOtherDecay->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2624       outputContainer->Add(fhPtIsoOtherDecay) ; 
2625       
2626       fhPhiIsoOtherDecay  = new TH2F
2627       ("hPhiMCOtherDecay","Number of isolated #gamma from non-#pi^{0} decay",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2628       fhPhiIsoOtherDecay->SetYTitle("#phi");
2629       fhPhiIsoOtherDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2630       outputContainer->Add(fhPhiIsoOtherDecay) ; 
2631       
2632       fhEtaIsoOtherDecay  = new TH2F
2633       ("hEtaMCOtherDecay","Number of isolated #gamma non-#pi^{0} decay",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2634       fhEtaIsoOtherDecay->SetYTitle("#eta");
2635       fhEtaIsoOtherDecay->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2636       outputContainer->Add(fhEtaIsoOtherDecay) ;
2637       
2638       //      fhPtIsoConversion  = new TH1F("hPtMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax); 
2639       //      fhPtIsoConversion->SetYTitle("#it{counts}");
2640       //      fhPtIsoConversion->SetXTitle("#it{p}_{T #gamma}(GeV/#it{c})");
2641       //      outputContainer->Add(fhPtIsoConversion) ; 
2642       //      
2643       //      fhPhiIsoConversion  = new TH2F
2644       //      ("hPhiMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2645       //      fhPhiIsoConversion->SetYTitle("#phi");
2646       //      fhPhiIsoConversion->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2647       //      outputContainer->Add(fhPhiIsoConversion) ; 
2648       //      
2649       //      fhEtaIsoConversion  = new TH2F
2650       //      ("hEtaMCConversion","Number of isolated converted #gamma",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2651       //      fhEtaIsoConversion->SetYTitle("#eta");
2652       //      fhEtaIsoConversion->SetXTitle("#it{p}_{T #gamma} (GeV/#it{c})");
2653       //      outputContainer->Add(fhEtaIsoConversion) ;
2654       
2655       fhPtIsoHadron  = new TH1F("hPtMCHadron","Number of isolated non-#gamma particles",nptbins,ptmin,ptmax); 
2656       fhPtIsoHadron->SetYTitle("#it{counts}");
2657       fhPtIsoHadron->SetXTitle("#it{p}_{T}(GeV/#it{c})");
2658       outputContainer->Add(fhPtIsoHadron) ; 
2659       
2660       
2661       fhPhiIsoHadron  = new TH2F
2662       ("hPhiMCHadron","Number of isolated non-#gamma particles",nptbins,ptmin,ptmax,nphibins,phimin,phimax); 
2663       fhPhiIsoHadron->SetYTitle("#phi");
2664       fhPhiIsoHadron->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2665       outputContainer->Add(fhPhiIsoHadron) ; 
2666       
2667       fhEtaIsoHadron  = new TH2F
2668       ("hEtaMCHadron","Number of isolated non-#gamma particles",nptbins,ptmin,ptmax,netabins,etamin,etamax); 
2669       fhEtaIsoHadron->SetYTitle("#eta");
2670       fhEtaIsoHadron->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2671       outputContainer->Add(fhEtaIsoHadron) ;
2672
2673       
2674       TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
2675         "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
2676       
2677       TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
2678         "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
2679       
2680       for(Int_t i = 0; i < 7; i++)
2681       {
2682         fhEPrimMC[i]  = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
2683                                  Form("primary photon  %s : #it{E} ",pptype[i].Data()),
2684                                  nptbins,ptmin,ptmax);
2685         fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
2686         outputContainer->Add(fhEPrimMC[i]) ;
2687         
2688         fhPtPrimMCiso[i]  = new TH1F(Form("hPtPrim_MCiso%s",ppname[i].Data()),
2689                                      Form("primary isolated photon %s : #it{p}_{T} ",pptype[i].Data()),
2690                                      nptbins,ptmin,ptmax);
2691         fhPtPrimMCiso[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2692         outputContainer->Add(fhPtPrimMCiso[i]) ;
2693         
2694         fhEtaPrimMC[i]  = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
2695                                    Form("primary photon %s : #eta vs #it{p}_{T}",pptype[i].Data()),
2696                                    nptbins,ptmin,ptmax,200,-2,2);
2697         fhEtaPrimMC[i]->SetYTitle("#eta");
2698         fhEtaPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2699         outputContainer->Add(fhEtaPrimMC[i]) ;
2700         
2701         fhPhiPrimMC[i]  = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
2702                                    Form("primary photon %s : #phi vs #it{p}_{T}",pptype[i].Data()),
2703                                    nptbins,ptmin,ptmax,200,0.,TMath::TwoPi());
2704         fhPhiPrimMC[i]->SetYTitle("#phi");
2705         fhPhiPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2706         outputContainer->Add(fhPhiPrimMC[i]) ;
2707       }
2708       
2709     }//Histos with MC
2710     
2711   }
2712   
2713   // Not Isolated histograms, reference histograms
2714   
2715   fhENoIso  = new TH1F("hENoIso",
2716                         Form("Number of not isolated leading particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2717                         nptbins,ptmin,ptmax); 
2718   fhENoIso->SetYTitle("#it{counts}");
2719   fhENoIso->SetXTitle("E (GeV/#it{c})");
2720   outputContainer->Add(fhENoIso) ;
2721   
2722   fhPtNoIso  = new TH1F("hPtNoIso",
2723                         Form("Number of not isolated leading particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2724                         nptbins,ptmin,ptmax); 
2725   fhPtNoIso->SetYTitle("#it{counts}");
2726   fhPtNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2727   outputContainer->Add(fhPtNoIso) ;
2728   
2729   fhPtNLocMaxNoIso  = new TH2F("hPtNLocMaxNoIso",
2730                                Form("Number of not isolated particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f vs NLM, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2731                                nptbins,ptmin,ptmax,10,0,10); 
2732   fhPtNLocMaxNoIso->SetYTitle("#it{NLM}");
2733   fhPtNLocMaxNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2734   outputContainer->Add(fhPtNLocMaxNoIso) ;   
2735   
2736   fhEtaPhiNoIso  = new TH2F("hEtaPhiNoIso",
2737                             Form("Number of not isolated leading particles #eta vs #phi for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2738                             netabins,etamin,etamax,nphibins,phimin,phimax); 
2739   fhEtaPhiNoIso->SetXTitle("#eta");
2740   fhEtaPhiNoIso->SetYTitle("#phi");
2741   outputContainer->Add(fhEtaPhiNoIso) ;    
2742   
2743   fhPtDecayNoIso  = new TH1F("hPtDecayNoIso",
2744                              Form("Number of not isolated leading pi0 decay particles vs #it{p}_{T} for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2745                              nptbins,ptmin,ptmax); 
2746   fhPtDecayNoIso->SetYTitle("#it{counts}");
2747   fhPtDecayNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2748   outputContainer->Add(fhPtDecayNoIso) ;
2749   
2750   fhEtaPhiDecayNoIso  = new TH2F("hEtaPhiDecayNoIso",
2751                                  Form("Number of not isolated leading Pi0 decay particles #eta vs #phi for #it{R} =  %2.2f, #it{p}_{T}^{th} = %2.2f, #it{p}_{T}^{fr} = %2.2f",r,ptthre,ptfrac),
2752                                  netabins,etamin,etamax,nphibins,phimin,phimax); 
2753   fhEtaPhiDecayNoIso->SetXTitle("#eta");
2754   fhEtaPhiDecayNoIso->SetYTitle("#phi");
2755   outputContainer->Add(fhEtaPhiDecayNoIso) ;
2756   
2757  
2758   if(IsDataMC())
2759   {
2760     fhPtNoIsoPi0  = new TH1F
2761     ("hPtNoIsoPi0","Number of not isolated leading #gamma from #pi^{0} (2 #gamma)",nptbins,ptmin,ptmax); 
2762     fhPtNoIsoPi0->SetYTitle("#it{counts}");
2763     fhPtNoIsoPi0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2764     outputContainer->Add(fhPtNoIsoPi0) ;
2765     
2766     fhPtNoIsoPi0Decay  = new TH1F
2767     ("hPtNoIsoPi0Decay","Number of not isolated leading #gamma from #pi^{0} decay",nptbins,ptmin,ptmax); 
2768     fhPtNoIsoPi0Decay->SetYTitle("#it{counts}");
2769     fhPtNoIsoPi0Decay->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2770     outputContainer->Add(fhPtNoIsoPi0Decay) ;
2771     
2772     fhPtNoIsoEtaDecay  = new TH1F
2773     ("hPtNoIsoEtaDecay","Number of not isolated leading #gamma from eta decay",nptbins,ptmin,ptmax); 
2774     fhPtNoIsoEtaDecay->SetYTitle("#it{counts}");
2775     fhPtNoIsoEtaDecay->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2776     outputContainer->Add(fhPtNoIsoEtaDecay) ;
2777     
2778     fhPtNoIsoOtherDecay  = new TH1F
2779     ("hPtNoIsoOtherDecay","Number of not isolated leading #gamma from other decay",nptbins,ptmin,ptmax); 
2780     fhPtNoIsoOtherDecay->SetYTitle("#it{counts}");
2781     fhPtNoIsoOtherDecay->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2782     outputContainer->Add(fhPtNoIsoOtherDecay) ;
2783     
2784     fhPtNoIsoPrompt  = new TH1F
2785     ("hPtNoIsoPrompt","Number of not isolated leading prompt #gamma",nptbins,ptmin,ptmax); 
2786     fhPtNoIsoPrompt->SetYTitle("#it{counts}");
2787     fhPtNoIsoPrompt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2788     outputContainer->Add(fhPtNoIsoPrompt) ;
2789     
2790     fhPtIsoMCPhoton  = new TH1F
2791     ("hPtIsoMCPhoton","Number of isolated leading  #gamma",nptbins,ptmin,ptmax); 
2792     fhPtIsoMCPhoton->SetYTitle("#it{counts}");
2793     fhPtIsoMCPhoton->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2794     outputContainer->Add(fhPtIsoMCPhoton) ;
2795     
2796     fhPtNoIsoMCPhoton  = new TH1F
2797     ("hPtNoIsoMCPhoton","Number of not isolated leading #gamma",nptbins,ptmin,ptmax); 
2798     fhPtNoIsoMCPhoton->SetYTitle("#it{counts}");
2799     fhPtNoIsoMCPhoton->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2800     outputContainer->Add(fhPtNoIsoMCPhoton) ;
2801     
2802 //    fhPtNoIsoConversion  = new TH1F
2803 //    ("hPtNoIsoConversion","Number of not isolated leading conversion #gamma",nptbins,ptmin,ptmax); 
2804 //    fhPtNoIsoConversion->SetYTitle("#it{counts}");
2805 //    fhPtNoIsoConversion->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2806 //    outputContainer->Add(fhPtNoIsoConversion) ;
2807     
2808     fhPtNoIsoFragmentation  = new TH1F
2809     ("hPtNoIsoFragmentation","Number of not isolated leading fragmentation #gamma",nptbins,ptmin,ptmax); 
2810     fhPtNoIsoFragmentation->SetYTitle("#it{counts}");
2811     fhPtNoIsoFragmentation->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2812     outputContainer->Add(fhPtNoIsoFragmentation) ;
2813     
2814     fhPtNoIsoHadron  = new TH1F
2815     ("hPtNoIsoHadron","Number of not isolated leading hadrons",nptbins,ptmin,ptmax); 
2816     fhPtNoIsoHadron->SetYTitle("#it{counts}");
2817     fhPtNoIsoHadron->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2818     outputContainer->Add(fhPtNoIsoHadron) ;
2819     
2820   }//Histos with MC
2821   
2822   
2823   if(fMakeSeveralIC)
2824   {
2825     const Int_t buffersize = 255;
2826     char name[buffersize];
2827     char title[buffersize];
2828     for(Int_t icone = 0; icone<fNCones; icone++)
2829     {   
2830       // sum pt in cone vs. pt leading
2831       snprintf(name, buffersize,"hSumPtLeadingPt_Cone_%d",icone);
2832       snprintf(title, buffersize,"#Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",fConeSizes[icone]);
2833       fhSumPtLeadingPt[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2834       fhSumPtLeadingPt[icone] ->SetYTitle("#sum_{cone}#it{p}_{T} (GeV/#it{c})");//#Sigma #it{p}_{T}
2835       fhSumPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
2836       outputContainer->Add(fhSumPtLeadingPt[icone]) ;
2837    
2838       // pt in cone vs. pt leading      
2839       snprintf(name, buffersize,"hPtLeadingPt_Cone_%d",icone);
2840       snprintf(title, buffersize,"#it{p}_{T} in isolation cone for #it{R} =  %2.2f",fConeSizes[icone]);
2841       fhPtLeadingPt[icone]  = new TH2F(name, title,  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax); 
2842       fhPtLeadingPt[icone] ->SetYTitle("#it{p}_{T}^{cone} (GeV/#it{c})");
2843       fhPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
2844       outputContainer->Add(fhPtLeadingPt[icone]) ;    
2845
2846        // sum pt in cone vs. pt leading in the forward region (for background subtraction studies)
2847         snprintf(name, buffersize,"hPerpSumPtLeadingPt_Cone_%d",icone);
2848       snprintf(title, buffersize,"#Sigma #it{p}_{T} in isolation cone for #it{R} =  %2.2f",fConeSizes[icone]);
2849       fhPerpSumPtLeadingPt[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2850       fhPerpSumPtLeadingPt[icone] ->SetYTitle("#sum_{cone}#it{p}_{T} (GeV/#it{c})");//#Sigma #it{p}_{T}
2851       fhPerpSumPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
2852       outputContainer->Add(fhPerpSumPtLeadingPt[icone]) ;
2853       
2854       // pt in cone vs. pt leading in the forward region (for background subtraction studies)    
2855         snprintf(name, buffersize,"hPerpPtLeadingPt_Cone_%d",icone);
2856       snprintf(title, buffersize,"#it{p}_{T} in isolation cone for #it{R} =  %2.2f",fConeSizes[icone]);
2857       fhPerpPtLeadingPt[icone]  = new TH2F(name, title,  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax); 
2858       fhPerpPtLeadingPt[icone] ->SetYTitle("#it{p}_{T}^{cone} (GeV/#it{c})");
2859       fhPerpPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
2860       outputContainer->Add(fhPerpPtLeadingPt[icone]) ;    
2861   
2862
2863       if(IsDataMC())
2864       {
2865         snprintf(name, buffersize,"hPtSumPrompt_Cone_%d",icone);
2866         snprintf(title, buffersize,"Candidate Prompt cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2867         fhPtSumIsolatedPrompt[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2868         fhPtSumIsolatedPrompt[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2869         fhPtSumIsolatedPrompt[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2870         outputContainer->Add(fhPtSumIsolatedPrompt[icone]) ; 
2871         
2872         snprintf(name, buffersize,"hPtSumFragmentation_Cone_%d",icone);
2873         snprintf(title, buffersize,"Candidate Fragmentation cone sum #it{p}_{T} for #it{R} =  %2.2fvs candidate #it{p}_{T}",fConeSizes[icone]);
2874         fhPtSumIsolatedFragmentation[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2875         fhPtSumIsolatedFragmentation[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2876         fhPtSumIsolatedFragmentation[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2877         outputContainer->Add(fhPtSumIsolatedFragmentation[icone]) ; 
2878         
2879         snprintf(name, buffersize,"hPtSumPi0_Cone_%d",icone);
2880         snprintf(title, buffersize,"Candidate Pi0 cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2881         fhPtSumIsolatedPi0[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2882         fhPtSumIsolatedPi0[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2883         fhPtSumIsolatedPi0[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2884         outputContainer->Add(fhPtSumIsolatedPi0[icone]) ; 
2885         
2886         snprintf(name, buffersize,"hPtSumPi0Decay_Cone_%d",icone);
2887         snprintf(title, buffersize,"Candidate Pi0Decay cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2888         fhPtSumIsolatedPi0Decay[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2889         fhPtSumIsolatedPi0Decay[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2890         fhPtSumIsolatedPi0Decay[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2891         outputContainer->Add(fhPtSumIsolatedPi0Decay[icone]) ; 
2892         
2893         snprintf(name, buffersize,"hPtSumEtaDecay_Cone_%d",icone);
2894         snprintf(title, buffersize,"Candidate EtaDecay cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2895         fhPtSumIsolatedEtaDecay[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2896         fhPtSumIsolatedEtaDecay[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2897         fhPtSumIsolatedEtaDecay[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2898         outputContainer->Add(fhPtSumIsolatedEtaDecay[icone]) ;         
2899         
2900         snprintf(name, buffersize,"hPtSumOtherDecay_Cone_%d",icone);
2901         snprintf(title, buffersize,"Candidate OtherDecay cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2902         fhPtSumIsolatedOtherDecay[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2903         fhPtSumIsolatedOtherDecay[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2904         fhPtSumIsolatedOtherDecay[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2905         outputContainer->Add(fhPtSumIsolatedOtherDecay[icone]) ; 
2906         
2907 //        snprintf(name, buffersize,"hPtSumConversion_Cone_%d",icone);
2908 //        snprintf(title, buffersize,"Candidate Conversion cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2909 //        fhPtSumIsolatedConversion[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2910 //        fhPtSumIsolatedConversion[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2911 //        fhPtSumIsolatedConversion[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2912 //        outputContainer->Add(fhPtSumIsolatedConversion[icone]) ; 
2913         
2914         snprintf(name, buffersize,"hPtSumHadron_Cone_%d",icone);
2915         snprintf(title, buffersize,"Candidate Hadron cone sum #it{p}_{T} for #it{R} =  %2.2f vs candidate #it{p}_{T}",fConeSizes[icone]);
2916         fhPtSumIsolatedHadron[icone]  = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2917         fhPtSumIsolatedHadron[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2918         fhPtSumIsolatedHadron[icone]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2919         outputContainer->Add(fhPtSumIsolatedHadron[icone]) ; 
2920         
2921       }//Histos with MC
2922       
2923       for(Int_t ipt = 0; ipt<fNPtThresFrac;ipt++)
2924       {   
2925
2926         snprintf(name, buffersize,"hPtThres_Cone_%d_Pt%d",icone,ipt);
2927         snprintf(title, buffersize,"Isolated candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{th} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtThresholds[ipt]);
2928         fhPtThresIsolated[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
2929         fhPtThresIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2930         outputContainer->Add(fhPtThresIsolated[icone][ipt]) ; 
2931         
2932         snprintf(name, buffersize,"hPtFrac_Cone_%d_Pt%d",icone,ipt);
2933         snprintf(title, buffersize,"Isolated candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
2934         fhPtFracIsolated[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
2935         fhPtFracIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2936         outputContainer->Add(fhPtFracIsolated[icone][ipt]) ; 
2937         
2938         
2939         snprintf(name, buffersize,"hPtSum_Cone_%d_Pt%d",icone,ipt);
2940         snprintf(title, buffersize,"Isolated candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
2941         fhPtSumIsolated[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
2942         // fhPtSumIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2943         fhPtSumIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2944         outputContainer->Add(fhPtSumIsolated[icone][ipt]) ;
2945         
2946         snprintf(name, buffersize,"hPtSumDensity_Cone_%d_Pt%d",icone,ipt);
2947         snprintf(title, buffersize,"Isolated candidate #it{p}_{T} distribution for density in #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
2948         fhPtSumDensityIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
2949         //fhPtSumIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2950         fhPtSumDensityIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2951         outputContainer->Add(fhPtSumDensityIso[icone][ipt]) ;
2952         
2953         snprintf(name, buffersize,"hPtFracPtSum_Cone_%d_Pt%d",icone,ipt);
2954         snprintf(title, buffersize,"Isolated candidate #it{p}_{T} distribution for PtFracPtSum in #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
2955         fhPtFracPtSumIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
2956         //fhPtSumIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2957         fhPtFracPtSumIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2958         outputContainer->Add(fhPtFracPtSumIso[icone][ipt]) ;
2959         
2960         // pt decays isolated
2961         snprintf(name, buffersize,"hPtThres_Decay_Cone_%d_Pt%d",icone,ipt);
2962         snprintf(title, buffersize,"Isolated decay candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{th} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtThresholds[ipt]);
2963         fhPtPtThresDecayIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
2964         fhPtPtThresDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2965         outputContainer->Add(fhPtPtThresDecayIso[icone][ipt]) ;
2966         
2967         snprintf(name, buffersize,"hPtFrac_Decay_Cone_%d_Pt%d",icone,ipt);
2968         snprintf(title, buffersize,"Isolated decay candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
2969         fhPtPtFracDecayIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
2970         fhPtPtFracDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2971         outputContainer->Add(fhPtPtFracDecayIso[icone][ipt]) ;
2972         
2973         snprintf(name, buffersize,"hPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
2974         snprintf(title, buffersize,"Isolated decay candidate #it{p}_{T} distribution for #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
2975         fhPtPtSumDecayIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
2976         //  fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2977         fhPtPtSumDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2978         outputContainer->Add(fhPtPtSumDecayIso[icone][ipt]) ;
2979         
2980         snprintf(name, buffersize,"hPtSumDensity_Decay_Cone_%d_Pt%d",icone,ipt);
2981         snprintf(title, buffersize,"Isolated decay candidate #it{p}_{T} distribution for density in #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
2982         fhPtSumDensityDecayIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
2983         //  fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2984         fhPtSumDensityDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2985         outputContainer->Add(fhPtSumDensityDecayIso[icone][ipt]) ;
2986         
2987         snprintf(name, buffersize,"hPtFracPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
2988         snprintf(title, buffersize,"Isolated decay candidate #it{p}_{T} distribution for PtFracPtSum in #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
2989         fhPtFracPtSumDecayIso[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
2990         //  fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
2991         fhPtFracPtSumDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2992         outputContainer->Add(fhPtFracPtSumDecayIso[icone][ipt]) ;
2993         
2994         
2995         // eta:phi
2996         snprintf(name, buffersize,"hEtaPhiPtThres_Cone_%d_Pt%d",icone,ipt);
2997         snprintf(title, buffersize,"Isolated candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{th} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtThresholds[ipt]);
2998         fhEtaPhiPtThresIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
2999         fhEtaPhiPtThresIso[icone][ipt]->SetXTitle("#eta");
3000         fhEtaPhiPtThresIso[icone][ipt]->SetYTitle("#phi");
3001         outputContainer->Add(fhEtaPhiPtThresIso[icone][ipt]) ;
3002         
3003         snprintf(name, buffersize,"hEtaPhiPtFrac_Cone_%d_Pt%d",icone,ipt);
3004         snprintf(title, buffersize,"Isolated candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
3005         fhEtaPhiPtFracIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3006         fhEtaPhiPtFracIso[icone][ipt]->SetXTitle("#eta");
3007         fhEtaPhiPtFracIso[icone][ipt]->SetYTitle("#phi");
3008         outputContainer->Add(fhEtaPhiPtFracIso[icone][ipt]) ;
3009         
3010         snprintf(name, buffersize,"hEtaPhiPtSum_Cone_%d_Pt%d",icone,ipt);
3011         snprintf(title, buffersize,"Isolated candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
3012         fhEtaPhiPtSumIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3013         fhEtaPhiPtSumIso[icone][ipt]->SetXTitle("#eta");
3014         fhEtaPhiPtSumIso[icone][ipt]->SetYTitle("#phi");
3015         outputContainer->Add(fhEtaPhiPtSumIso[icone][ipt]) ;
3016         
3017         snprintf(name, buffersize,"hEtaPhiSumDensity_Cone_%d_Pt%d",icone,ipt);
3018         snprintf(title, buffersize,"Isolated candidate #eta:#phi distribution for density #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
3019         fhEtaPhiSumDensityIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3020         fhEtaPhiSumDensityIso[icone][ipt]->SetXTitle("#eta");
3021         fhEtaPhiSumDensityIso[icone][ipt]->SetYTitle("#phi");
3022         outputContainer->Add(fhEtaPhiSumDensityIso[icone][ipt]) ;
3023         
3024         snprintf(name, buffersize,"hEtaPhiFracPtSum_Cone_%d_Pt%d",icone,ipt);
3025         snprintf(title, buffersize,"Isolated candidate #eta:#phi distribution for FracPtSum #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
3026         fhEtaPhiFracPtSumIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3027         fhEtaPhiFracPtSumIso[icone][ipt]->SetXTitle("#eta");
3028         fhEtaPhiFracPtSumIso[icone][ipt]->SetYTitle("#phi");
3029         outputContainer->Add(fhEtaPhiFracPtSumIso[icone][ipt]) ;
3030         
3031         // eta:phi decays
3032         snprintf(name, buffersize,"hEtaPhiPtThres_Decay_Cone_%d_Pt%d",icone,ipt);
3033         snprintf(title, buffersize,"Isolated decay candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{th} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtThresholds[ipt]);
3034         fhEtaPhiPtThresDecayIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3035         fhEtaPhiPtThresDecayIso[icone][ipt]->SetXTitle("#eta");
3036         fhEtaPhiPtThresDecayIso[icone][ipt]->SetYTitle("#phi");
3037         outputContainer->Add(fhEtaPhiPtThresDecayIso[icone][ipt]) ;
3038         
3039         snprintf(name, buffersize,"hEtaPhiPtFrac_Decay_Cone_%d_Pt%d",icone,ipt);
3040         snprintf(title, buffersize,"Isolated decay candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
3041         fhEtaPhiPtFracDecayIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3042         fhEtaPhiPtFracDecayIso[icone][ipt]->SetXTitle("#eta");
3043         fhEtaPhiPtFracDecayIso[icone][ipt]->SetYTitle("#phi");
3044         outputContainer->Add(fhEtaPhiPtFracDecayIso[icone][ipt]) ;
3045         
3046         
3047         snprintf(name, buffersize,"hEtaPhiPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
3048         snprintf(title, buffersize,"Isolated decay candidate #eta:#phi distribution for #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
3049         fhEtaPhiPtSumDecayIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3050         fhEtaPhiPtSumDecayIso[icone][ipt]->SetXTitle("#eta");
3051         fhEtaPhiPtSumDecayIso[icone][ipt]->SetYTitle("#phi");
3052         outputContainer->Add(fhEtaPhiPtSumDecayIso[icone][ipt]) ;
3053         
3054         snprintf(name, buffersize,"hEtaPhiSumDensity_Decay_Cone_%d_Pt%d",icone,ipt);
3055         snprintf(title, buffersize,"Isolated decay candidate #eta:#phi distribution for density #it{R} =  %2.2f and #it{p}_{T}^{sum} = %2.2f GeV/#it{c}",fConeSizes[icone],fSumPtThresholds[ipt]);
3056         fhEtaPhiSumDensityDecayIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3057         fhEtaPhiSumDensityDecayIso[icone][ipt]->SetXTitle("#eta");
3058         fhEtaPhiSumDensityDecayIso[icone][ipt]->SetYTitle("#phi");
3059         outputContainer->Add(fhEtaPhiSumDensityDecayIso[icone][ipt]) ;
3060         
3061         snprintf(name, buffersize,"hEtaPhiFracPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
3062         snprintf(title, buffersize,"Isolated decay candidate #eta:#phi distribution for FracPtSum #it{R} =  %2.2f and #it{p}_{T}^{fr} = %2.2f GeV/#it{c}",fConeSizes[icone],fPtFractions[ipt]);
3063         fhEtaPhiFracPtSumDecayIso[icone][ipt]  = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
3064         fhEtaPhiFracPtSumDecayIso[icone][ipt]->SetXTitle("#eta");
3065         fhEtaPhiFracPtSumDecayIso[icone][ipt]->SetYTitle("#phi");
3066         outputContainer->Add(fhEtaPhiFracPtSumDecayIso[icone][ipt]) ;
3067         
3068         
3069         if(IsDataMC())
3070         {
3071           snprintf(name, buffersize,"hPtThresMCPrompt_Cone_%d_Pt%d",icone,ipt);
3072           snprintf(title, buffersize,"Isolated candidate Prompt #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3073           fhPtThresIsolatedPrompt[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3074           fhPtThresIsolatedPrompt[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3075           outputContainer->Add(fhPtThresIsolatedPrompt[icone][ipt]) ; 
3076           
3077           snprintf(name, buffersize,"hPtFracMCPrompt_Cone_%d_Pt%d",icone,ipt);
3078           snprintf(title, buffersize,"Isolated candidate Prompt #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3079           fhPtFracIsolatedPrompt[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3080           fhPtFracIsolatedPrompt[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3081           outputContainer->Add(fhPtFracIsolatedPrompt[icone][ipt]) ; 
3082           
3083           snprintf(name, buffersize,"hPtThresMCFragmentation_Cone_%d_Pt%d",icone,ipt);
3084           snprintf(title, buffersize,"Isolated candidate Fragmentation #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3085           fhPtThresIsolatedFragmentation[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3086           fhPtThresIsolatedFragmentation[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3087           outputContainer->Add(fhPtThresIsolatedFragmentation[icone][ipt]) ; 
3088           
3089           snprintf(name, buffersize,"hPtFracMCFragmentation_Cone_%d_Pt%d",icone,ipt);
3090           snprintf(title, buffersize,"Isolated candidate Fragmentation #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3091           fhPtFracIsolatedFragmentation[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3092           fhPtFracIsolatedFragmentation[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3093           outputContainer->Add(fhPtFracIsolatedFragmentation[icone][ipt]) ; 
3094           
3095           snprintf(name, buffersize,"hPtThresMCPi0_Cone_%d_Pt%d",icone,ipt);
3096           snprintf(title, buffersize,"Isolated candidate Pi0 #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3097           fhPtThresIsolatedPi0[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3098           fhPtThresIsolatedPi0[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3099           outputContainer->Add(fhPtThresIsolatedPi0[icone][ipt]) ; 
3100           
3101           snprintf(name, buffersize,"hPtFracMCPi0_Cone_%d_Pt%d",icone,ipt);
3102           snprintf(title, buffersize,"Isolated candidate Pi0 #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3103           fhPtFracIsolatedPi0[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3104           fhPtFracIsolatedPi0[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3105           outputContainer->Add(fhPtFracIsolatedPi0[icone][ipt]) ;
3106           
3107           snprintf(name, buffersize,"hPtThresMCPi0Decay_Cone_%d_Pt%d",icone,ipt);
3108           snprintf(title, buffersize,"Isolated candidate Pi0Decay #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3109           fhPtThresIsolatedPi0Decay[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3110           fhPtThresIsolatedPi0Decay[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3111           outputContainer->Add(fhPtThresIsolatedPi0Decay[icone][ipt]) ; 
3112           
3113           snprintf(name, buffersize,"hPtFracMCPi0Decay_Cone_%d_Pt%d",icone,ipt);
3114           snprintf(title, buffersize,"Isolated candidate Pi0Decay #it{p}_{T} distribution for cone size %d and #it{p}_{T}^{th} %d",icone,ipt);
3115           fhPtFracIsolatedPi0Decay[icone][ipt]  = new TH1F(name, title,nptbins,ptmin,ptmax);
3116           fhPtFracIsolatedPi0Decay[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");