AliPhysics  f2694b8 (f2694b8)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliAnaParticleIsolation.cxx
Go to the documentation of this file.
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 // --- ROOT system ---
17 #include <TClonesArray.h>
18 #include <TList.h>
19 #include <TObjString.h>
20 #include <TH2F.h>
21 #include <TClass.h>
22 #include <TH2F.h>
23 #include "TParticle.h"
24 #include "TDatabasePDG.h"
25 
26 // --- Analysis system ---
28 #include "AliCaloTrackReader.h"
29 #include "AliStack.h"
30 #include "AliIsolationCut.h"
31 #include "AliFiducialCut.h"
32 #include "AliMCAnalysisUtils.h"
34 #include "AliAODMCParticle.h"
35 #include "AliAODPWG4ParticleCorrelation.h"
36 #include "AliMCAnalysisUtils.h"
37 #include "AliVTrack.h"
38 #include "AliVCluster.h"
39 #include "AliESDEvent.h"
40 #include "AliAODEvent.h"
41 
42 // --- Detectors ---
43 #include "AliEMCALGeometry.h"
44 #include "AliPHOSGeoUtils.h"
45 
49 
50 //__________________________________________________
52 //__________________________________________________
55 fIsoDetector(-1), fIsoDetectorString(""),
56 fReMakeIC(0), fMakeSeveralIC(0),
57 fFillTMHisto(0), fFillSSHisto(1), fFillEMCALRegionSSHistograms(0),
58 fFillUEBandSubtractHistograms(1), fFillCellHistograms(0),
59 fFillOverlapHistograms(0),
60 fFillTaggedDecayHistograms(0), fNDecayBits(0),
61 fDecayBits(), fDecayTagsM02Cut(0),
62 fFillNLMHistograms(0),
63 fLeadingOnly(0), fCheckLeadingWithNeutralClusters(0),
64 fSelectPrimariesInCone(0), fMakePrimaryPi0DecayStudy(0),
65 fFillBackgroundBinHistograms(0), fNBkgBin(0),
66 fFillPtTrigBinHistograms(0), fNPtTrigBin(0),
67 fMinCellsAngleOverlap(0),
68 // Several IC
69 fNCones(0), fNPtThresFrac(0),
70 fConeSizes(), fPtThresholds(),
71 fPtFractions(), fSumPtThresholds(),
72 fMomentum(), fMomIso(),
73 fMomDaugh1(), fMomDaugh2(),
74 fTrackVector(), fProdVertex(),
75 fCluster(0), fClustersArr(0),
76 // Histograms
77 fhEIso(0), fhPtIso(0),
78 fhPtCentralityIso(0), fhPtEventPlaneIso(0),
79 fhPtNLocMaxIso(0),
80 fhPhiIso(0), fhEtaIso(0), fhEtaPhiIso(0),
81 fhEtaPhiNoIso(0),
82 fhENoIso(0), fhPtNoIso(0), fhPtNLocMaxNoIso(0),
83 fhPtInCone(0),
84 fhPtClusterInCone(0), fhPtCellInCone(0), fhPtTrackInCone(0),
85 fhPtTrackInConeOtherBC(0), fhPtTrackInConeOtherBCPileUpSPD(0),
86 fhPtTrackInConeBC0(0), fhPtTrackInConeVtxBC0(0),
87 fhPtTrackInConeBC0PileUpSPD(0),
88 fhPtInConePileUp(), fhPtInConeCent(0),
89 fhPerpConeSumPt(0), fhPtInPerpCone(0),
90 fhEtaPhiInConeCluster(0), fhEtaPhiCluster(0),
91 fhEtaPhiInConeTrack(0), fhEtaPhiTrack(0),
92 fhEtaBandCluster(0), fhPhiBandCluster(0),
93 fhEtaBandTrack(0), fhPhiBandTrack(0),
94 fhEtaBandCell(0), fhPhiBandCell(0),
95 fhConePtLead(0), fhConePtLeadCluster(0), fhConePtLeadTrack(0),
96 fhConePtLeadClustervsTrack(0), fhConePtLeadClusterTrackFrac(0),
97 fhConeSumPt(0), fhConeSumPtCellTrack(0),
98 fhConeSumPtCell(0), fhConeSumPtCluster(0), fhConeSumPtTrack(0),
99 fhConeSumPtEtaBandUECluster(0), fhConeSumPtPhiBandUECluster(0),
100 fhConeSumPtEtaBandUETrack(0), fhConeSumPtPhiBandUETrack(0),
101 fhConeSumPtEtaBandUECell(0), fhConeSumPtPhiBandUECell(0),
102 fhConeSumPtTrigEtaPhi(0),
103 fhConeSumPtCellTrackTrigEtaPhi(0),
104 fhConeSumPtEtaBandUEClusterTrigEtaPhi(0), fhConeSumPtPhiBandUEClusterTrigEtaPhi(0),
105 fhConeSumPtEtaBandUETrackTrigEtaPhi(0), fhConeSumPtPhiBandUETrackTrigEtaPhi(0),
106 fhConeSumPtEtaBandUECellTrigEtaPhi(0), fhConeSumPtPhiBandUECellTrigEtaPhi(0),
107 fhConeSumPtEtaUESub(0), fhConeSumPtPhiUESub(0),
108 fhConeSumPtEtaUESubTrigEtaPhi(0), fhConeSumPtPhiUESubTrigEtaPhi(0),
109 fhConeSumPtEtaUESubTrackCell(0), fhConeSumPtPhiUESubTrackCell(0),
110 fhConeSumPtEtaUESubTrackCellTrigEtaPhi(0), fhConeSumPtPhiUESubTrackCellTrigEtaPhi(0),
111 fhConeSumPtEtaUESubCluster(0), fhConeSumPtPhiUESubCluster(0),
112 fhConeSumPtEtaUESubClusterTrigEtaPhi(0), fhConeSumPtPhiUESubClusterTrigEtaPhi(0),
113 fhConeSumPtEtaUESubCell(0), fhConeSumPtPhiUESubCell(0),
114 fhConeSumPtEtaUESubCellTrigEtaPhi(0), fhConeSumPtPhiUESubCellTrigEtaPhi(0),
115 fhConeSumPtEtaUESubTrack(0), fhConeSumPtPhiUESubTrack(0),
116 fhConeSumPtEtaUESubTrackTrigEtaPhi(0), fhConeSumPtPhiUESubTrackTrigEtaPhi(0),
117 fhFractionTrackOutConeEta(0), fhFractionTrackOutConeEtaTrigEtaPhi(0),
118 fhFractionClusterOutConeEta(0), fhFractionClusterOutConeEtaTrigEtaPhi(0),
119 fhFractionClusterOutConePhi(0), fhFractionClusterOutConePhiTrigEtaPhi(0),
120 fhFractionCellOutConeEta(0), fhFractionCellOutConeEtaTrigEtaPhi(0),
121 fhFractionCellOutConePhi(0), fhFractionCellOutConePhiTrigEtaPhi(0),
122 fhConeSumPtClustervsTrack(0), fhConeSumPtClusterTrackFrac(0),
123 fhConeSumPtEtaUESubClustervsTrack(0), fhConeSumPtPhiUESubClustervsTrack(0),
124 fhConeSumPtCellvsTrack(0),
125 fhConeSumPtEtaUESubCellvsTrack(0), fhConeSumPtPhiUESubCellvsTrack(0),
126 fhEtaBandClustervsTrack(0), fhPhiBandClustervsTrack(0),
127 fhEtaBandNormClustervsTrack(0), fhPhiBandNormClustervsTrack(0),
128 fhEtaBandCellvsTrack(0), fhPhiBandCellvsTrack(0),
129 fhEtaBandNormCellvsTrack(0), fhPhiBandNormCellvsTrack(0),
130 fhConeSumPtSubvsConeSumPtTotPhiTrack(0), fhConeSumPtSubNormvsConeSumPtTotPhiTrack(0),
131 fhConeSumPtSubvsConeSumPtTotEtaTrack(0), fhConeSumPtSubNormvsConeSumPtTotEtaTrack(0),
132 fhConeSumPtSubvsConeSumPtTotPhiCluster(0), fhConeSumPtSubNormvsConeSumPtTotPhiCluster(0),
133 fhConeSumPtSubvsConeSumPtTotEtaCluster(0), fhConeSumPtSubNormvsConeSumPtTotEtaCluster(0),
134 fhConeSumPtSubvsConeSumPtTotPhiCell(0), fhConeSumPtSubNormvsConeSumPtTotPhiCell(0),
135 fhConeSumPtSubvsConeSumPtTotEtaCell(0), fhConeSumPtSubNormvsConeSumPtTotEtaCell(0),
136 fhConeSumPtVSUETracksEtaBand(0), fhConeSumPtVSUETracksPhiBand(0),
137 fhConeSumPtVSUEClusterEtaBand(0), fhConeSumPtVSUEClusterPhiBand(0),
138 fhPtPrimMCPi0DecayPairOutOfCone(0),
139 fhPtPrimMCPi0DecayPairOutOfAcceptance(0),
140 fhPtPrimMCPi0DecayPairOutOfAcceptanceNoOverlap(0),
141 fhPtPrimMCPi0DecayPairAcceptInConeLowPt(0),
142 fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlap(0),
143 fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlapCaloE(0),
144 fhPtPrimMCPi0DecayPairNoOverlap(0),
145 fhPtPrimMCPi0DecayIsoPairOutOfCone(0),
146 fhPtPrimMCPi0DecayIsoPairOutOfAcceptance(0),
147 fhPtPrimMCPi0DecayIsoPairOutOfAcceptanceNoOverlap(0),
148 fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPt(0),
149 fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlap(0),
150 fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlapCaloE(0),
151 fhPtPrimMCPi0DecayIsoPairNoOverlap(0),
152 fhPtPrimMCPi0Overlap(0), fhPtPrimMCPi0IsoOverlap(0),
153 fhPtPrimMCEtaDecayPairOutOfCone(0),
154 fhPtPrimMCEtaDecayPairOutOfAcceptance(0),
155 fhPtPrimMCEtaDecayPairOutOfAcceptanceNoOverlap(0),
156 fhPtPrimMCEtaDecayPairAcceptInConeLowPt(0),
157 fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlap(0),
158 fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlapCaloE(0),
159 fhPtPrimMCEtaDecayPairNoOverlap(0),
160 fhPtPrimMCEtaDecayIsoPairOutOfCone(0),
161 fhPtPrimMCEtaDecayIsoPairOutOfAcceptance(0),
162 fhPtPrimMCEtaDecayIsoPairOutOfAcceptanceNoOverlap(0),
163 fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPt(0),
164 fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlap(0),
165 fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlapCaloE(0),
166 fhPtPrimMCEtaDecayIsoPairNoOverlap(0),
167 fhPtPrimMCEtaOverlap(0), fhPtPrimMCEtaIsoOverlap(0),
168 fhPtLeadConeBin(0), fhSumPtConeBin(0),
169 fhPtLeadConeBinMC(0), fhSumPtConeBinMC(0),
170 fhPtLeadConeBinDecay(0), fhSumPtConeBinDecay(0),
171 fhPtLeadConeBinLambda0(0), fhSumPtConeBinLambda0(0),
172 fhPtLeadConeBinLambda0MC(0), fhSumPtConeBinLambda0MC(0),
173 fhPtTrigBinPtLeadCone(0), fhPtTrigBinSumPtCone(0),
174 fhPtTrigBinPtLeadConeMC(0), fhPtTrigBinSumPtConeMC(0),
175 fhPtTrigBinPtLeadConeDecay(0), fhPtTrigBinSumPtConeDecay(0),
176 fhPtTrigBinLambda0vsPtLeadCone(0), fhPtTrigBinLambda0vsSumPtCone(0),
177 fhPtTrigBinLambda0vsPtLeadConeMC(0), fhPtTrigBinLambda0vsSumPtConeMC(0),
178 // Number of local maxima in cluster
179 fhNLocMax(),
180 fhELambda0LocMax1(), fhELambda1LocMax1(),
181 fhELambda0LocMax2(), fhELambda1LocMax2(),
182 fhELambda0LocMaxN(), fhELambda1LocMaxN(),
183 // PileUp
184 fhEIsoPileUp(), fhPtIsoPileUp(),
185 fhENoIsoPileUp(), fhPtNoIsoPileUp(),
186 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
187 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
188 fhTimeNPileUpVertContributors(0),
189 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0)
190 {
191  InitParameters();
192 
193  for(Int_t i = 0; i < 5 ; i++)
194  {
195  fConeSizes[i] = 0 ;
196 
197  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
198  fhSumPtLeadingPtMC[imc][i] = 0 ;
199 
200  for(Int_t j = 0; j < 5 ; j++)
201  {
202  fhPtThresIsolated [i][j] = 0 ;
203  fhPtFracIsolated [i][j] = 0 ;
204  fhSumPtIsolated [i][j] = 0 ;
205 
206  fhEtaPhiPtThresIso [i][j] = 0 ;
207  fhEtaPhiPtThresDecayIso [i][j] = 0 ;
208  fhPtPtThresDecayIso [i][j] = 0 ;
209 
210  fhEtaPhiPtFracIso [i][j] = 0 ;
211  fhEtaPhiPtFracDecayIso [i][j] = 0 ;
212  fhPtPtFracDecayIso [i][j] = 0 ;
213  fhPtPtSumDecayIso [i][j] = 0 ;
214  fhPtSumDensityIso [i][j] = 0 ;
215  fhPtSumDensityDecayIso [i][j] = 0 ;
216  fhEtaPhiSumDensityIso [i][j] = 0 ;
217  fhEtaPhiSumDensityDecayIso [i][j] = 0 ;
218  fhPtFracPtSumIso [i][j] = 0 ;
219  fhPtFracPtSumDecayIso [i][j] = 0 ;
220  fhEtaPhiFracPtSumIso [i][j] = 0 ;
221  fhEtaPhiFracPtSumDecayIso [i][j] = 0 ;
222 
223  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
224  {
225  fhPtThresIsolatedMC[imc][i][j] = 0 ;
226  fhPtFracIsolatedMC [imc][i][j] = 0 ;
227  fhSumPtIsolatedMC [imc][i][j] = 0 ;
228 
229  }
230  }
231  }
232 
233  for(Int_t ibit =0; ibit < AliNeutralMesonSelection::fgkMaxNDecayBits; ibit++)
234  {
235  for(Int_t iso =0; iso < 2; iso++)
236  {
237  fhPtDecay [iso][ibit] = 0;
238  fhEtaPhiDecay [iso][ibit] = 0;
239  fhPtLambda0Decay[iso][ibit] = 0;
240  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
241  fhPtDecayMC[iso][ibit][imc] = 0;
242  }
243  }
244 
245  for(Int_t i = 0; i < 5 ; i++)
246  {
247  fPtFractions [i] = 0 ;
248  fPtThresholds [i] = 0 ;
249  fSumPtThresholds[i] = 0 ;
250 
251  fhSumPtLeadingPt [i] = 0 ;
252  fhPtLeadingPt [i] = 0 ;
253  fhPerpSumPtLeadingPt[i] = 0 ;
254  fhPerpPtLeadingPt [i] = 0 ;
255  }
256 
257  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
258  {
259  fhPtNoIsoMC [imc] = 0;
260  fhPtIsoMC [imc] = 0;
261  fhPhiIsoMC [imc] = 0;
262  fhEtaIsoMC [imc] = 0;
263 
264  for(Int_t i = 0; i < 2 ; i++)
265  {
266  fhPtLambda0MC [imc][i] = 0;
267  fhPtLambda0MCConv [imc][i] = 0;
268  fhPtLambda0MCWith1Overlap [imc][i] = 0;
269  fhPtLambda0MCConvWith1Overlap[imc][i] = 0;
270  fhPtLambda0MCWithNOverlap [imc][i] = 0;
271  fhPtLambda0MCConvWithNOverlap[imc][i] = 0;
272  fhPtNOverlap [imc][i] = 0;
273  fhPtNOverlapConv [imc][i] = 0;
274  fhTrackMatchedDEtaMC [imc][i] = 0 ;
275  fhTrackMatchedDPhiMC [imc][i] = 0 ;
276  fhTrackMatchedDEtaDPhiMC [imc][i] = 0 ;
277  }
278  }
279 
280  for(Int_t i = 0; i < 2 ; i++)
281  {
283  fhdEdx [i] = 0 ; fhEOverP [i] = 0 ; fhTrackMatchedMCParticle[i] = 0 ;
284  fhELambda0 [i] = 0 ; fhPtLambda0 [i] = 0 ; //fhELambda1 [i] = 0 ;
285  fhELambda0TRD [i] = 0 ; fhPtLambda0TRD [i] = 0 ; //fhELambda1TRD [i] = 0 ;
286 
287  // Number of local maxima in cluster
288  fhNLocMax [i] = 0 ;
289  fhELambda0LocMax1[i] = 0 ; fhELambda1LocMax1[i] = 0 ;
290  fhELambda0LocMax2[i] = 0 ; fhELambda1LocMax2[i] = 0 ;
291  fhELambda0LocMaxN[i] = 0 ; fhELambda1LocMaxN[i] = 0 ;
292 
294  for(Int_t iR = 0; iR < 6; iR++) fhMCConversionLambda0RcutTRD[iR][i] = 0;
295 
296  for(Int_t ieta = 0; ieta < 4; ieta++)
297  {
298  for(Int_t iphi = 0; iphi < 3; iphi++)
299  {
300 // fhLam0EMCALRegion [i][ieta][iphi] = 0;
301 // fhLam0EMCALRegionTRD[i][ieta][iphi] = 0;
302 //
303 // for(Int_t ireg = 0; ireg < 6; ireg++)
304 // {
305 // fhLam0EMCALRegionMCConvRcut [i][ieta][iphi][ireg] = 0;
306 // fhLam0EMCALRegionTRDMCConvRcut[i][ieta][iphi][ireg] = 0;
307 // }
308 
309  for(Int_t ism =0; ism < 20; ism++)
310  {
311  fhLam0EMCALRegionPerSM[i][ieta][iphi][ism] = 0;
312  }
313  }
314  }
315  for(Int_t j = 0; j < 7; j++) fhEtaPhiLam0BinPtBin[i][j] = 0 ;
316  }
317 
318  // Acceptance
319  for(Int_t i = 0; i < fgkNmcPrimTypes; i++)
320  {
321  fhPtPrimMCiso[i] = 0;
322  fhEPrimMC [i] = 0;
323  fhPtPrimMC [i] = 0;
324  fhEtaPrimMC [i] = 0;
325  fhPhiPrimMC [i] = 0;
326  }
327 
328  // Pile-Up
329 
330  for(Int_t i = 0 ; i < 7 ; i++)
331  {
332  fhPtInConePileUp[i] = 0 ;
333  fhEIsoPileUp [i] = 0 ;
334  fhPtIsoPileUp [i] = 0 ;
335  fhENoIsoPileUp [i] = 0 ;
336  fhPtNoIsoPileUp [i] = 0 ;
337  }
338 }
339 
340 //_______________________________________________________________________________________________
342 //_______________________________________________________________________________________________
343 void AliAnaParticleIsolation::CalculateCaloUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
344  Float_t & etaBandPtSum, Float_t & phiBandPtSum)
345 {
346  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
347 
348  Float_t conesize = GetIsolationCut()->GetConeSize();
349 
350  // Select the Calorimeter
351  TObjArray * pl = 0x0;
352  if (GetCalorimeter() == kPHOS )
353  pl = GetPHOSClusters();
354  else if (GetCalorimeter() == kEMCAL)
355  pl = GetEMCALClusters();
356 
357  if(!pl) return ;
358 
359  // Get vertex for cluster momentum calculation
360  Double_t vertex[] = {0,0,0} ; //vertex ;
361  if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
362  GetReader()->GetVertex(vertex);
363 
364  Float_t ptTrig = pCandidate->Pt() ;
365  Float_t phiTrig = pCandidate->Phi();
366  Float_t etaTrig = pCandidate->Eta();
367 
368  for(Int_t icluster=0; icluster < pl->GetEntriesFast(); icluster++)
369  {
370  AliVCluster* cluster = (AliVCluster *) pl->At(icluster);
371 
372  if ( !cluster )
373  {
374  AliWarning("Cluster not available?");
375  continue;
376  }
377 
378  // Do not count the candidate (photon or pi0) or the daughters of the candidate
379  if(cluster->GetID() == pCandidate->GetCaloLabel(0) ||
380  cluster->GetID() == pCandidate->GetCaloLabel(1) ) continue ;
381 
382  // Remove matched clusters to tracks if Neutral and Track info is used
384  IsTrackMatched(cluster,GetReader()->GetInputEvent())) continue ;
385 
386  cluster->GetMomentum(fMomentum,vertex) ;//Assume that come from vertex in straight line
387 
388  // Exclude particles in cone
389  Float_t rad = GetIsolationCut()->Radius(etaTrig, phiTrig, fMomentum.Eta(), fMomentum.Phi());
390 
391  // Histograms of eta and phi for all clusters
392  fhEtaPhiCluster->Fill(fMomentum.Eta(), fMomentum.Phi(), GetEventWeight());
393  if(rad < conesize)
394  {
395  // Histogrqmw for all clusters in cone
397  continue ;
398  }
399 
400  // Fill histogram for UE in phi band in EMCal acceptance
401  if(fMomentum.Eta() > (etaTrig-conesize) && fMomentum.Eta() < (etaTrig+conesize))
402  {
403  phiBandPtSum+=fMomentum.Pt();
404  fhPhiBandCluster->Fill(fMomentum.Eta(), fMomentum.Phi(), GetEventWeight());
405 
406  }
407 
408  // Fill histogram for UE in eta band in EMCal acceptance
409  if(fMomentum.Phi() > (phiTrig-conesize) && fMomentum.Phi() < (phiTrig+conesize))
410  {
411  etaBandPtSum+=fMomentum.Pt();
412  fhEtaBandCluster->Fill(fMomentum.Eta(), fMomentum.Phi(), GetEventWeight());
413  }
414  }
415 
416  fhConeSumPtEtaBandUECluster ->Fill(ptTrig , etaBandPtSum, GetEventWeight());
417  fhConeSumPtPhiBandUECluster ->Fill(ptTrig , phiBandPtSum, GetEventWeight());
418  fhConeSumPtEtaBandUEClusterTrigEtaPhi->Fill(etaTrig, phiTrig, etaBandPtSum *GetEventWeight()); // Check
419  fhConeSumPtPhiBandUEClusterTrigEtaPhi->Fill(etaTrig, phiTrig, phiBandPtSum *GetEventWeight()); // Check
420 }
421 
422 //________________________________________________________________________________________________
424 //________________________________________________________________________________________________
425 void AliAnaParticleIsolation::CalculateCaloCellUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
426  Float_t & etaBandPtSumCells, Float_t & phiBandPtSumCells)
427 {
428  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
429 
430  Float_t conesize = GetIsolationCut()->GetConeSize();
431 
432  Float_t phiTrig = pCandidate->Phi();
433  if(phiTrig<0) phiTrig += TMath::TwoPi();
434 
435  Float_t etaTrig = pCandidate->Eta();
436 
437  if(pCandidate->GetDetectorTag()==kEMCAL)
438  {
439  AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
440  Int_t absId = -999;
441 
442  if (eGeom->GetAbsCellIdFromEtaPhi(etaTrig,phiTrig,absId))
443  {
444  if(!eGeom->CheckAbsCellId(absId)) return ;
445 
446  // Get absolute (col,row) of trigger particle
447  Int_t nSupMod = eGeom->GetSuperModuleNumber(absId);
448  Int_t nModule = -1;
449  Int_t imEta=-1, imPhi=-1;
450  Int_t ieta =-1, iphi =-1;
451 
452  if (eGeom->GetCellIndex(absId,nSupMod,nModule,imPhi,imEta))
453  {
454  eGeom->GetCellPhiEtaIndexInSModule(nSupMod,nModule,imPhi,imEta,iphi,ieta);
455 
456  Int_t colTrig = ieta;
457  if (nSupMod % 2) colTrig = AliEMCALGeoParams::fgkEMCALCols + ieta ;
458 
459  Int_t rowTrig = iphi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
460 
461  Int_t sqrSize = int(conesize/0.0143);
462 
463  AliVCaloCells * cells = GetEMCALCells();
464 
465  Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 24*(16/3) 5 full-size Sectors (2 SM) + 1 one-third Sector (2 SM)
466  Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols;
467  // printf("nTotalRows %i, nTotalCols %i\n",nTotalRows,nTotalCols);
468  // Loop on cells in eta band
469 
470  Int_t irowmin = rowTrig-sqrSize;
471  if ( irowmin < 0 ) irowmin = 0 ;
472 
473  Int_t irowmax = rowTrig+sqrSize;
474  if ( irowmax > AliEMCALGeoParams::fgkEMCALRows ) irowmax = AliEMCALGeoParams::fgkEMCALRows;
475 
476  for(Int_t irow = irowmin; irow <irowmax; irow++)
477  {
478  for(Int_t icol = 0; icol < nTotalCols; icol++)
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  if(icol < AliEMCALGeoParams::fgkEMCALCols)
485  {
486  inSupMod = 2*inSector + 1;
487  icolLoc = icol;
488  }
489  else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
490  {
491  inSupMod = 2*inSector;
492  icolLoc = icol-AliEMCALGeoParams::fgkEMCALCols;
493  }
494 
495  Int_t irowLoc = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ;
496 
497  // Exclude cells in cone
498  if(TMath::Abs(icol-colTrig) < sqrSize || TMath::Abs(irow-rowTrig) < sqrSize){
499  continue ;
500  }
501 
502  Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
503  if(!eGeom->CheckAbsCellId(iabsId)) continue;
504 
505  etaBandPtSumCells += cells->GetCellAmplitude(iabsId);
506 
507  fhEtaBandCell->Fill(colTrig, rowTrig, GetEventWeight());
508 
509  // printf("ETA inSupMod %i,irowLoc %i,icolLoc %i, iabsId %i, etaBandPtSumCells %f\n",nSupMod,irowLoc,icolLoc,iabsId,etaBandPtSumCells);
510  }
511  }
512 
513  Int_t icolmin = colTrig-sqrSize;
514  if ( icolmin < 0 ) icolmin = 0;
515 
516  Int_t icolmax = colTrig+sqrSize;
517  if ( icolmax > AliEMCALGeoParams::fgkEMCALCols ) icolmax = AliEMCALGeoParams::fgkEMCALCols;
518 
519  // Loop on cells in phi band
520  for(Int_t icol = icolmin; icol < icolmax; icol++)
521  {
522  for(Int_t irow = 0; irow < nTotalRows; irow++)
523  {
524  Int_t inSector = int(irow/AliEMCALGeoParams::fgkEMCALRows);
525  if ( inSector == 5 ) continue ;
526 
527  Int_t inSupMod = -1;
528  Int_t icolLoc = -1;
529  // printf("icol %i, irow %i, inSector %i\n",icol,irow ,inSector);
530 
531  if(icol < AliEMCALGeoParams::fgkEMCALCols)
532  {
533  // printf("icol < AliEMCALGeoParams::fgkEMCALCols %i\n",AliEMCALGeoParams::fgkEMCALCols );
534  inSupMod = 2*inSector + 1;
535  icolLoc = icol;
536  }
537  else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
538  {
539  // printf("icol > AliEMCALGeoParams::fgkEMCALCols -1 %i\n",AliEMCALGeoParams::fgkEMCALCols -1 );
540  inSupMod = 2*inSector;
541  icolLoc = icol-AliEMCALGeoParams::fgkEMCALCols;
542  }
543 
544  Int_t irowLoc = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ; // Stesso problema di sopra //
545 
546  // Exclude cells in cone
547  if(TMath::Abs(icol-colTrig) < sqrSize) {
548  //printf("TMath::Abs(icol-colTrig) %i < sqrSize %i\n",TMath::Abs(icol-colTrig) ,sqrSize);continue ;
549  }
550  if(TMath::Abs(irow-rowTrig) < sqrSize) {
551  //printf("TMath::Abs(irow-rowTrig) %i < sqrSize %i\n",TMath::Abs(irow-rowTrig) ,sqrSize);continue ;
552  }
553 
554  Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
555  if(!eGeom->CheckAbsCellId(iabsId))
556  {
557  AliWarning(Form("!eGeom->CheckAbsCellId(iabsId=%i) inSupMod %i irowLoc %i icolLoc %i",iabsId,inSupMod, irowLoc, icolLoc));
558  continue;
559  }
560 
561  phiBandPtSumCells += cells->GetCellAmplitude(iabsId);
562 
563  fhPhiBandCell->Fill(colTrig, rowTrig, GetEventWeight());
564  //printf("inSupMod %i,irowLoc %i,icolLoc %i, iabsId %i, phiBandPtSumCells %f\n",nSupMod,irowLoc,icolLoc,iabsId,phiBandPtSumCells);
565  }
566  }
567  }
568  }
569  }
570 
571  Float_t ptTrig = pCandidate->Pt();
572 
573  fhConeSumPtEtaBandUECell ->Fill(ptTrig , etaBandPtSumCells, GetEventWeight());
574  fhConeSumPtPhiBandUECell ->Fill(ptTrig , phiBandPtSumCells, GetEventWeight());
575  fhConeSumPtEtaBandUECellTrigEtaPhi->Fill(etaTrig, phiTrig, etaBandPtSumCells *GetEventWeight()); // Check
576  fhConeSumPtPhiBandUECellTrigEtaPhi->Fill(etaTrig, phiTrig, phiBandPtSumCells *GetEventWeight()); // Check
577 }
578 
579 //________________________________________________________________________________________________
581 //________________________________________________________________________________________________
582 void AliAnaParticleIsolation::CalculateTrackUEBand(AliAODPWG4ParticleCorrelation * pCandidate,
583  Float_t & etaBandPtSum, Float_t & phiBandPtSum)
584 {
585  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyNeutral ) return ;
586 
587  Float_t conesize = GetIsolationCut()->GetConeSize();
588 
589  Double_t sumptPerp= 0. ;
590  Float_t ptTrig = pCandidate->Pt() ;
591  Float_t phiTrig = pCandidate->Phi();
592  Float_t etaTrig = pCandidate->Eta();
593 
594  TObjArray * trackList = GetCTSTracks() ;
595  for(Int_t itrack=0; itrack < trackList->GetEntriesFast(); itrack++)
596  {
597  AliVTrack* track = (AliVTrack *) trackList->At(itrack);
598 
599  if(!track)
600  {
601  AliWarning("Track not available?");
602  continue;
603  }
604 
605  // Do not count the candidate (pion, conversion photon) or the daughters of the candidate
606  if(track->GetID() == pCandidate->GetTrackLabel(0) || track->GetID() == pCandidate->GetTrackLabel(1) ||
607  track->GetID() == pCandidate->GetTrackLabel(2) || track->GetID() == pCandidate->GetTrackLabel(3) ) continue ;
608 
609  // Histogram of eta:phi for all tracks
610  fhEtaPhiTrack->Fill(track->Eta(), track->Phi(), GetEventWeight());
611 
612  //exclude particles in cone
613  Float_t rad = GetIsolationCut()->Radius(etaTrig, phiTrig, track->Eta(), track->Phi());
614  if(rad < conesize)
615  {
616  // Histogram of eta:phi for all tracks in cone
617  fhEtaPhiInConeTrack->Fill(track->Eta(), track->Phi(), GetEventWeight());
618  continue ;
619  }
620 
621  // Fill histogram for UE in phi band
622  if(track->Eta() > (etaTrig-conesize) && track->Eta() < (etaTrig+conesize))
623  {
624  phiBandPtSum+=track->Pt();
625  fhPhiBandTrack->Fill(track->Eta(), track->Phi(), GetEventWeight());
626  }
627 
628  // Fill histogram for UE in eta band in EMCal acceptance
629  if(track->Phi() > (phiTrig-conesize) && track->Phi() < (phiTrig+conesize))
630  {
631  etaBandPtSum+=track->Pt();
632  fhEtaBandTrack->Fill(track->Eta(), track->Phi(), GetEventWeight());
633  }
634 
635  // Fill the histograms at +-45 degrees in phi from trigger particle, perpedicular to trigger axis in phi
636  Double_t pTrack = TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py());
637  Double_t dPhi = phiTrig - track->Phi() + TMath::PiOver2();
638  Double_t dEta = etaTrig - track->Eta();
639  Double_t arg = dPhi*dPhi + dEta*dEta;
640 
641  if(TMath::Sqrt(arg) < conesize)
642  {
643  fhPtInPerpCone->Fill(ptTrig, pTrack, GetEventWeight());
644  sumptPerp+=track->Pt();
645  }
646 
647  dPhi = phiTrig - track->Phi() - TMath::PiOver2();
648  arg = dPhi*dPhi + dEta*dEta;
649 
650  if(TMath::Sqrt(arg) < conesize)
651  {
652  fhPtInPerpCone->Fill(ptTrig, pTrack, GetEventWeight());
653  sumptPerp+=track->Pt();
654  }
655  }
656 
657  fhPerpConeSumPt ->Fill(ptTrig , sumptPerp , GetEventWeight());
658  fhConeSumPtEtaBandUETrack ->Fill(ptTrig , etaBandPtSum, GetEventWeight());
659  fhConeSumPtPhiBandUETrack ->Fill(ptTrig , phiBandPtSum, GetEventWeight());
660  fhConeSumPtEtaBandUETrackTrigEtaPhi->Fill(etaTrig, phiTrig, etaBandPtSum *GetEventWeight()); // check
661  fhConeSumPtPhiBandUETrackTrigEtaPhi->Fill(etaTrig, phiTrig, phiBandPtSum *GetEventWeight()); // check
662 }
663 
664 //_____________________________________________________________________________________________________________________________________
666 //_____________________________________________________________________________________________________________________________________
667 void AliAnaParticleIsolation::CalculateNormalizeUEBandPerUnitArea(AliAODPWG4ParticleCorrelation * pCandidate, Float_t coneptsumCluster,
668  Float_t coneptsumCell, Float_t coneptsumTrack,
669  Float_t &etaBandptsumTrackNorm, Float_t &etaBandptsumClusterNorm)
670 {
671  Float_t etaUEptsumTrack = 0 ;
672  Float_t phiUEptsumTrack = 0 ;
673  Float_t etaUEptsumCluster = 0 ;
674  Float_t phiUEptsumCluster = 0 ;
675  Float_t etaUEptsumCell = 0 ;
676  Float_t phiUEptsumCell = 0 ;
677 
678  Int_t partTypeInCone = GetIsolationCut()->GetParticleTypeInCone();
679 
680  // Do the normalization
681 
682  Float_t conesize = GetIsolationCut()->GetConeSize();
683  Float_t coneA = conesize*conesize*TMath::Pi(); // A = pi R^2, isolation cone area
684  Float_t ptTrig = pCandidate->Pt() ;
685  Float_t phiTrig = pCandidate->Phi();
686  Float_t etaTrig = pCandidate->Eta();
687 
688 
689  // ------ //
690  // Tracks //
691  // ------ //
692  Float_t phiUEptsumTrackNorm = 0 ;
693  Float_t etaUEptsumTrackNorm = 0 ;
694  Float_t coneptsumTrackSubPhi = 0 ;
695  Float_t coneptsumTrackSubEta = 0 ;
696  Float_t coneptsumTrackSubPhiNorm = 0 ;
697  Float_t coneptsumTrackSubEtaNorm = 0 ;
698  etaBandptsumTrackNorm = 0 ;
699 
700  if ( partTypeInCone != AliIsolationCut::kOnlyNeutral )
701  {
702  // Sum the pT in the phi or eta band for clusters or tracks
703  CalculateTrackUEBand (pCandidate,etaUEptsumTrack ,phiUEptsumTrack );// rajouter ici l'histo eta phi
704 
705  // Fill histograms
706  fhConeSumPtVSUETracksEtaBand->Fill(coneptsumTrack, etaUEptsumTrack, GetEventWeight());
707  fhConeSumPtVSUETracksPhiBand->Fill(coneptsumTrack, phiUEptsumTrack, GetEventWeight());
708 
709 
710  Float_t correctConeSumTrack = 1;
711  Float_t correctConeSumTrackPhi = 1;
712 
714  phiUEptsumTrack,etaUEptsumTrack,
715  phiUEptsumTrackNorm,etaUEptsumTrackNorm,
716  correctConeSumTrack,correctConeSumTrackPhi);
717 
718  coneptsumTrackSubPhi = coneptsumTrack - phiUEptsumTrackNorm;
719  coneptsumTrackSubEta = coneptsumTrack - etaUEptsumTrackNorm;
720 
721  etaBandptsumTrackNorm = etaUEptsumTrackNorm;
722 
723  fhConeSumPtPhiUESubTrack ->Fill(ptTrig , coneptsumTrackSubPhi, GetEventWeight());
724  fhConeSumPtPhiUESubTrackTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumTrackSubPhi *GetEventWeight()); // check
725  fhConeSumPtEtaUESubTrack ->Fill(ptTrig , coneptsumTrackSubEta, GetEventWeight());
726  fhConeSumPtEtaUESubTrackTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumTrackSubEta *GetEventWeight()); // check
727 
728  fhFractionTrackOutConeEta ->Fill(ptTrig , correctConeSumTrack-1, GetEventWeight());
729  fhFractionTrackOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig,correctConeSumTrack-1 *GetEventWeight()); // check
730 
731  if(coneptsumTrack > 0)
732  {
733  coneptsumTrackSubPhiNorm = coneptsumTrackSubPhi/coneptsumTrack;
734  coneptsumTrackSubEtaNorm = coneptsumTrackSubEta/coneptsumTrack;
735  }
736 
737  fhConeSumPtSubvsConeSumPtTotPhiTrack ->Fill(coneptsumTrack, coneptsumTrackSubPhi , GetEventWeight());
738  fhConeSumPtSubNormvsConeSumPtTotPhiTrack->Fill(coneptsumTrack, coneptsumTrackSubPhiNorm, GetEventWeight());
739  fhConeSumPtSubvsConeSumPtTotEtaTrack ->Fill(coneptsumTrack, coneptsumTrackSubEta , GetEventWeight());
740  fhConeSumPtSubNormvsConeSumPtTotEtaTrack->Fill(coneptsumTrack, coneptsumTrackSubEtaNorm, GetEventWeight());
741  }
742 
743  // ------------------------ //
744  // EMCal Clusters and cells //
745  // ------------------------ //
746  Float_t phiUEptsumClusterNorm = 0 ;
747  Float_t etaUEptsumClusterNorm = 0 ;
748  Float_t coneptsumClusterSubPhi = 0 ;
749  Float_t coneptsumClusterSubEta = 0 ;
750  Float_t coneptsumClusterSubPhiNorm = 0 ;
751  Float_t coneptsumClusterSubEtaNorm = 0 ;
752  Float_t phiUEptsumCellNorm = 0 ;
753  Float_t etaUEptsumCellNorm = 0 ;
754  Float_t coneptsumCellSubPhi = 0 ;
755  Float_t coneptsumCellSubEta = 0 ;
756  Float_t coneptsumCellSubPhiNorm = 0 ;
757  Float_t coneptsumCellSubEtaNorm = 0 ;
758  etaBandptsumClusterNorm = 0;
759 
760  if ( partTypeInCone != AliIsolationCut::kOnlyCharged )
761  {
762  // -------------- //
763  // EMCal clusters //
764  // -------------- //
765 
766  // Sum the pT in the phi or eta band for clusters or tracks
767  CalculateCaloUEBand (pCandidate,etaUEptsumCluster,phiUEptsumCluster);// rajouter ici l'histo eta phi
768 
769  // Fill histograms
770  fhConeSumPtVSUEClusterEtaBand->Fill(coneptsumCluster, etaUEptsumCluster, GetEventWeight());
771  fhConeSumPtVSUEClusterPhiBand->Fill(coneptsumCluster, phiUEptsumCluster, GetEventWeight());
772 
773  Float_t correctConeSumClusterEta = 1;
774  Float_t correctConeSumClusterPhi = 1;
775 
777  phiUEptsumCluster,etaUEptsumCluster,
778  phiUEptsumClusterNorm,etaUEptsumClusterNorm,
779  correctConeSumClusterEta,correctConeSumClusterPhi);
780 
781  // In case that cone is out of eta and phi side, we are over correcting, not too often with the current cuts ...
782  // Comment if not used
783  // Float_t coneBadCellsCoeff =1;
784  // Float_t etaBandBadCellsCoeff=1;
785  // Float_t phiBandBadCellsCoeff=1;
786  // GetIsolationCut()->GetCoeffNormBadCell(pCandidate, GetReader(),coneBadCellsCoeff,etaBandBadCellsCoeff,phiBandBadCellsCoeff) ;
787 
788  //coneptsumCluster=coneptsumCluster*coneBadCellsCoeff*correctConeSumClusterEta*correctConeSumClusterPhi;
789 
790  coneptsumClusterSubPhi = coneptsumCluster - phiUEptsumClusterNorm;
791  coneptsumClusterSubEta = coneptsumCluster - etaUEptsumClusterNorm;
792 
793  etaBandptsumClusterNorm = etaUEptsumClusterNorm;
794 
795  fhConeSumPtPhiUESubCluster ->Fill(ptTrig , coneptsumClusterSubPhi, GetEventWeight());
796  fhConeSumPtPhiUESubClusterTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumClusterSubPhi *GetEventWeight()); // check
797  fhConeSumPtEtaUESubCluster ->Fill(ptTrig , coneptsumClusterSubEta, GetEventWeight());
798  fhConeSumPtEtaUESubClusterTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumClusterSubEta *GetEventWeight()); // check
799 
800  fhFractionClusterOutConeEta ->Fill(ptTrig , correctConeSumClusterEta-1, GetEventWeight());
801  fhFractionClusterOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumClusterEta-1 *GetEventWeight()); // check
802  fhFractionClusterOutConePhi ->Fill(ptTrig , correctConeSumClusterPhi-1, GetEventWeight());
803  fhFractionClusterOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumClusterPhi-1 *GetEventWeight()); // check
804 
805  if(coneptsumCluster!=0)
806  {
807  coneptsumClusterSubPhiNorm = coneptsumClusterSubPhi/coneptsumCluster;
808  coneptsumClusterSubEtaNorm = coneptsumClusterSubEta/coneptsumCluster;
809  }
810 
811  fhConeSumPtSubvsConeSumPtTotPhiCluster ->Fill(coneptsumCluster,coneptsumClusterSubPhi , GetEventWeight());
812  fhConeSumPtSubNormvsConeSumPtTotPhiCluster->Fill(coneptsumCluster,coneptsumClusterSubPhiNorm, GetEventWeight());
813  fhConeSumPtSubvsConeSumPtTotEtaCluster ->Fill(coneptsumCluster,coneptsumClusterSubEta , GetEventWeight());
814  fhConeSumPtSubNormvsConeSumPtTotEtaCluster->Fill(coneptsumCluster,coneptsumClusterSubEtaNorm, GetEventWeight());
815 
816  // ----------- //
817  // EMCal Cells //
818  // ----------- //
819 
820  if ( fFillCellHistograms )
821  {
822  // Sum the pT in the phi or eta band for clusters or tracks
823  CalculateCaloCellUEBand(pCandidate,etaUEptsumCell ,phiUEptsumCell );
824 
825  // Move to AliIsolationCut the calculation not the histograms??
826 
827  //Careful here if EMCal limits changed .. 2010 (4 SM) to 2011-12 (10 SM), for the moment consider 100 deg in phi
828  Float_t emcEtaSize = 0.7*2; // TO FIX
829  Float_t emcPhiSize = TMath::DegToRad()*100.; // TO FIX
830 
831  if(((2*conesize*emcPhiSize)-coneA)!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*conesize*emcPhiSize)-coneA));
832  if(((2*conesize*emcEtaSize)-coneA)!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*conesize*emcEtaSize)-coneA));
833 
834  // Need to correct coneptsumCluster by the fraction of the cone out of the calorimeter cut acceptance!
835 
836  Float_t correctConeSumCellEta = 1;
837  if(TMath::Abs(etaTrig)+conesize > emcEtaSize/2.)
838  {
839  Float_t excess = TMath::Abs(etaTrig) + conesize - emcEtaSize/2.;
840  correctConeSumCellEta = GetIsolationCut()->CalculateExcessAreaFraction(excess);
841  //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);
842  // Need to correct phi band surface if part of the cone falls out of track cut acceptance!
843  if(((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta))!=0)phiUEptsumCellNorm = phiUEptsumCell*(coneA / ((2*(conesize-excess)*emcPhiSize)-(coneA-correctConeSumCellEta)));
844  }
845 
846  Float_t correctConeSumCellPhi = 1;
847  //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() );
848  if((phiTrig+conesize > 180*TMath::DegToRad()) ||
849  (phiTrig-conesize < 80*TMath::DegToRad()))
850  {
851  Float_t excess = 0;
852  if( phiTrig+conesize > 180*TMath::DegToRad() ) excess = conesize + phiTrig - 180*TMath::DegToRad() ;
853  else excess = conesize - phiTrig + 80*TMath::DegToRad() ;
854 
855  correctConeSumCellPhi = GetIsolationCut()->CalculateExcessAreaFraction(excess);
856  //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);
857 
858  // Need to correct eta band surface if part of the cone falls out of track cut acceptance!
859  if(((2*(conesize-excess)*emcEtaSize)-(coneA-correctConeSumCellPhi))!=0)etaUEptsumCellNorm = etaUEptsumCell*(coneA / ((2*(conesize-excess)*emcEtaSize)-(coneA-correctConeSumCellPhi)));
860  }
861 
862  // In case that cone is out of eta and phi side, we are over correcting, not too often with the current cuts ...
863  coneptsumCellSubPhi = coneptsumCell*correctConeSumCellEta*correctConeSumCellPhi - phiUEptsumCellNorm;
864  coneptsumCellSubEta = coneptsumCell*correctConeSumCellEta*correctConeSumCellPhi - etaUEptsumCellNorm;
865 
866  fhConeSumPtPhiUESubCell ->Fill(ptTrig , coneptsumCellSubPhi, GetEventWeight());
867  fhConeSumPtPhiUESubCellTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumCellSubPhi *GetEventWeight()); // check
868  fhConeSumPtEtaUESubCell ->Fill(ptTrig , coneptsumCellSubEta, GetEventWeight());
869  fhConeSumPtEtaUESubCellTrigEtaPhi ->Fill(etaTrig, phiTrig, coneptsumCellSubEta *GetEventWeight()); // check
870 
871  fhFractionCellOutConeEta ->Fill(ptTrig , correctConeSumCellEta-1, GetEventWeight());
872  fhFractionCellOutConeEtaTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellEta-1 *GetEventWeight()); // check
873  fhFractionCellOutConePhi ->Fill(ptTrig , correctConeSumCellPhi-1, GetEventWeight());
874  fhFractionCellOutConePhiTrigEtaPhi->Fill(etaTrig, phiTrig, correctConeSumCellPhi-1 *GetEventWeight()); // check
875  if ( coneptsumCell > 0.01 )
876  {
877  coneptsumCellSubPhiNorm = coneptsumCellSubPhi/coneptsumCell;
878  coneptsumCellSubEtaNorm = coneptsumCellSubEta/coneptsumCell;
879  }
880 
881  fhConeSumPtSubvsConeSumPtTotPhiCell ->Fill(coneptsumCell,coneptsumCellSubPhi , GetEventWeight());
882  fhConeSumPtSubNormvsConeSumPtTotPhiCell->Fill(coneptsumCell,coneptsumCellSubPhiNorm, GetEventWeight());
883  fhConeSumPtSubvsConeSumPtTotEtaCell ->Fill(coneptsumCell,coneptsumCellSubEta , GetEventWeight());
884  fhConeSumPtSubNormvsConeSumPtTotEtaCell->Fill(coneptsumCell,coneptsumCellSubEtaNorm, GetEventWeight());
885  }
886  }
887 
888  if ( partTypeInCone == AliIsolationCut::kNeutralAndCharged )
889  {
890  // --------------------------- //
891  // Tracks and clusters in cone //
892  // --------------------------- //
893 
894  Double_t sumPhiUESub = coneptsumClusterSubPhi + coneptsumTrackSubPhi;
895  Double_t sumEtaUESub = coneptsumClusterSubEta + coneptsumTrackSubEta;
896 
897  fhConeSumPtPhiUESub ->Fill(ptTrig , sumPhiUESub, GetEventWeight());
898  fhConeSumPtPhiUESubTrigEtaPhi->Fill(etaTrig, phiTrig, sumPhiUESub *GetEventWeight()); // check
899  fhConeSumPtEtaUESub ->Fill(ptTrig , sumEtaUESub, GetEventWeight());
900  fhConeSumPtEtaUESubTrigEtaPhi->Fill(etaTrig, phiTrig, sumEtaUESub *GetEventWeight()); // check
901 
902  fhEtaBandClustervsTrack ->Fill(etaUEptsumCluster ,etaUEptsumTrack , GetEventWeight());
903  fhPhiBandClustervsTrack ->Fill(phiUEptsumCluster ,phiUEptsumTrack , GetEventWeight());
904  fhEtaBandNormClustervsTrack->Fill(etaUEptsumClusterNorm,etaUEptsumTrackNorm, GetEventWeight());
905  fhPhiBandNormClustervsTrack->Fill(phiUEptsumClusterNorm,phiUEptsumTrackNorm, GetEventWeight());
906 
907  fhConeSumPtEtaUESubClustervsTrack->Fill(coneptsumClusterSubEta, coneptsumTrackSubEta, GetEventWeight());
908  fhConeSumPtPhiUESubClustervsTrack->Fill(coneptsumClusterSubPhi, coneptsumTrackSubPhi, GetEventWeight());
909 
910  // ------------------------ //
911  // Tracks and cells in cone //
912  // ------------------------ //
913 
915  {
916  Double_t sumPhiUESubTrackCell = coneptsumCellSubPhi + coneptsumTrackSubPhi;
917  Double_t sumEtaUESubTrackCell = coneptsumCellSubEta + coneptsumTrackSubEta;
918 
919  fhConeSumPtPhiUESubTrackCell ->Fill(ptTrig , sumPhiUESubTrackCell, GetEventWeight());
920  fhConeSumPtPhiUESubTrackCellTrigEtaPhi->Fill(etaTrig, phiTrig, sumPhiUESubTrackCell *GetEventWeight()); // check
921  fhConeSumPtEtaUESubTrackCell ->Fill(ptTrig , sumEtaUESubTrackCell, GetEventWeight());
922  fhConeSumPtEtaUESubTrackCellTrigEtaPhi->Fill(etaTrig, phiTrig, sumEtaUESubTrackCell *GetEventWeight()); // check
923 
924  fhEtaBandCellvsTrack ->Fill(etaUEptsumCell , etaUEptsumTrack , GetEventWeight());
925  fhPhiBandCellvsTrack ->Fill(phiUEptsumCell , phiUEptsumTrack , GetEventWeight());
926  fhEtaBandNormCellvsTrack->Fill(etaUEptsumCellNorm, etaUEptsumTrackNorm, GetEventWeight());
927  fhPhiBandNormCellvsTrack->Fill(phiUEptsumCellNorm, phiUEptsumTrackNorm, GetEventWeight());
928 
929  fhConeSumPtEtaUESubCellvsTrack->Fill(coneptsumCellSubEta, coneptsumTrackSubEta, GetEventWeight());
930  fhConeSumPtPhiUESubCellvsTrack->Fill(coneptsumCellSubPhi, coneptsumTrackSubPhi, GetEventWeight());
931  }
932  }
933 }
934 
935 //______________________________________________________________________________________________________________
937 //______________________________________________________________________________________________________________
938 void AliAnaParticleIsolation::CalculateCaloSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
939  Float_t & coneptsumCluster, Float_t & coneptLeadCluster)
940 {
941  coneptLeadCluster = 0;
942  coneptsumCluster = 0;
943 
944  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
945 
946  // Recover reference arrays with clusters and tracks
947  TObjArray * refclusters = aodParticle->GetObjArray(GetAODObjArrayName()+"Clusters");
948  if(!refclusters) return ;
949 
950  Float_t ptTrig = aodParticle->Pt();
951 
952  // Get vertex for cluster momentum calculation
953  Double_t vertex[] = {0,0,0} ; //vertex ;
954  if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
955  GetReader()->GetVertex(vertex);
956 
957  Float_t ptcone = 0;
958 
959  for(Int_t icalo=0; icalo < refclusters->GetEntriesFast(); icalo++)
960  {
961  AliVCluster* calo = (AliVCluster *) refclusters->At(icalo);
962  calo->GetMomentum(fMomentum,vertex) ;//Assume that come from vertex in straight line
963  ptcone = fMomentum.Pt();
964 
965  fhPtInCone ->Fill(ptTrig, ptcone, GetEventWeight());
966  fhPtClusterInCone->Fill(ptTrig, ptcone, GetEventWeight());
967 
968  if(IsPileUpAnalysisOn())
969  {
970  if(GetReader()->IsPileUpFromSPD()) fhPtInConePileUp[0]->Fill(ptTrig, ptcone, GetEventWeight());
971  if(GetReader()->IsPileUpFromEMCal()) fhPtInConePileUp[1]->Fill(ptTrig, ptcone, GetEventWeight());
972  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtInConePileUp[2]->Fill(ptTrig, ptcone, GetEventWeight());
973  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtInConePileUp[3]->Fill(ptTrig, ptcone, GetEventWeight());
974  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtInConePileUp[4]->Fill(ptTrig, ptcone, GetEventWeight());
975  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtInConePileUp[5]->Fill(ptTrig, ptcone, GetEventWeight());
976  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtInConePileUp[6]->Fill(ptTrig, ptcone, GetEventWeight());
977  }
978 
980 
981  coneptsumCluster+=ptcone;
982  if(ptcone > coneptLeadCluster) coneptLeadCluster = ptcone;
983  }
984 
985  fhConeSumPtCluster ->Fill(ptTrig, coneptsumCluster , GetEventWeight());
986  fhConePtLeadCluster->Fill(ptTrig, coneptLeadCluster, GetEventWeight());
987 
988  aodParticle->SetNeutralLeadPtInCone(coneptLeadCluster);
989  aodParticle->SetNeutralPtSumInCone(coneptsumCluster);
990 }
991 
992 //______________________________________________________________________________________________________
995 //______________________________________________________________________________________________________
996 void AliAnaParticleIsolation::CalculateCaloCellSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
997  Float_t & coneptsumCell)
998 {
999  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyCharged ) return ;
1000 
1001  Float_t conesize = GetIsolationCut()->GetConeSize();
1002 
1003  Float_t ptTrig = aodParticle->Pt();
1004  Float_t phiTrig = aodParticle->Phi();
1005  if(phiTrig<0) phiTrig += TMath::TwoPi();
1006  Float_t etaTrig = aodParticle->Eta();
1007 
1008  if(aodParticle->GetDetectorTag()==kEMCAL)
1009  {
1010  AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
1011  Int_t absId = -999;
1012 
1013  if (eGeom->GetAbsCellIdFromEtaPhi(etaTrig,phiTrig,absId))
1014  {
1015  if(!eGeom->CheckAbsCellId(absId)) return ;
1016 
1017  // Get absolute (col,row) of trigger particle
1018  Int_t nSupMod = eGeom->GetSuperModuleNumber(absId);
1019  Int_t nModule = -1;
1020  Int_t imEta=-1, imPhi=-1;
1021  Int_t ieta =-1, iphi =-1;
1022 
1023  if (eGeom->GetCellIndex(absId,nSupMod,nModule,imPhi,imEta))
1024  {
1025  Int_t iEta=-1, iPhi=-1;
1026  eGeom->GetCellPhiEtaIndexInSModule(nSupMod,nModule,imPhi,imEta,iphi,ieta);
1027 
1028  Int_t colTrig = iEta;
1029  if (nSupMod % 2) colTrig = AliEMCALGeoParams::fgkEMCALCols + iEta ;
1030  Int_t rowTrig = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
1031 
1032  Int_t sqrSize = int(conesize/0.0143);
1033 
1034  AliVCaloCells * cells = GetEMCALCells();
1035 
1036  // Loop on cells in cone
1037  for(Int_t irow = rowTrig-sqrSize; irow < rowTrig+sqrSize; irow++)
1038  {
1039  for(Int_t icol = colTrig-sqrSize; icol < colTrig+sqrSize; icol++)
1040  {
1041  Int_t inSector = int(irow/AliEMCALGeoParams::fgkEMCALRows);
1042  if(inSector==5) continue;
1043 
1044  Int_t inSupMod = -1;
1045  Int_t icolLoc = -1;
1046  if(icol < AliEMCALGeoParams::fgkEMCALCols)
1047  {
1048  inSupMod = 2*inSector + 1;
1049  icolLoc = icol;
1050  }
1051  else if(icol > AliEMCALGeoParams::fgkEMCALCols - 1)
1052  {
1053  inSupMod = 2*inSector;
1054  icolLoc = icol-AliEMCALGeoParams::fgkEMCALCols;
1055  }
1056 
1057  Int_t irowLoc = irow - AliEMCALGeoParams::fgkEMCALRows*inSector ;
1058 
1059  Int_t iabsId = eGeom->GetAbsCellIdFromCellIndexes(inSupMod,irowLoc,icolLoc);
1060  if(!eGeom->CheckAbsCellId(iabsId)) continue;
1061 
1062  fhPtCellInCone->Fill(ptTrig, cells->GetCellAmplitude(iabsId), GetEventWeight());
1063  coneptsumCell += cells->GetCellAmplitude(iabsId);
1064  }
1065  }
1066  }
1067  }
1068  }
1069 
1070  fhConeSumPtCell->Fill(ptTrig, coneptsumCell, GetEventWeight());
1071 }
1072 
1073 //___________________________________________________________________________________________________________
1075 //___________________________________________________________________________________________________________
1076 void AliAnaParticleIsolation::CalculateTrackSignalInCone(AliAODPWG4ParticleCorrelation * aodParticle,
1077  Float_t & coneptsumTrack, Float_t & coneptLeadTrack)
1078 {
1079  if( GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kOnlyNeutral ) return ;
1080 
1081  // Recover reference arrays with clusters and tracks
1082  TObjArray * reftracks = aodParticle->GetObjArray(GetAODObjArrayName()+"Tracks");
1083  if(!reftracks) return ;
1084 
1085  Float_t ptTrig = aodParticle->Pt();
1086  Double_t bz = GetReader()->GetInputEvent()->GetMagneticField();
1087 
1088  for(Int_t itrack=0; itrack < reftracks->GetEntriesFast(); itrack++)
1089  {
1090  AliVTrack* track = (AliVTrack *) reftracks->At(itrack);
1091  Float_t pTtrack = track->Pt();
1092 
1093  fhPtInCone ->Fill(ptTrig, pTtrack, GetEventWeight());
1094  fhPtTrackInCone->Fill(ptTrig, pTtrack, GetEventWeight());
1095 
1096  if(IsPileUpAnalysisOn())
1097  {
1098  ULong_t status = track->GetStatus();
1099  Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ;
1100  //Double32_t tof = track->GetTOFsignal()*1e-3;
1101  Int_t trackBC = track->GetTOFBunchCrossing(bz);
1102 
1103  if ( okTOF && trackBC!=0 ) fhPtTrackInConeOtherBC->Fill(ptTrig,pTtrack, GetEventWeight());
1104  else if( okTOF && trackBC==0 ) fhPtTrackInConeBC0 ->Fill(ptTrig,pTtrack, GetEventWeight());
1105 
1106  Int_t vtxBC = GetReader()->GetVertexBC();
1107  if(vtxBC == 0 || vtxBC==AliVTrack::kTOFBCNA) fhPtTrackInConeVtxBC0->Fill(ptTrig, pTtrack, GetEventWeight());
1108 
1109  if(GetReader()->IsPileUpFromSPD()) { fhPtInConePileUp[0] ->Fill(ptTrig, pTtrack, GetEventWeight());
1110  if(okTOF && trackBC!=0 ) fhPtTrackInConeOtherBCPileUpSPD->Fill(ptTrig, pTtrack, GetEventWeight());
1111  if(okTOF && trackBC==0 ) fhPtTrackInConeBC0PileUpSPD ->Fill(ptTrig, pTtrack, GetEventWeight()); }
1112  if(GetReader()->IsPileUpFromEMCal()) fhPtInConePileUp[1]->Fill(ptTrig, pTtrack, GetEventWeight());
1113  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtInConePileUp[2]->Fill(ptTrig, pTtrack, GetEventWeight());
1114  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtInConePileUp[3]->Fill(ptTrig, pTtrack, GetEventWeight());
1115  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtInConePileUp[4]->Fill(ptTrig, pTtrack, GetEventWeight());
1116  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtInConePileUp[5]->Fill(ptTrig, pTtrack, GetEventWeight());
1117  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtInConePileUp[6]->Fill(ptTrig, pTtrack, GetEventWeight());
1118  }
1119 
1121 
1122  coneptsumTrack+=pTtrack;
1123  if(pTtrack > coneptLeadTrack) coneptLeadTrack = pTtrack;
1124  }
1125 
1126  fhConeSumPtTrack ->Fill(ptTrig, coneptsumTrack , GetEventWeight());
1127  fhConePtLeadTrack->Fill(ptTrig, coneptLeadTrack, GetEventWeight());
1128 
1129  aodParticle->SetChargedLeadPtInCone(coneptLeadTrack);
1130  aodParticle->SetChargedPtSumInCone(coneptsumTrack);
1131 }
1132 
1133 //_____________________________________________________________________________
1135 //_____________________________________________________________________________
1136 void AliAnaParticleIsolation::FillPileUpHistograms(Float_t energy, Float_t time)//Int_t clusterID)
1137 {
1138 // if ( clusterID < 0 )
1139 // {
1140 // AliWarning(Form("ID of cluster = %d, not possible!", clusterID));
1141 // return;
1142 // }
1143 
1144 // Int_t iclus = -1;
1145 // TObjArray* clusters = 0x0;
1146 // if (GetCalorimeter() == kEMCAL) clusters = GetEMCALClusters();
1147 // else if(GetCalorimeter() == kPHOS ) clusters = GetPHOSClusters();
1148 //
1149 // Float_t energy = 0;
1150 // Float_t time = -1000;
1151 //
1152 // if(clusters)
1153 // {
1154 // AliVCluster *cluster = FindCluster(clusters,clusterID,iclus);
1155 // energy = cluster->E();
1156 // time = cluster->GetTOF()*1e9;
1157 // }
1158 
1159  //printf("E %f, time %f\n",energy,time);
1160  AliVEvent * event = GetReader()->GetInputEvent();
1161 
1162  fhTimeENoCut->Fill(energy, time, GetEventWeight());
1163  if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy, time, GetEventWeight());
1164  if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy, time, GetEventWeight());
1165 
1166  if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
1167 
1168  AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1169  AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1170 
1171  // N pile up vertices
1172  Int_t nVerticesSPD = -1;
1173  Int_t nVerticesTracks = -1;
1174 
1175  if (esdEv)
1176  {
1177  nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
1178  nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
1179 
1180  }//ESD
1181  else if (aodEv)
1182  {
1183  nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
1184  nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
1185  }//AOD
1186 
1187  fhTimeNPileUpVertSPD ->Fill(time, nVerticesSPD , GetEventWeight());
1188  fhTimeNPileUpVertTrack->Fill(time, nVerticesTracks, GetEventWeight());
1189 
1190  //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
1191  // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
1192 
1193  Int_t ncont = -1;
1194  Float_t z1 = -1, z2 = -1;
1195  Float_t diamZ = -1;
1196  for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
1197  {
1198  if (esdEv)
1199  {
1200  const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1201  ncont=pv->GetNContributors();
1202  z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1203  z2 = pv->GetZ();
1204  diamZ = esdEv->GetDiamondZ();
1205  }//ESD
1206  else if (aodEv)
1207  {
1208  AliAODVertex *pv=aodEv->GetVertex(iVert);
1209  if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1210  ncont=pv->GetNContributors();
1211  z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1212  z2=pv->GetZ();
1213  diamZ = aodEv->GetDiamondZ();
1214  }// AOD
1215 
1216  Double_t distZ = TMath::Abs(z2-z1);
1217  diamZ = TMath::Abs(z2-diamZ);
1218 
1219  fhTimeNPileUpVertContributors ->Fill(time, ncont, GetEventWeight());
1220  fhTimePileUpMainVertexZDistance->Fill(time, distZ, GetEventWeight());
1221  fhTimePileUpMainVertexZDiamond ->Fill(time, diamZ, GetEventWeight());
1222 
1223  }// loop
1224 }
1225 
1226 //_____________________________________________________________________________________________________________________
1228 //_____________________________________________________________________________________________________________________
1229 void AliAnaParticleIsolation::FillTrackMatchingShowerShapeControlHistograms(AliAODPWG4ParticleCorrelation *pCandidate,
1230  Float_t coneptsum, Float_t coneleadpt,
1231  Int_t mcIndex)
1232 {
1234 
1235  Int_t clusterID = pCandidate->GetCaloLabel(0) ;
1236  Int_t nMaxima = pCandidate->GetNLM();
1237  Int_t mcTag = pCandidate->GetTag() ;
1238  Bool_t isolated = pCandidate->IsIsolated();
1239 
1240  if ( clusterID < 0 )
1241  {
1242  AliWarning(Form("ID of cluster = %d, not possible!", clusterID));
1243  return;
1244  }
1245 
1246  Float_t m02 = pCandidate->GetM02() ;
1247  Float_t energy = pCandidate->E();
1248  Float_t pt = pCandidate->Pt();
1249  Float_t eta = pCandidate->Eta();
1250  Float_t phi = pCandidate->Phi();
1251  if(phi<0) phi+= TMath::TwoPi();
1252 
1253  // Recover original cluster if requested
1254  //
1256  {
1257  Int_t iclus = -1;
1259  else if(GetCalorimeter() == kPHOS ) fClustersArr = GetPHOSClusters();
1260 
1261  if(!fClustersArr) return;
1262 
1263  fCluster = FindCluster(fClustersArr,clusterID,iclus);
1264  }
1265 
1266  // Candidates tagged as decay in another analysis (AliAnaPi0EbE)
1267  //
1269  {
1270  Int_t decayTag = pCandidate->DecayTag();
1271  if(decayTag < 0) decayTag = 0;
1272 
1273  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
1274  {
1275  if(!GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit])) continue;
1276 
1277  if(fFillSSHisto) fhPtLambda0Decay[isolated][ibit]->Fill(pt, m02, GetEventWeight());
1278 
1279  // In case it was not done on the trigger selection task
1280  // apply here a shower shape cut to select photons
1281  if( m02 > fDecayTagsM02Cut ) continue;
1282 
1283  fhPtDecay [isolated][ibit]->Fill(pt, GetEventWeight());
1284  fhEtaPhiDecay[isolated][ibit]->Fill(eta, phi, GetEventWeight());
1285 
1286  if(IsDataMC())
1287  {
1288  fhPtDecayMC[isolated][ibit][mcIndex]->Fill(pt, GetEventWeight());
1289 
1290  if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton))
1291  fhPtDecayMC[isolated][ibit][kmcPhoton]->Fill(pt, GetEventWeight());
1292 
1293  if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1294  {
1295  if ( mcIndex == kmcPi0Decay ) fhPtDecayMC[isolated][ibit][kmcPi0DecayLostPair]->Fill(pt, GetEventWeight());
1296  else if( mcIndex == kmcEtaDecay ) fhPtDecayMC[isolated][ibit][kmcEtaDecayLostPair]->Fill(pt, GetEventWeight());
1297  }
1298  }
1299  } // bit loop
1300  } // decay histograms
1301 
1302  // Get the max pt leading in cone or the sum of pt in cone
1303  // assign a bin to the candidate, depending on both quantities
1304  // see the shower shape in those bins.
1306  {
1307  // Get the background bin for this cone and trigger
1308  Int_t ptsumBin = -1;
1309  Int_t leadptBin = -1;
1310 
1311  AliDebug(1,Form("pT cand: %2.2f, In cone pT: Sum %2.2f, Lead %2.2f, n bins %d",pt,coneptsum,coneleadpt,fNBkgBin));
1312 
1313  for(Int_t ibin = 0; ibin < fNBkgBin; ibin++)
1314  {
1315  if( coneptsum >= fBkgBinLimit[ibin] && coneptsum < fBkgBinLimit[ibin+1]) ptsumBin = ibin;
1316  if( coneleadpt >= fBkgBinLimit[ibin] && coneleadpt < fBkgBinLimit[ibin+1]) leadptBin = ibin;
1317  }
1318 
1319  // Fill the histograms per bin of pt lead or pt sum
1320 
1321  if ( leadptBin >= 0 )
1322  {
1323  AliDebug(1,Form("\t Lead bin %d [%2.2f,%2.2f]", leadptBin,fBkgBinLimit[leadptBin],fBkgBinLimit[leadptBin+1]));
1324 
1325  fhPtLeadConeBin[leadptBin]->Fill(pt, GetEventWeight());
1326 
1327  if(fFillSSHisto)
1328  fhPtLeadConeBinLambda0[leadptBin]->Fill(pt, m02, GetEventWeight());
1329 
1330  if ( leadptBin == 0 )
1331  AliDebug(1,Form("No track/clusters in isolation cone: cand pt %2.2f GeV/c, track multiplicity %d, N clusters %d",
1332  pt, GetTrackMultiplicity(),GetEMCALClusters()->GetEntriesFast()));
1333  }
1334 
1335  if ( ptsumBin >= 0 )
1336  {
1337  AliDebug(1,Form("\t Sum bin %d [%2.2f,%2.2f]" , ptsumBin ,fBkgBinLimit[ptsumBin] ,fBkgBinLimit[ptsumBin +1]));
1338 
1339  fhSumPtConeBin[ptsumBin]->Fill(pt, GetEventWeight());
1340 
1341  if(fFillSSHisto) fhSumPtConeBinLambda0[ptsumBin]->Fill(pt, m02, GetEventWeight());
1342  }
1343 
1344  // Check if it was a decay
1346  {
1347  Int_t decayTag = pCandidate->DecayTag();
1348  if(decayTag < 0) decayTag = 0;
1349 
1350  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
1351  {
1352  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
1353  {
1354  Int_t leadptBinDecay = leadptBin+ibit*fNBkgBin;
1355  Int_t ptsumBinDecay = ptsumBin+ibit*fNBkgBin;
1356  if( leadptBin >=0 ) fhPtLeadConeBinDecay[leadptBinDecay]->Fill(pt, GetEventWeight());
1357  if( ptsumBin >=0 ) fhSumPtConeBinDecay [ ptsumBinDecay]->Fill(pt, GetEventWeight());
1358  }
1359  }
1360  }
1361 
1362  if(IsDataMC())
1363  {
1364  Int_t leadptBinMC = leadptBin+mcIndex*fNBkgBin;
1365  Int_t ptsumBinMC = ptsumBin+mcIndex*fNBkgBin;
1366 
1367  if( leadptBin >=0 )
1368  {
1369  fhPtLeadConeBinMC[leadptBinMC]->Fill(pt, GetEventWeight());
1370  if(fFillSSHisto) fhPtLeadConeBinLambda0MC[leadptBinMC]->Fill(pt, m02, GetEventWeight());
1371  }
1372 
1373  if( ptsumBin >=0 )
1374  {
1375  fhSumPtConeBinMC [ ptsumBinMC]->Fill(pt, GetEventWeight());
1376  if(fFillSSHisto) fhSumPtConeBinLambda0MC [ ptsumBinMC]->Fill(pt, m02, GetEventWeight());
1377  }
1378 
1379  if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton))
1380  {
1381  leadptBinMC = leadptBin+kmcPhoton*fNBkgBin;
1382  ptsumBinMC = ptsumBin+kmcPhoton*fNBkgBin;
1383  if( leadptBin >=0 )
1384  {
1385  fhPtLeadConeBinMC[leadptBinMC]->Fill(pt, GetEventWeight());
1386  if(fFillSSHisto) fhPtLeadConeBinLambda0MC[leadptBinMC]->Fill(pt, m02, GetEventWeight());
1387  }
1388 
1389  if( ptsumBin >=0 )
1390  {
1391  fhSumPtConeBinMC [ ptsumBinMC]->Fill(pt, GetEventWeight());
1392  if(fFillSSHisto) fhSumPtConeBinLambda0MC [ ptsumBinMC]->Fill(pt, m02, GetEventWeight());
1393  }
1394  }
1395 
1396  // Check if decay and if pair is lost
1397  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1398  {
1399  if ( mcIndex == kmcPi0Decay )
1400  {
1401  leadptBinMC = leadptBin+kmcPi0DecayLostPair*fNBkgBin;
1402  ptsumBinMC = ptsumBin+kmcPi0DecayLostPair*fNBkgBin;
1403  }
1404  else if(mcIndex == kmcEtaDecay)
1405  {
1406  leadptBinMC = leadptBin+kmcEtaDecayLostPair*fNBkgBin;
1407  ptsumBinMC = ptsumBin+kmcEtaDecayLostPair*fNBkgBin;
1408  }
1409  else
1410  AliFatal(Form("Lost decay Bit assigned to bad case, mcIndex %d",mcIndex));
1411 
1412  if( leadptBin >=0 )
1413  {
1414  fhPtLeadConeBinMC[leadptBinMC]->Fill(pt, GetEventWeight());
1415  if(fFillSSHisto) fhPtLeadConeBinLambda0MC[leadptBinMC]->Fill(pt, m02, GetEventWeight());
1416  }
1417 
1418  if( ptsumBin >=0 )
1419  {
1420  fhSumPtConeBinMC [ ptsumBinMC]->Fill(pt);
1421  if(fFillSSHisto) fhSumPtConeBinLambda0MC [ ptsumBinMC]->Fill(pt, m02, GetEventWeight());
1422  }
1423 
1424  } // check decays with lost pairs
1425 
1426  } // MC data
1427  } // background dependent bins
1428 
1430  {
1431  // Get the background bin for this cone and trigger
1432  Int_t ptTrigBin = -1;
1433 
1434  for(Int_t ibin = 0; ibin < fNPtTrigBin; ibin++)
1435  {
1436  if( pt >= fPtTrigBinLimit[ibin] && coneptsum < fPtTrigBinLimit[ibin+1]) ptTrigBin = ibin;
1437  }
1438 
1439  // Fill the histograms per pT candidate bin of pt lead or pt sum
1440 
1441  if ( ptTrigBin >= 0 )
1442  {
1443  AliDebug(1,Form("Trigger pT %f, bin %d [%2.2f,%2.2f]",pt,ptTrigBin,fPtTrigBinLimit[ptTrigBin],fPtTrigBinLimit[ptTrigBin+1]));
1444 
1445  fhPtTrigBinPtLeadCone[ptTrigBin]->Fill(coneleadpt, GetEventWeight());
1446  fhPtTrigBinSumPtCone [ptTrigBin]->Fill(coneptsum , GetEventWeight());
1447 
1448  if(fFillSSHisto)
1449  {
1450  fhPtTrigBinLambda0vsPtLeadCone[ptTrigBin]->Fill(coneleadpt, m02, GetEventWeight());
1451  fhPtTrigBinLambda0vsSumPtCone [ptTrigBin]->Fill(coneptsum , m02, GetEventWeight());
1452  }
1453  }
1454 
1455  // Check if it was a decay
1457  {
1458  Int_t decayTag = pCandidate->DecayTag();
1459  if(decayTag < 0) decayTag = 0;
1460  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
1461  {
1462  if(GetNeutralMesonSelection()->CheckDecayBit(decayTag,fDecayBits[ibit]))
1463  {
1464  Int_t binDecay = ptTrigBin+ibit*fNPtTrigBin;
1465  if( binDecay > 0 )
1466  {
1467  fhPtTrigBinPtLeadConeDecay[binDecay]->Fill(coneleadpt, GetEventWeight());
1468  fhPtTrigBinSumPtConeDecay [binDecay]->Fill(coneptsum , GetEventWeight());
1469  }
1470  }
1471  }
1472  }
1473 
1474  if( IsDataMC() )
1475  {
1476  Int_t ptTrigBinMC = ptTrigBin+mcIndex*fNPtTrigBin;
1477 
1478  if( ptTrigBin >=0 )
1479  {
1480  fhPtTrigBinPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, GetEventWeight());
1481  fhPtTrigBinSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , GetEventWeight());
1482 
1483  if(fFillSSHisto)
1484  {
1485  fhPtTrigBinLambda0vsPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, m02, GetEventWeight());
1486  fhPtTrigBinLambda0vsSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , m02, GetEventWeight());
1487  }
1488  }
1489 
1490  if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton))
1491  {
1492  ptTrigBinMC = ptTrigBin+kmcPhoton*fNPtTrigBin;
1493  if( ptTrigBin >=0 )
1494  {
1495  fhPtTrigBinPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, GetEventWeight());
1496  fhPtTrigBinSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , GetEventWeight());
1497 
1498  if(fFillSSHisto)
1499  {
1500  fhPtTrigBinLambda0vsPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, m02, GetEventWeight());
1501  fhPtTrigBinLambda0vsSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , m02, GetEventWeight());
1502  }
1503  }
1504  } // photon MC
1505 
1506  // decays with lost pair
1507  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1508  {
1509  if ( mcIndex == kmcPi0Decay ) ptTrigBinMC = ptTrigBin+kmcPi0DecayLostPair*fNPtTrigBin;
1510  else if( mcIndex == kmcEtaDecay ) ptTrigBinMC = ptTrigBin+kmcEtaDecayLostPair*fNPtTrigBin;
1511 
1512  if( ptTrigBin >=0 )
1513  {
1514  fhPtTrigBinPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, GetEventWeight());
1515  fhPtTrigBinSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , GetEventWeight());
1516  if(fFillSSHisto)
1517  {
1518  fhPtTrigBinLambda0vsPtLeadConeMC[ptTrigBinMC]->Fill(coneleadpt, m02, GetEventWeight());
1519  fhPtTrigBinLambda0vsSumPtConeMC [ptTrigBinMC]->Fill(coneptsum , m02, GetEventWeight());
1520  }
1521  }
1522  } // lost decays MC
1523 
1524  } // MC
1525  } // pT trigger bins
1526 
1527  // Shower shape dependent histograms
1528  if(fFillSSHisto)
1529  {
1530  fhELambda0 [isolated]->Fill(energy, m02, GetEventWeight());
1531  fhPtLambda0[isolated]->Fill(pt, m02, GetEventWeight());
1532  //fhELambda1 [isolated]->Fill(energy, m20);
1533 
1534  if(IsDataMC())
1535  {
1536  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1537  fhPtLambda0MC[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1538 
1539  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1540  {
1541  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MC[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1542  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MC[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1543  }
1544 
1545  fhPtLambda0MC[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1546 
1547  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1548  {
1549  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1550  fhPtLambda0MCConv[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1551 
1552  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1553  {
1554  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MCConv[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1555  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MCConv[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1556  }
1557 
1558  fhPtLambda0MCConv[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1559  } // Conversion
1560 
1561 
1562  Int_t noverlaps = 0;
1564  {
1565  const UInt_t nlabels = fCluster->GetNLabels();
1566  Int_t overpdg[nlabels];
1567  noverlaps = GetMCAnalysisUtils()->GetNOverlaps(fCluster->GetLabels(), nlabels,mcTag,-1,GetReader(),overpdg);
1568 
1570  fhPtNOverlap[kmcPhoton][isolated]->Fill(pt, noverlaps, GetEventWeight());
1571 
1573  {
1574  if ( mcIndex == kmcPi0Decay ) fhPtNOverlap[kmcPi0DecayLostPair][isolated]->Fill(pt, noverlaps, GetEventWeight());
1575  else if( mcIndex == kmcEtaDecay ) fhPtNOverlap[kmcEtaDecayLostPair][isolated]->Fill(pt, noverlaps, GetEventWeight());
1576  }
1577 
1578  fhPtNOverlap[mcIndex][isolated]->Fill(pt, noverlaps, GetEventWeight());
1579 
1580  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1581  {
1582  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1583  fhPtNOverlapConv[kmcPhoton][isolated]->Fill(pt, noverlaps, GetEventWeight());
1584 
1585  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1586  {
1587  if ( mcIndex == kmcPi0Decay ) fhPtNOverlapConv[kmcPi0DecayLostPair][isolated]->Fill(pt, noverlaps, GetEventWeight());
1588  else if( mcIndex == kmcEtaDecay ) fhPtNOverlapConv[kmcEtaDecayLostPair][isolated]->Fill(pt, noverlaps, GetEventWeight());
1589  }
1590 
1591  fhPtNOverlapConv[mcIndex][isolated]->Fill(pt, noverlaps, GetEventWeight());
1592  } // Conversion
1593  }
1594 
1595  if ( noverlaps == 1 )
1596  {
1597  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1598  fhPtLambda0MCWith1Overlap[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1599 
1600  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1601  {
1602  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MCWith1Overlap[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1603  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MCWith1Overlap[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1604  }
1605 
1606  fhPtLambda0MCWith1Overlap[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1607 
1608  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1609  {
1610  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1611  fhPtLambda0MCConvWith1Overlap[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1612 
1613  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1614  {
1615  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MCConvWith1Overlap[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1616  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MCConvWith1Overlap[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1617  }
1618 
1619  fhPtLambda0MCConvWith1Overlap[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1620  } // Conversion
1621  } // At least 1 overlap
1622  else if (noverlaps > 1 ) // More than 1 overlap
1623  {
1624  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1625  fhPtLambda0MCWithNOverlap[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1626 
1627  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1628  {
1629  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MCWithNOverlap[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1630  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MCWithNOverlap[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1631  }
1632 
1633  fhPtLambda0MCWithNOverlap[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1634 
1635  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1636  {
1637  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) )
1638  fhPtLambda0MCConvWithNOverlap[kmcPhoton][isolated]->Fill(pt, m02, GetEventWeight());
1639 
1640  if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCDecayPairLost) )
1641  {
1642  if ( mcIndex == kmcPi0Decay ) fhPtLambda0MCConvWithNOverlap[kmcPi0DecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1643  else if( mcIndex == kmcEtaDecay ) fhPtLambda0MCConvWithNOverlap[kmcEtaDecayLostPair][isolated]->Fill(pt, m02, GetEventWeight());
1644  }
1645 
1646  fhPtLambda0MCConvWithNOverlap[mcIndex][isolated]->Fill(pt, m02, GetEventWeight());
1647  } // Conversion
1648  } // more than 1 overlap
1649  } // MC
1650 
1651  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 &&
1652  GetModuleNumber(pCandidate) >= GetFirstSMCoveredByTRD() )
1653  {
1654  fhELambda0TRD [isolated]->Fill(energy, m02, GetEventWeight());
1655  fhPtLambda0TRD[isolated]->Fill(pt , m02, GetEventWeight());
1656  //fhELambda1TRD [isolated]->Fill(energy, m20 );
1657  }
1658 
1659  if(fFillNLMHistograms)
1660  {
1661  fhNLocMax[isolated]->Fill(energy, nMaxima, GetEventWeight());
1662  if (nMaxima==1)
1663  {
1664  fhELambda0LocMax1[isolated]->Fill(energy, m02, GetEventWeight());
1665  fhELambda1LocMax1[isolated]->Fill(energy, m02, GetEventWeight());
1666  }
1667  else if(nMaxima==2)
1668  {
1669  fhELambda0LocMax2[isolated]->Fill(energy, m02, GetEventWeight());
1670  fhELambda1LocMax2[isolated]->Fill(energy, m02, GetEventWeight());
1671  }
1672  else
1673  {
1674  fhELambda0LocMaxN[isolated]->Fill(energy, m02, GetEventWeight());
1675  fhELambda1LocMaxN[isolated]->Fill(energy, m02, GetEventWeight());
1676  }
1677  }
1678  } // SS histo fill
1679 
1680  // Track matching dependent histograms
1681  if(fFillTMHisto)
1682  {
1683  Float_t dZ = fCluster->GetTrackDz();
1684  Float_t dR = fCluster->GetTrackDx();
1685 
1686 // if(fCluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1687 // {
1688 // dR = 2000., dZ = 2000.;
1689 // GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(fCluster->GetID(),dZ,dR);
1690 // }
1691 
1692  //printf("ParticleIsolation: dPhi %f, dEta %f\n",dR,dZ);
1693  if(fhTrackMatchedDEta[isolated] && TMath::Abs(dR) < 999)
1694  {
1695  fhTrackMatchedDEta[isolated]->Fill(energy, dZ, GetEventWeight());
1696  fhTrackMatchedDPhi[isolated]->Fill(energy, dR, GetEventWeight());
1697  if(energy > 0.5) fhTrackMatchedDEtaDPhi[isolated]->Fill(dZ, dR, GetEventWeight());
1698  if(IsDataMC())
1699  {
1700  fhTrackMatchedDEtaMC[mcIndex][isolated]->Fill(energy, dZ, GetEventWeight());
1701  fhTrackMatchedDPhiMC[mcIndex][isolated]->Fill(energy, dR, GetEventWeight());
1702  if(energy > 0.5) fhTrackMatchedDEtaDPhiMC[mcIndex][isolated]->Fill(dZ, dR, GetEventWeight());
1703  }
1704  }
1705 
1706  // Check dEdx and E/p of matched clusters
1707 
1708  if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1709  {
1710  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(fCluster, GetReader()->GetInputEvent());
1711 
1712  if(track)
1713  {
1714  Float_t dEdx = track->GetTPCsignal();
1715  fhdEdx[isolated]->Fill(fCluster->E(), dEdx, GetEventWeight());
1716 
1717  Float_t eOverp = fCluster->E()/track->P();
1718  fhEOverP[isolated]->Fill(fCluster->E(), eOverp, GetEventWeight());
1719  }
1720  //else
1721  // printf("AliAnaParticleIsolation::FillTrackMatchingShowerShapeHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
1722 
1723 
1724  if(IsDataMC())
1725  {
1727  {
1730  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 0.5, GetEventWeight());
1731  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 1.5, GetEventWeight());
1732  else fhTrackMatchedMCParticle[isolated]->Fill(energy, 3.5, GetEventWeight());
1733 
1734  }
1735  else
1736  {
1737  if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) ||
1738  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 6.5, GetEventWeight());
1739  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 4.5, GetEventWeight());
1740  else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[isolated]->Fill(energy, 5.5, GetEventWeight());
1741  else fhTrackMatchedMCParticle[isolated]->Fill(energy, 7.5, GetEventWeight());
1742  }
1743  } // MC
1744  } // match window
1745  }// TM histos fill
1746 }
1747 
1748 //______________________________________________________
1750 //______________________________________________________
1752 {
1753  TString parList ; //this will be list of parameters used for this analysis.
1754  const Int_t buffersize = 255;
1755  char onePar[buffersize] ;
1756 
1757  snprintf(onePar, buffersize,"--- AliAnaParticleIsolation ---:") ;
1758  parList+=onePar ;
1759  snprintf(onePar, buffersize,"Calorimeter: %s;",GetCalorimeterString().Data()) ;
1760  parList+=onePar ;
1761  snprintf(onePar, buffersize,"Isolation Cand Detector: %s;",fIsoDetectorString.Data()) ;
1762  parList+=onePar ;
1763  snprintf(onePar, buffersize,"fReMakeIC =%d (Flag for reisolation during histogram filling);",fReMakeIC) ;
1764  parList+=onePar ;
1765  snprintf(onePar, buffersize,"fMakeSeveralIC=%d (Flag for isolation with several cuts at the same time );",fMakeSeveralIC) ;
1766  parList+=onePar ;
1767  snprintf(onePar, buffersize,"fFillTMHisto=%d (Flag for track matching histograms);",fFillTMHisto) ;
1768  parList+=onePar ;
1769  snprintf(onePar, buffersize,"fFillSSHisto=%d (Flag for shower shape histograms);",fFillSSHisto) ;
1770  parList+=onePar ;
1771 
1772  if(fMakeSeveralIC)
1773  {
1774  snprintf(onePar, buffersize,"fNCones =%d (Number of cone sizes);",fNCones) ;
1775  parList+=onePar ;
1776  snprintf(onePar, buffersize,"fNPtThresFrac=%d (Flag for isolation with several cuts at the same time);",fNPtThresFrac) ;
1777  parList+=onePar ;
1778 
1779  for(Int_t icone = 0; icone < fNCones ; icone++)
1780  {
1781  snprintf(onePar, buffersize,"fConeSizes[%d]=%1.2f (isolation cone size);",icone, fConeSizes[icone]) ;
1782  parList+=onePar ;
1783  }
1784  for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1785  {
1786  snprintf(onePar, buffersize,"fPtThresholds[%d]=%1.2f (isolation pt threshold);",ipt, fPtThresholds[ipt]) ;
1787  parList+=onePar ;
1788  }
1789  for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1790  {
1791  snprintf(onePar, buffersize,"fPtFractions[%d]=%1.2f (isolation pt fraction threshold);",ipt, fPtFractions[ipt]) ;
1792  parList+=onePar ;
1793  }
1794  for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++)
1795  {
1796  snprintf(onePar, buffersize,"fSumPtThresholds[%d]=%1.2f (isolation sum pt threshold);",ipt, fSumPtThresholds[ipt]) ;
1797  parList+=onePar ;
1798  }
1799  }
1800 
1801  //Get parameters set in base class.
1802  parList += GetBaseParametersList() ;
1803 
1804  //Get parameters set in IC class.
1805  if(!fMakeSeveralIC)parList += GetIsolationCut()->GetICParametersList() ;
1806 
1807  return new TObjString(parList) ;
1808 }
1809 
1810 //________________________________________________________
1813 //________________________________________________________
1815 {
1816  TList * outputContainer = new TList() ;
1817  outputContainer->SetName("IsolatedParticleHistos") ;
1818 
1820  Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins();
1821  Int_t netabins = GetHistogramRanges()->GetHistoEtaBins();
1822  Float_t ptmax = GetHistogramRanges()->GetHistoPtMax();
1823  Float_t phimax = GetHistogramRanges()->GetHistoPhiMax();
1824  Float_t etamax = GetHistogramRanges()->GetHistoEtaMax();
1825  Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1826  Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1827  Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1828  Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins();
1829  Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax();
1830  Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1831  Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();
1832  Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();
1833  Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1834 
1835  Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1836  Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1837  Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1838  Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1839  Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1840  Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1841 
1842  Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1843  Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1844  Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1845  Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1846  Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1847  Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1848 
1849  Int_t nptsumbins = GetHistogramRanges()->GetHistoNPtSumBins();
1850  Float_t ptsummax = GetHistogramRanges()->GetHistoPtSumMax();
1851  Float_t ptsummin = GetHistogramRanges()->GetHistoPtSumMin();
1852  Int_t nptinconebins = GetHistogramRanges()->GetHistoNPtInConeBins();
1853  Float_t ptinconemax = GetHistogramRanges()->GetHistoPtInConeMax();
1854  Float_t ptinconemin = GetHistogramRanges()->GetHistoPtInConeMin();
1855 
1856  //Float_t ptthre = GetIsolationCut()->GetPtThreshold();
1857  //Float_t ptsumthre = GetIsolationCut()->GetSumPtThreshold();
1858  //Float_t ptfrac = GetIsolationCut()->GetPtFraction();
1859  Float_t r = GetIsolationCut()->GetConeSize();
1860  Int_t method = GetIsolationCut()->GetICMethod() ;
1861  Int_t particle = GetIsolationCut()->GetParticleTypeInCone() ;
1862 
1863  TString sThreshold = "";
1864  if ( method == AliIsolationCut::kSumPtIC )
1865  {
1866  sThreshold = Form(", %2.2f < #Sigma #it{p}_{T}^{in cone} < %2.2f GeV/#it{c}",
1867  GetIsolationCut()->GetSumPtThreshold(), GetIsolationCut()->GetSumPtThresholdMax());
1868  if(GetIsolationCut()->GetSumPtThresholdMax() > 200)
1869  sThreshold = Form(", #Sigma #it{p}_{T}^{in cone} = %2.2f GeV/#it{c}",
1870  GetIsolationCut()->GetSumPtThreshold());
1871  }
1872  else if ( method == AliIsolationCut::kPtThresIC)
1873  {
1874  sThreshold = Form(", %2.2f < #it{p}_{T}^{th} < %2.2f GeV/#it{c}",
1875  GetIsolationCut()->GetPtThreshold(),GetIsolationCut()->GetPtThresholdMax());
1876  if(GetIsolationCut()->GetSumPtThreshold() > 200)
1877  sThreshold = Form(", #it{p}_{T}^{th} = %2.2f GeV/#it{c}",
1878  GetIsolationCut()->GetPtThreshold());
1879  }
1880  else if ( method == AliIsolationCut::kPtFracIC)
1881  sThreshold = Form(", #Sigma #it{p}_{T}^{in cone}/#it{p}_{T}^{trig} = %2.2f" ,
1882  GetIsolationCut()->GetPtFraction());
1883 
1884  TString sParticle = ", x^{0,#pm}";
1885  if ( particle == AliIsolationCut::kOnlyNeutral ) sParticle = ", x^{0}";
1886  else if ( particle == AliIsolationCut::kOnlyCharged ) sParticle = ", x^{#pm}";
1887 
1888  TString parTitle = Form("#it{R} = %2.2f%s%s",GetIsolationCut()->GetConeSize(), sThreshold.Data(),sParticle.Data());
1889 
1890  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1891 
1892  // MC histograms title and name
1893  TString mcPartType[] = { "#gamma" , "#gamma_{prompt}" , "#gamma_{fragmentation}",
1894  "#pi^{0} (merged #gamma)", "#gamma_{#pi decay}" , "#gamma_{#pi decay} lost companion",
1895  "#eta (merged #gamma)" , "#gamma_{#eta decay}", "#gamma_{#eta decay} lost companion",
1896  "#gamma_{other decay}" , "e^{#pm}" , "hadrons?"} ;
1897 
1898  TString mcPartName[] = { "Photon","PhotonPrompt","PhotonFrag",
1899  "Pi0" ,"Pi0Decay" ,"Pi0DecayLostPair",
1900  "Eta" ,"EtaDecay" ,"EtaDecayLostPair",
1901  "OtherDecay","Electron","Hadron"} ;
1902 
1903  // Primary MC histograms title and name
1904  TString pptype[] = { "#gamma" , "#gamma_{#pi decay}" , "#gamma_{#eta decay}", "#gamma_{other decay}",
1905  "#gamma_{prompt}", "#gamma_{fragmentation}", "#gamma_{ISR}" ,
1906  "#pi^{0}" , "#eta"} ;
1907 
1908  TString ppname[] = { "Photon" , "PhotonPi0Decay","PhotonEtaDecay", "PhotonOtherDecay",
1909  "PhotonPrompt", "PhotonFrag" , "PhotonISR" ,
1910  "Pi0" , "Eta"} ;
1911 
1912  // Not Isolated histograms, reference histograms
1913 
1914  fhENoIso = new TH1F("hENoIso",
1915  Form("Number of not isolated leading particles vs #it{p}_{T}, %s",parTitle.Data()),
1916  nptbins,ptmin,ptmax);
1917  fhENoIso->SetYTitle("#it{counts}");
1918  fhENoIso->SetXTitle("E (GeV/#it{c})");
1919  outputContainer->Add(fhENoIso) ;
1920 
1921  fhPtNoIso = new TH1F("hPtNoIso",
1922  Form("Number of not isolated leading particles vs #it{p}_{T}, %s",parTitle.Data()),
1923  nptbins,ptmin,ptmax);
1924  fhPtNoIso->SetYTitle("#it{counts}");
1925  fhPtNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1926  outputContainer->Add(fhPtNoIso) ;
1927 
1928  fhEtaPhiNoIso = new TH2F("hEtaPhiNoIso",
1929  Form("Number of not isolated leading particles #eta vs #phi, %s",parTitle.Data()),
1930  netabins,etamin,etamax,nphibins,phimin,phimax);
1931  fhEtaPhiNoIso->SetXTitle("#eta");
1932  fhEtaPhiNoIso->SetYTitle("#phi");
1933  outputContainer->Add(fhEtaPhiNoIso) ;
1934 
1935  if(IsDataMC())
1936  {
1937  // For histograms in arrays, index in the array, corresponding to any particle origin
1938 
1939  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
1940  {
1941  fhPtNoIsoMC[imc] = new TH1F(Form("hPtNoIsoMC%s",mcPartName[imc].Data()),
1942  Form("#it{p}_{T} of NOT isolated %s, %s",mcPartType[imc].Data(),parTitle.Data()),
1943  nptbins,ptmin,ptmax);
1944  fhPtNoIsoMC[imc]->SetYTitle("#it{counts}");
1945  fhPtNoIsoMC[imc]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1946  outputContainer->Add(fhPtNoIsoMC[imc]) ;
1947 
1948  fhPtIsoMC[imc] = new TH1F(Form("hPtMC%s",mcPartName[imc].Data()),
1949  Form("#it{p}_{T} of isolated %s, %s",mcPartType[imc].Data(),parTitle.Data()),
1950  nptbins,ptmin,ptmax);
1951  fhPtIsoMC[imc]->SetYTitle("#it{counts}");
1952  fhPtIsoMC[imc]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1953  outputContainer->Add(fhPtIsoMC[imc]) ;
1954 
1955  fhPhiIsoMC[imc] = new TH2F(Form("hPhiMC%s",mcPartName[imc].Data()),
1956  Form("#phi vs #it{p}_{T} of isolated %s, %s",mcPartType[imc].Data(),parTitle.Data()),
1957  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1958  fhPhiIsoMC[imc]->SetYTitle("#phi");
1959  fhPhiIsoMC[imc]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1960  outputContainer->Add(fhPhiIsoMC[imc]) ;
1961 
1962  fhEtaIsoMC[imc] = new TH2F(Form("hEtaMC%s",mcPartName[imc].Data()),
1963  Form("#phi vs #it{p}_{T} of isolated %s, %s",mcPartType[imc].Data(),parTitle.Data()),
1964  nptbins,ptmin,ptmax,netabins,etamin,etamax);
1965  fhEtaIsoMC[imc]->SetYTitle("#eta");
1966  fhEtaIsoMC[imc]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
1967  outputContainer->Add(fhEtaIsoMC[imc]) ;
1968  }
1969  }
1970 
1971  // Histograms for tagged candidates as decay
1973  {
1974  TString isoName [] = {"NoIso","Iso"};
1975  TString isoTitle[] = {"Not isolated" ,"isolated"};
1976 
1977  for(Int_t ibit = 0; ibit < fNDecayBits; ibit++)
1978  {
1979  for(Int_t iso = 0; iso < 2; iso++)
1980  {
1981  if(fMakeSeveralIC && iso) continue;
1982  fhPtDecay[iso][ibit] =
1983  new TH1F(Form("hPtDecay%s_bit%d",isoName[iso].Data(),fDecayBits[ibit]),
1984  Form("Number of %s leading pi0 decay particles vs #it{p}_{T}, bit %d, %s",isoTitle[iso].Data(),fDecayBits[ibit],parTitle.Data()),
1985  nptbins,ptmin,ptmax);
1986  fhPtDecay[iso][ibit]->SetYTitle("#it{counts}");
1987  fhPtDecay[iso][ibit]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1988  outputContainer->Add(fhPtDecay[iso][ibit]) ;
1989 
1990  fhEtaPhiDecay[iso][ibit] =
1991  new TH2F(Form("hEtaPhiDecay%s_bit%d",isoName[iso].Data(),fDecayBits[ibit]),
1992  Form("Number of %s leading Pi0 decay particles #eta vs #phi, bit %d, %s",isoTitle[iso].Data(),fDecayBits[ibit],parTitle.Data()),
1993  netabins,etamin,etamax,nphibins,phimin,phimax);
1994  fhEtaPhiDecay[iso][ibit]->SetXTitle("#eta");
1995  fhEtaPhiDecay[iso][ibit]->SetYTitle("#phi");
1996  outputContainer->Add(fhEtaPhiDecay[iso][ibit]) ;
1997 
1998  if(fFillSSHisto)
1999  {
2000  fhPtLambda0Decay[iso][ibit] = new TH2F
2001  (Form("hPtLambda0Decay%s_bit%d",isoName[iso].Data(),fDecayBits[ibit]),
2002  Form("%s cluster : #it{p}_{T} vs #lambda_{0}, decay bit %d, %s",isoTitle[iso].Data(), fDecayBits[ibit], parTitle.Data()),
2003  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2004  fhPtLambda0Decay[iso][ibit]->SetYTitle("#lambda_{0}^{2}");
2005  fhPtLambda0Decay[iso][ibit]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2006  outputContainer->Add(fhPtLambda0Decay[iso][ibit]) ;
2007  }
2008 
2009  if(IsDataMC())
2010  {
2011  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
2012  {
2013  fhPtDecayMC[iso][ibit][imc] =
2014  new TH1F(Form("hPtDecay%s_bit%d_MC%s",isoName[iso].Data(),fDecayBits[ibit],mcPartName[imc].Data()),
2015  Form("#it{p}_{T} of %s, decay bit %d, %s, %s",isoTitle[iso].Data(),fDecayBits[ibit],mcPartType[imc].Data(),parTitle.Data()),
2016  nptbins,ptmin,ptmax);
2017  fhPtDecayMC[iso][ibit][imc]->SetYTitle("#it{counts}");
2018  fhPtDecayMC[iso][ibit][imc]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
2019  outputContainer->Add(fhPtDecayMC[iso][ibit][imc]) ;
2020  }// MC particle loop
2021  }// MC
2022  } // bit loop
2023  } //iso loop
2024  }// decay
2025 
2026  if(!fMakeSeveralIC)
2027  {
2028  TString isoName [] = {"NoIso","Iso"};
2029  TString isoTitle[] = {"Not isolated" ,"isolated"};
2030 
2031  fhEIso = new TH1F("hE",
2032  Form("Number of isolated particles vs E, %s",parTitle.Data()),
2033  nptbins,ptmin,ptmax);
2034  fhEIso->SetYTitle("d#it{N} / d#it{E}");
2035  fhEIso->SetXTitle("#it{E} (GeV/#it{c})");
2036  outputContainer->Add(fhEIso) ;
2037 
2038  fhPtIso = new TH1F("hPt",
2039  Form("Number of isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
2040  nptbins,ptmin,ptmax);
2041  fhPtIso->SetYTitle("d#it{N} / #it{p}_{T}");
2042  fhPtIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2043  outputContainer->Add(fhPtIso) ;
2044 
2045  fhPhiIso = new TH2F("hPhi",
2046  Form("Number of isolated particles vs #phi, %s",parTitle.Data()),
2047  nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2048  fhPhiIso->SetYTitle("#phi");
2049  fhPhiIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2050  outputContainer->Add(fhPhiIso) ;
2051 
2052  fhEtaIso = new TH2F("hEta",
2053  Form("Number of isolated particles vs #eta, %s",parTitle.Data()),
2054  nptbins,ptmin,ptmax,netabins,etamin,etamax);
2055  fhEtaIso->SetYTitle("#eta");
2056  fhEtaIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2057  outputContainer->Add(fhEtaIso) ;
2058 
2059  fhEtaPhiIso = new TH2F("hEtaPhiIso",
2060  Form("Number of isolated particles #eta vs #phi, %s",parTitle.Data()),
2061  netabins,etamin,etamax,nphibins,phimin,phimax);
2062  fhEtaPhiIso->SetXTitle("#eta");
2063  fhEtaPhiIso->SetYTitle("#phi");
2064  outputContainer->Add(fhEtaPhiIso) ;
2065 
2067  {
2068  fhPtCentralityIso = new TH2F("hPtCentrality",
2069  Form("centrality vs #it{p}_{T} for isolated particles, %s",parTitle.Data()),
2070  nptbins,ptmin,ptmax, 100,0,100);
2071  fhPtCentralityIso->SetYTitle("centrality");
2072  fhPtCentralityIso->SetXTitle("#it{p}_{T}(GeV/#it{c})");
2073  outputContainer->Add(fhPtCentralityIso) ;
2074 
2075  fhPtEventPlaneIso = new TH2F("hPtEventPlane",
2076  Form("event plane angle vs #it{p}_{T} for isolated particles, %s",parTitle.Data()),
2077  nptbins,ptmin,ptmax, 100,0,TMath::Pi());
2078  fhPtEventPlaneIso->SetYTitle("Event plane angle (rad)");
2079  fhPtEventPlaneIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2080  outputContainer->Add(fhPtEventPlaneIso) ;
2081  }
2082 
2083  if(fFillNLMHistograms)
2084  {
2085  fhPtNLocMaxIso = new TH2F("hPtNLocMax",
2086  Form("Number of isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
2087  nptbins,ptmin,ptmax,10,0,10);
2088  fhPtNLocMaxIso->SetYTitle("#it{NLM}");
2089  fhPtNLocMaxIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2090 
2091  fhPtNLocMaxNoIso = new TH2F("hPtNLocMaxNoIso",
2092  Form("Number of not isolated particles vs #it{p}_{T}, %s",parTitle.Data()),
2093  nptbins,ptmin,ptmax,10,0,10);
2094  fhPtNLocMaxNoIso->SetYTitle("#it{NLM}");
2095  fhPtNLocMaxNoIso->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2096  outputContainer->Add(fhPtNLocMaxNoIso) ;
2097  }
2098 
2099  fhConePtLead = new TH2F("hConePtLead",
2100  Form("Track or Cluster leading #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2101  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2102  fhConePtLead->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
2103  fhConePtLead->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2104  outputContainer->Add(fhConePtLead) ;
2105 
2106  fhConeSumPt = new TH2F("hConePtSum",
2107  Form("Track and Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2108  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2109  fhConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
2110  fhConeSumPt->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2111  outputContainer->Add(fhConeSumPt) ;
2112 
2113  fhConeSumPtTrigEtaPhi = new TH2F("hConePtSumTrigEtaPhi",
2114  Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2115  netabins,etamin,etamax,nphibins,phimin,phimax);
2116  fhConeSumPtTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2117  fhConeSumPtTrigEtaPhi->SetXTitle("#eta_{trigger}");
2118  fhConeSumPtTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2119  outputContainer->Add(fhConeSumPtTrigEtaPhi) ;
2120 
2121  fhPtInCone = new TH2F("hPtInCone",
2122  Form("#it{p}_{T} of clusters and tracks in isolation cone for #it{R} = %2.2f",r),
2123  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2124  fhPtInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2125  fhPtInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2126  outputContainer->Add(fhPtInCone) ;
2127 
2129  {
2130  fhPtLeadConeBin = new TH1F*[fNBkgBin];
2131  fhSumPtConeBin = new TH1F*[fNBkgBin];
2132  if(fFillSSHisto)
2133  {
2134  fhPtLeadConeBinLambda0 = new TH2F*[fNBkgBin];
2135  fhSumPtConeBinLambda0 = new TH2F*[fNBkgBin];
2136  }
2137 
2139  {
2142  }
2143 
2144  if(IsDataMC())
2145  {
2146  fhPtLeadConeBinMC = new TH1F*[fNBkgBin*fgkNmcTypes];
2147  fhSumPtConeBinMC = new TH1F*[fNBkgBin*fgkNmcTypes];
2148 
2149  if(fFillSSHisto)
2150  {
2153  }
2154  }
2155 
2156  for(Int_t ibin = 0; ibin < fNBkgBin; ibin++)
2157  {
2158  fhPtLeadConeBin[ibin] = new TH1F
2159  (Form("hPtLeadCone_Bin%d",ibin),
2160  Form("cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, %s",
2161  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2162  fhPtLeadConeBin[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
2163  fhPtLeadConeBin[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2164  outputContainer->Add(fhPtLeadConeBin[ibin]) ;
2165 
2166  fhSumPtConeBin[ibin] = new TH1F
2167  (Form("hSumPtCone_Bin%d",ibin),
2168  Form("in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, %s",
2169  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2170  fhSumPtConeBin[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
2171  fhSumPtConeBin[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2172  outputContainer->Add(fhSumPtConeBin[ibin]) ;
2173 
2175  {
2176  for(Int_t idecay = 0; idecay < fNDecayBits; idecay++)
2177  {
2178  Int_t bindecay = ibin+idecay*fNBkgBin;
2179 
2180  fhPtLeadConeBinDecay[bindecay] = new TH1F
2181  (Form("hPtLeadCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
2182  Form("Decay bit %d, cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, %s",
2183  fDecayBits[idecay],fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2184  fhPtLeadConeBinDecay[bindecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
2185  fhPtLeadConeBinDecay[bindecay]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2186  outputContainer->Add(fhPtLeadConeBinDecay[bindecay]) ;
2187 
2188  fhSumPtConeBinDecay[bindecay] = new TH1F
2189  (Form("hSumPtCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
2190  Form("Decay bit %d, in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, %s",
2191  fDecayBits[idecay],fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2192  fhSumPtConeBinDecay[bindecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
2193  fhSumPtConeBinDecay[bindecay]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2194  outputContainer->Add(fhSumPtConeBinDecay[bindecay]) ;
2195  }
2196  }
2197 
2198  if(IsDataMC())
2199  {
2200  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
2201  {
2202  Int_t binmc = ibin+imc*fNBkgBin;
2203  fhPtLeadConeBinMC[binmc] = new TH1F
2204  (Form("hPtLeadCone_Bin%d_MC%s",ibin, mcPartName[imc].Data()),
2205  Form("in cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, MC %s, %s",
2206  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax);
2207  fhPtLeadConeBinMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
2208  fhPtLeadConeBinMC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2209  outputContainer->Add(fhPtLeadConeBinMC[binmc]) ;
2210 
2211  fhSumPtConeBinMC[binmc] = new TH1F
2212  (Form("hSumPtCone_Bin%d_MC%s",ibin,mcPartName[imc].Data()),
2213  Form("in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, MC %s, %s",
2214  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax);
2215  fhSumPtConeBinMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
2216  fhSumPtConeBinMC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2217  outputContainer->Add(fhSumPtConeBinMC[binmc]) ;
2218  } // MC particle loop
2219  }
2220 
2221  if(fFillSSHisto)
2222  {
2223  fhPtLeadConeBinLambda0[ibin] = new TH2F
2224  (Form("hPtLeadConeLambda0_Bin%d",ibin),
2225  Form("#lambda_{0}, in cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, %s",
2226  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2227  fhPtLeadConeBinLambda0[ibin]->SetYTitle("#lambda_{0}^{2}");
2228  fhPtLeadConeBinLambda0[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2229  outputContainer->Add(fhPtLeadConeBinLambda0[ibin]) ;
2230 
2231  fhSumPtConeBinLambda0[ibin] = new TH2F
2232  (Form("hSumPtConeLambda0_Bin%d",ibin),
2233  Form("#lambda_{0}, in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, %s",
2234  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2235  fhSumPtConeBinLambda0[ibin]->SetYTitle("#lambda_{0}^{2}");
2236  fhSumPtConeBinLambda0[ibin]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2237  outputContainer->Add(fhSumPtConeBinLambda0[ibin]) ;
2238 
2239  if(IsDataMC())
2240  {
2241  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
2242  {
2243  Int_t binmc = ibin+imc*fNBkgBin;
2244  fhPtLeadConeBinLambda0MC[binmc] = new TH2F
2245  (Form("hPtLeadConeLambda0_Bin%d_MC%s",ibin, mcPartName[imc].Data()),
2246  Form("#lambda_{0}, in cone %2.2f<#it{p}_{T}^{leading}<%2.2f GeV/#it{c}, MC %s, %s",
2247  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2248  fhPtLeadConeBinLambda0MC[binmc]->SetYTitle("#lambda_{0}^{2}");
2249  fhPtLeadConeBinLambda0MC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2250  outputContainer->Add(fhPtLeadConeBinLambda0MC[binmc]) ;
2251 
2252  fhSumPtConeBinLambda0MC[binmc] = new TH2F
2253  (Form("hSumPtConeLambda0_Bin%d_MC%s",ibin,mcPartName[imc].Data()),
2254  Form("#lambda_{0}, in cone %2.2f <#Sigma #it{p}_{T}< %2.2f GeV/#it{c}, MC %s, %s",
2255  fBkgBinLimit[ibin],fBkgBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2256  fhSumPtConeBinLambda0MC[binmc]->SetYTitle("#lambda_{0}^{2}");
2257  fhSumPtConeBinLambda0MC[binmc]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2258  outputContainer->Add(fhSumPtConeBinLambda0MC[binmc]) ;
2259  } // MC particle loop
2260  }
2261  } // shower shape on
2262  } // pt in cone bin loop
2263  } // bkg cone pt bin histograms
2264 
2266  {
2267  fhPtTrigBinPtLeadCone = new TH1F*[fNPtTrigBin];
2268  fhPtTrigBinSumPtCone = new TH1F*[fNPtTrigBin];
2269 
2272 
2273  if(IsDataMC())
2274  {
2277  }
2278 
2279  if(fFillSSHisto)
2280  {
2283 
2284  if(IsDataMC())
2285  {
2288  }
2289  }
2290 
2291  for(Int_t ibin = 0; ibin < fNPtTrigBin; ibin++)
2292  {
2293  fhPtTrigBinPtLeadCone[ibin] = new TH1F
2294  (Form("hPtTrigBin_PtLeadCone_Bin%d",ibin),
2295  Form("#it{p}_{T}^{lead. in cone}, %2.2f<#it{p}_{T}^{cand}<%2.2f GeV/#it{c}, %s",
2296  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2297  fhPtTrigBinPtLeadCone[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
2298  fhPtTrigBinPtLeadCone[ibin]->SetXTitle("#it{p}_{T}^{in cone} (GeV/#it{c})");
2299  outputContainer->Add(fhPtTrigBinPtLeadCone[ibin]) ;
2300 
2301  fhPtTrigBinSumPtCone[ibin] = new TH1F
2302  (Form("hPtTrigBin_SumPtCone_Bin%d",ibin),
2303  Form("#Sigma #it{p}_{T}^{in cone} %2.2f <#it{p}_{T}^{cand}< %2.2f GeV/#it{c}, %s",
2304  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptsumbins,ptsummin,ptsummax);
2305  fhPtTrigBinSumPtCone[ibin]->SetYTitle("d #it{N} / d #it{p}_{T}");
2306  fhPtTrigBinSumPtCone[ibin]->SetXTitle("#Sigma #it{p}_{T}^{in cone} (GeV/#it{c})");
2307  outputContainer->Add(fhPtTrigBinSumPtCone[ibin]) ;
2308 
2310  {
2311  for(Int_t idecay = 0; idecay < fNDecayBits; idecay++)
2312  {
2313  Int_t binDecay = ibin+idecay*fNPtTrigBin;
2314 
2315  fhPtTrigBinPtLeadConeDecay[binDecay] = new TH1F
2316  (Form("hPtTrigBin_PtLeadCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
2317  Form("Decay bit %d, #it{p}_{T}^{lead. in cone}, %2.2f<#it{p}_{T}^{cand}<%2.2f GeV/#it{c}, %s",
2318  fDecayBits[idecay],fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax);
2319  fhPtTrigBinPtLeadConeDecay[binDecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
2320  fhPtTrigBinPtLeadConeDecay[binDecay]->SetXTitle("#it{p}_{T}^{lead in cone} (GeV/#it{c})");
2321  outputContainer->Add(fhPtTrigBinPtLeadConeDecay[binDecay]) ;
2322 
2323  fhPtTrigBinSumPtConeDecay[binDecay] = new TH1F
2324  (Form("hPtTrigBin_SumPtCone_Bin%d_DecayBit%d",ibin,fDecayBits[idecay]),
2325  Form("Decay bit %d, #Sigma #it{p}_{T}^{in cone} %2.2f <#it{p}_{T}^{cand}< %2.2f GeV/#it{c}, %s",
2326  fDecayBits[idecay],fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptsumbins,ptsummin,ptsummax);
2327  fhPtTrigBinSumPtConeDecay[binDecay]->SetYTitle("d #it{N} / d #it{p}_{T}");
2328  fhPtTrigBinSumPtConeDecay[binDecay]->SetXTitle("#Sigma #it{p}_{T}^{in cone} (GeV/#it{c})");
2329  outputContainer->Add(fhPtTrigBinSumPtConeDecay[binDecay]) ;
2330  }
2331  }
2332 
2333  if(IsDataMC())
2334  {
2335  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
2336  {
2337  Int_t binmc = ibin+imc*fNPtTrigBin;
2338  fhPtTrigBinPtLeadConeMC[binmc] = new TH1F
2339  (Form("hPtTrigBin_PtLeadCone_Bin%d_MC%s",ibin, mcPartName[imc].Data()),
2340  Form("#it{p}_{T}^{lead. in cone}, %2.2f<#it{p}_{T}^{cand}<%2.2f GeV/#it{c}, MC %s, %s",
2341  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax);
2342  fhPtTrigBinPtLeadConeMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
2343  fhPtTrigBinPtLeadConeMC[binmc]->SetXTitle("#it{p}_{T}^{lead in cone} (GeV/#it{c})");
2344  outputContainer->Add(fhPtTrigBinPtLeadConeMC[binmc]) ;
2345 
2346  fhPtTrigBinSumPtConeMC[binmc] = new TH1F
2347  (Form("hPtTrigBin_SumPtCone_Bin%d_MC%s",ibin,mcPartName[imc].Data()),
2348  Form("#Sigma #it{p}_{T}^{in cone}, %2.2f <#it{p}_{T}^{cand}< %2.2f GeV/#it{c}, MC %s, %s",
2349  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptsumbins,ptsummin,ptsummax);
2350  fhPtTrigBinSumPtConeMC[binmc]->SetYTitle("d #it{N} / d #it{p}_{T}");
2351  fhPtTrigBinSumPtConeMC[binmc]->SetXTitle("#Sigma #it{p}_{T}^{in cone} (GeV/#it{c})");
2352  outputContainer->Add(fhPtTrigBinSumPtConeMC[binmc]) ;
2353  } // MC particle loop
2354  } // MC
2355 
2356  if(fFillSSHisto)
2357  {
2358  fhPtTrigBinLambda0vsPtLeadCone[ibin] = new TH2F
2359  (Form("hPtTrigBin_PtLeadConeVSLambda0_Bin%d",ibin),
2360  Form("#lambda_{0} vs #it{p}_{T}^{lead. in cone}, %2.2f<#it{p}_{T}^{cand}<%2.2f GeV/#it{c}, %s",
2361  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2362  fhPtTrigBinLambda0vsPtLeadCone[ibin]->SetYTitle("#lambda_{0}^{2}");
2363  fhPtTrigBinLambda0vsPtLeadCone[ibin]->SetXTitle("#it{p}_{T}^{lead in cone} (GeV/#it{c})");
2364  outputContainer->Add(fhPtTrigBinLambda0vsPtLeadCone[ibin]) ;
2365 
2366  fhPtTrigBinLambda0vsSumPtCone[ibin] = new TH2F
2367  (Form("hPtTrigBin_SumPtConeVSLambda0_Bin%d",ibin),
2368  Form("#lambda_{0} vs #Sigma #it{p}_{T}^{in cone} %2.2f <#it{p}_{T}^{cand}< %2.2f GeV/#it{c}, %s",
2369  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], parTitle.Data()),nptsumbins,ptsummin,ptsummax,ssbins,ssmin,ssmax);
2370  fhPtTrigBinLambda0vsSumPtCone[ibin]->SetYTitle("#lambda_{0}^{2}");
2371  fhPtTrigBinLambda0vsSumPtCone[ibin]->SetXTitle("#Sigma #it{p}_{T}^{in cone} (GeV/#it{c})");
2372  outputContainer->Add(fhPtTrigBinLambda0vsSumPtCone[ibin]) ;
2373 
2374  if(IsDataMC())
2375  {
2376  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
2377  {
2378  Int_t binmc = ibin+imc*fNPtTrigBin;
2379  fhPtTrigBinLambda0vsPtLeadConeMC[binmc] = new TH2F
2380  (Form("hPtTrigBin_PtLeadConeVSLambda0_Bin%d_MC%s",ibin, mcPartName[imc].Data()),
2381  Form("#lambda_{0} vs #it{p}_{T}^{lead. in cone}, %2.2f<#it{p}_{T}^{cand}<%2.2f GeV/#it{c}, MC %s, %s",
2382  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2383  fhPtTrigBinLambda0vsPtLeadConeMC[binmc]->SetYTitle("#lambda_{0}^{2}");
2384  fhPtTrigBinLambda0vsPtLeadConeMC[binmc]->SetXTitle("#it{p}_{T}^{lead in cone} (GeV/#it{c})");
2385  outputContainer->Add(fhPtTrigBinLambda0vsPtLeadConeMC[binmc]) ;
2386 
2387  fhPtTrigBinLambda0vsSumPtConeMC[binmc] = new TH2F
2388  (Form("hPtTrigBin_SumPtConeVSLambda0_Bin%d_MC%s",ibin,mcPartName[imc].Data()),
2389  Form("#lambda_{0} vs #Sigma #it{p}_{T}^{in cone}, %2.2f <#it{p}_{T}^{cand}< %2.2f GeV/#it{c}, MC %s, %s",
2390  fPtTrigBinLimit[ibin],fPtTrigBinLimit[ibin+1], mcPartType[imc].Data(), parTitle.Data()),nptsumbins,ptsummin,ptsummax,ssbins,ssmin,ssmax);
2391  fhPtTrigBinLambda0vsSumPtConeMC[binmc]->SetYTitle("#lambda_{0}^{2}");
2392  fhPtTrigBinLambda0vsSumPtConeMC[binmc]->SetXTitle("#Sigma #it{p}_{T}^{in cone} (GeV/#it{c})");
2393  outputContainer->Add(fhPtTrigBinLambda0vsSumPtConeMC[binmc]) ;
2394  } // MC particle loop
2395  } // MC
2396  } // SS histo
2397  } // pt trig bin loop
2398  } // pt trig bin histograms
2399 
2401  {
2402  fhPtInConeCent = new TH2F("hPtInConeCent",
2403  Form("#it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2404  100,0,100,nptinconebins,ptinconemin,ptinconemax);
2405  fhPtInConeCent->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2406  fhPtInConeCent->SetXTitle("centrality");
2407  outputContainer->Add(fhPtInConeCent) ;
2408  }
2409 
2410  // Cluster only histograms
2411  if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyCharged)
2412  {
2413  fhConeSumPtCluster = new TH2F("hConePtSumCluster",
2414  Form("Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2415  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2416  fhConeSumPtCluster->SetYTitle("#Sigma #it{p}_{T}");
2417  fhConeSumPtCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2418  outputContainer->Add(fhConeSumPtCluster) ;
2419 
2420  fhConePtLeadCluster = new TH2F("hConeLeadPtCluster",
2421  Form("Cluster leading in isolation cone for #it{R} = %2.2f",r),
2422  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2423  fhConePtLeadCluster->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
2424  fhConePtLeadCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2425  outputContainer->Add(fhConePtLeadCluster) ;
2426 
2427 
2429  {
2430  fhConeSumPtCell = new TH2F("hConePtSumCell",
2431  Form("Cell #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2432  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2433  fhConeSumPtCell->SetYTitle("#Sigma #it{p}_{T}");
2434  fhConeSumPtCell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2435  outputContainer->Add(fhConeSumPtCell) ;
2436  }
2437 
2439  {
2440  fhConeSumPtEtaBandUECluster = new TH2F("hConePtSumEtaBandUECluster",
2441  "#Sigma cluster #it{p}_{T} in UE Eta Band",
2442  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2443  fhConeSumPtEtaBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
2444  fhConeSumPtEtaBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2445  outputContainer->Add(fhConeSumPtEtaBandUECluster) ;
2446 
2447  fhConeSumPtPhiBandUECluster = new TH2F("hConePtSumPhiBandUECluster",
2448  "#Sigma cluster #it{p}_{T} UE Phi Band",
2449  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2450  fhConeSumPtPhiBandUECluster->SetYTitle("#Sigma #it{p}_{T}");
2451  fhConeSumPtPhiBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2452  outputContainer->Add(fhConeSumPtPhiBandUECluster) ;
2453 
2454  fhConeSumPtEtaBandUEClusterTrigEtaPhi = new TH2F("hConePtSumEtaBandUEClusterTrigEtaPhi",
2455  "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} in UE Eta Band",
2456  netabins,etamin,etamax,nphibins,phimin,phimax);
2457  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2458  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
2459  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2460  outputContainer->Add(fhConeSumPtEtaBandUEClusterTrigEtaPhi) ;
2461 
2462  fhConeSumPtPhiBandUEClusterTrigEtaPhi = new TH2F("hConePtSumPhiBandUEClusterTrigEtaPhi",
2463  "Trigger #eta vs #phi, #Sigma cluster #it{p}_{T} UE Phi Band",
2464  netabins,etamin,etamax,nphibins,phimin,phimax);
2465  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2466  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
2467  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2468  outputContainer->Add(fhConeSumPtPhiBandUEClusterTrigEtaPhi) ;
2470  {
2471 
2472  fhConeSumPtEtaBandUECell = new TH2F("hConePtSumEtaBandUECell",
2473  "#Sigma cell #it{p}_{T} in UE Eta Band",
2474  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2475  fhConeSumPtEtaBandUECell->SetYTitle("#Sigma #it{p}_{T}");
2476  fhConeSumPtEtaBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2477  outputContainer->Add(fhConeSumPtEtaBandUECell) ;
2478 
2479  fhConeSumPtPhiBandUECell = new TH2F("hConePtSumPhiBandUECell",
2480  "#Sigma cell #it{p}_{T} UE Phi Band",
2481  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2482  fhConeSumPtPhiBandUECell->SetYTitle("#Sigma #it{p}_{T}");
2483  fhConeSumPtPhiBandUECell->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2484  outputContainer->Add(fhConeSumPtPhiBandUECell) ;
2485 
2486  fhConeSumPtEtaBandUECellTrigEtaPhi = new TH2F("hConePtSumEtaBandUECellTrigEtaPhi",
2487  "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} in UE Eta Band",
2488  netabins,etamin,etamax,nphibins,phimin,phimax);
2489  fhConeSumPtEtaBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2490  fhConeSumPtEtaBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2491  fhConeSumPtEtaBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2492  outputContainer->Add(fhConeSumPtEtaBandUECellTrigEtaPhi) ;
2493 
2494  fhConeSumPtPhiBandUECellTrigEtaPhi = new TH2F("hConePtSumPhiBandUECellTrigEtaPhi",
2495  "Trigger #eta vs #phi, #Sigma cell #it{p}_{T} UE Phi Band",
2496  netabins,etamin,etamax,nphibins,phimin,phimax);
2497  fhConeSumPtPhiBandUECellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2498  fhConeSumPtPhiBandUECellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2499  fhConeSumPtPhiBandUECellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2500  outputContainer->Add(fhConeSumPtPhiBandUECellTrigEtaPhi) ;
2501  }
2502 
2503  fhEtaBandCluster = new TH2F("hEtaBandCluster",
2504  Form("#eta vs #phi of clusters in #eta band isolation cone for #it{R} = %2.2f",r),
2505  netabins,-1,1,nphibins,0,TMath::TwoPi());
2506  fhEtaBandCluster->SetXTitle("#eta");
2507  fhEtaBandCluster->SetYTitle("#phi");
2508  outputContainer->Add(fhEtaBandCluster) ;
2509 
2510  fhPhiBandCluster = new TH2F("hPhiBandCluster",
2511  Form("#eta vs #phi of clusters in #phi band isolation cone for #it{R} = %2.2f",r),
2512  netabins,-1,1,nphibins,0,TMath::TwoPi());
2513  fhPhiBandCluster->SetXTitle("#eta");
2514  fhPhiBandCluster->SetYTitle("#phi");
2515  outputContainer->Add(fhPhiBandCluster) ;
2516 
2517  fhEtaPhiInConeCluster= new TH2F("hEtaPhiInConeCluster",
2518  Form("#eta vs #phi of clusters in cone for #it{R} = %2.2f",r),
2519  netabins,-1,1,nphibins,0,TMath::TwoPi());
2520  fhEtaPhiInConeCluster->SetXTitle("#eta");
2521  fhEtaPhiInConeCluster->SetYTitle("#phi");
2522  outputContainer->Add(fhEtaPhiInConeCluster) ;
2523 
2524  fhEtaPhiCluster= new TH2F("hEtaPhiCluster",
2525  Form("#eta vs #phi of all clusters"),
2526  netabins,-1,1,nphibins,0,TMath::TwoPi());
2527  fhEtaPhiCluster->SetXTitle("#eta");
2528  fhEtaPhiCluster->SetYTitle("#phi");
2529  outputContainer->Add(fhEtaPhiCluster) ;
2530 
2531  }
2532 
2533  fhPtClusterInCone = new TH2F("hPtClusterInCone",
2534  Form("#it{p}_{T} of clusters in isolation cone for #it{R} = %2.2f",r),
2535  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2536  fhPtClusterInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2537  fhPtClusterInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2538  outputContainer->Add(fhPtClusterInCone) ;
2539 
2541  {
2542  fhPtCellInCone = new TH2F("hPtCellInCone",
2543  Form("#it{p}_{T} of cells in isolation cone for #it{R} = %2.2f",r),
2544  nptbins,ptmin,ptmax,1000,0,50);
2545  fhPtCellInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2546  fhPtCellInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2547  outputContainer->Add(fhPtCellInCone) ;
2548 
2549  fhEtaBandCell = new TH2F("hEtaBandCell",
2550  Form("#col vs #row of cells in #eta band isolation cone for #it{R} = %2.2f",r),
2551  96,0,95,128,0,127);
2552  fhEtaBandCell->SetXTitle("#col");
2553  fhEtaBandCell->SetYTitle("#row");
2554  outputContainer->Add(fhEtaBandCell) ;
2555 
2556  fhPhiBandCell = new TH2F("hPhiBandCell",
2557  Form("#col vs #row of cells in #phi band isolation cone for #it{R} = %2.2f",r),
2558  96,0,95,128,0,127);
2559  fhPhiBandCell->SetXTitle("#col");
2560  fhPhiBandCell->SetYTitle("#row");
2561  outputContainer->Add(fhPhiBandCell) ;
2562  }
2563 
2565  {
2566  fhConeSumPtEtaUESubCluster = new TH2F("hConeSumPtEtaUESubCluster",
2567  Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} = %2.2f",r),
2568  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2569  fhConeSumPtEtaUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
2570  fhConeSumPtEtaUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2571  outputContainer->Add(fhConeSumPtEtaUESubCluster) ;
2572 
2573  fhConeSumPtPhiUESubCluster = new TH2F("hConeSumPtPhiUESubCluster",
2574  Form("Clusters #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} = %2.2f",r),
2575  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2576  fhConeSumPtPhiUESubCluster->SetYTitle("#Sigma #it{p}_{T}");
2577  fhConeSumPtPhiUESubCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2578  outputContainer->Add(fhConeSumPtPhiUESubCluster) ;
2579 
2580  fhConeSumPtEtaUESubClusterTrigEtaPhi = new TH2F("hConeSumPtEtaUESubClusterTrigEtaPhi",
2581  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),
2582  netabins,etamin,etamax,nphibins,phimin,phimax);
2583  fhConeSumPtEtaUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2584  fhConeSumPtEtaUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
2585  fhConeSumPtEtaUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2586  outputContainer->Add(fhConeSumPtEtaUESubClusterTrigEtaPhi) ;
2587 
2588  fhConeSumPtPhiUESubClusterTrigEtaPhi = new TH2F("hConeSumPtPhiUESubClusterTrigEtaPhi",
2589  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),
2590  netabins,etamin,etamax,nphibins,phimin,phimax);
2591  fhConeSumPtPhiUESubClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2592  fhConeSumPtPhiUESubClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
2593  fhConeSumPtPhiUESubClusterTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2594  outputContainer->Add(fhConeSumPtPhiUESubClusterTrigEtaPhi) ;
2595 
2597  {
2598  fhConeSumPtEtaUESubCell = new TH2F("hConeSumPtEtaUESubCell",
2599  Form("Cells #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} = %2.2f",r),
2600  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2601  fhConeSumPtEtaUESubCell->SetYTitle("#Sigma #it{p}_{T}");
2602  fhConeSumPtEtaUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2603  outputContainer->Add(fhConeSumPtEtaUESubCell) ;
2604 
2605  fhConeSumPtPhiUESubCell = new TH2F("hConeSumPtPhiUESubCell",
2606  Form("Cells #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} = %2.2f",r),
2607  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2608  fhConeSumPtPhiUESubCell->SetYTitle("#Sigma #it{p}_{T}");
2609  fhConeSumPtPhiUESubCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2610  outputContainer->Add(fhConeSumPtPhiUESubCell) ;
2611 
2612  fhConeSumPtEtaUESubCellTrigEtaPhi = new TH2F("hConeSumPtEtaUESubCellTrigEtaPhi",
2613  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),
2614  netabins,etamin,etamax,nphibins,phimin,phimax);
2615  fhConeSumPtEtaUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2616  fhConeSumPtEtaUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2617  fhConeSumPtEtaUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2618  outputContainer->Add(fhConeSumPtEtaUESubCellTrigEtaPhi) ;
2619 
2620  fhConeSumPtPhiUESubCellTrigEtaPhi = new TH2F("hConeSumPtPhiUESubCellTrigEtaPhi",
2621  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),
2622  netabins,etamin,etamax,nphibins,phimin,phimax);
2623  fhConeSumPtPhiUESubCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2624  fhConeSumPtPhiUESubCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
2625  fhConeSumPtPhiUESubCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2626  outputContainer->Add(fhConeSumPtPhiUESubCellTrigEtaPhi) ;
2627  }
2628 
2629  fhFractionClusterOutConeEta = new TH2F("hFractionClusterOutConeEta",
2630  Form("Fraction of the isolation cone #it{R} = %2.2f, out of clusters #eta acceptance",r),
2631  nptbins,ptmin,ptmax,100,0,1);
2632  fhFractionClusterOutConeEta->SetYTitle("#it{fraction}");
2633  fhFractionClusterOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
2634  outputContainer->Add(fhFractionClusterOutConeEta) ;
2635 
2636  fhFractionClusterOutConeEtaTrigEtaPhi = new TH2F("hFractionClusterOutConeEtaTrigEtaPhi",
2637  Form("Fraction of the isolation cone #it{R} = %2.2f, out of clusters #eta acceptance, in trigger #eta-#phi ",r),
2638  netabins,etamin,etamax,nphibins,phimin,phimax);
2639  fhFractionClusterOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
2640  fhFractionClusterOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
2641  fhFractionClusterOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2642  outputContainer->Add(fhFractionClusterOutConeEtaTrigEtaPhi) ;
2643 
2644  fhFractionClusterOutConePhi = new TH2F("hFractionClusterOutConePhi",
2645  Form("Fraction of the isolation cone #it{R} = %2.2f, out of clusters #phi acceptance",r),
2646  nptbins,ptmin,ptmax,100,0,1);
2647  fhFractionClusterOutConePhi->SetYTitle("#it{fraction}");
2648  fhFractionClusterOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
2649  outputContainer->Add(fhFractionClusterOutConePhi) ;
2650 
2651  fhFractionClusterOutConePhiTrigEtaPhi = new TH2F("hFractionClusterOutConePhiTrigEtaPhi",
2652  Form("Fraction of the isolation cone #it{R} = %2.2f, out of clusters #phi acceptance, in trigger #eta-#phi ",r),
2653  netabins,etamin,etamax,nphibins,phimin,phimax);
2654  fhFractionClusterOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
2655  fhFractionClusterOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
2656  fhFractionClusterOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2657  outputContainer->Add(fhFractionClusterOutConePhiTrigEtaPhi) ;
2658 
2659  fhConeSumPtSubvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCluster",
2660  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),
2661  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2662  fhConeSumPtSubvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2663  fhConeSumPtSubvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2664  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCluster);
2665 
2666  fhConeSumPtSubNormvsConeSumPtTotPhiCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCluster",
2667  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),
2668  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2669  fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2670  fhConeSumPtSubNormvsConeSumPtTotPhiCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2671  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCluster);
2672 
2673  fhConeSumPtSubvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCluster",
2674  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),
2675  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2676  fhConeSumPtSubvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2677  fhConeSumPtSubvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2678  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCluster);
2679 
2680  fhConeSumPtSubNormvsConeSumPtTotEtaCluster = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCluster",
2681  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),
2682  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2683  fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2684  fhConeSumPtSubNormvsConeSumPtTotEtaCluster->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2685  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCluster);
2686 
2687  fhConeSumPtVSUEClusterEtaBand = new TH2F("hConeSumPtVSUEClusterEtaBand",
2688  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for cluster (before normalization), R=%2.2f",r),
2689  nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);
2690  fhConeSumPtVSUEClusterEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2691  fhConeSumPtVSUEClusterEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2692  outputContainer->Add(fhConeSumPtVSUEClusterEtaBand);
2693 
2694  fhConeSumPtVSUEClusterPhiBand = new TH2F("hConeSumPtVSUEClusterPhiBand",
2695  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for cluster (before normalization), R=%2.2f",r),
2696  nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);
2697  fhConeSumPtVSUEClusterPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2698  fhConeSumPtVSUEClusterPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2699  outputContainer->Add(fhConeSumPtVSUEClusterPhiBand);
2700 
2702  {
2703  fhFractionCellOutConeEta = new TH2F("hFractionCellOutConeEta",
2704  Form("Fraction of the isolation cone #it{R} = %2.2f, out of cells #eta acceptance",r),
2705  nptbins,ptmin,ptmax,100,0,1);
2706  fhFractionCellOutConeEta->SetYTitle("#it{fraction}");
2707  fhFractionCellOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
2708  outputContainer->Add(fhFractionCellOutConeEta) ;
2709 
2710  fhFractionCellOutConeEtaTrigEtaPhi = new TH2F("hFractionCellOutConeEtaTrigEtaPhi",
2711  Form("Fraction of the isolation cone #it{R} = %2.2f, out of cells #eta acceptance, in trigger #eta-#phi ",r),
2712  netabins,etamin,etamax,nphibins,phimin,phimax);
2713  fhFractionCellOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
2714  fhFractionCellOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
2715  fhFractionCellOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2716  outputContainer->Add(fhFractionCellOutConeEtaTrigEtaPhi) ;
2717 
2718  fhFractionCellOutConePhi = new TH2F("hFractionCellOutConePhi",
2719  Form("Fraction of the isolation cone #it{R} = %2.2f, out of cells #phi acceptance",r),
2720  nptbins,ptmin,ptmax,100,0,1);
2721  fhFractionCellOutConePhi->SetYTitle("#it{fraction}");
2722  fhFractionCellOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
2723  outputContainer->Add(fhFractionCellOutConePhi) ;
2724 
2725  fhFractionCellOutConePhiTrigEtaPhi = new TH2F("hFractionCellOutConePhiTrigEtaPhi",
2726  Form("Fraction of the isolation cone #it{R} = %2.2f, out of cells #phi acceptance, in trigger #eta-#phi ",r),
2727  netabins,etamin,etamax,nphibins,phimin,phimax);
2728  fhFractionCellOutConePhiTrigEtaPhi->SetZTitle("#it{fraction}");
2729  fhFractionCellOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
2730  fhFractionCellOutConePhiTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2731  outputContainer->Add(fhFractionCellOutConePhiTrigEtaPhi) ;
2732 
2733 
2734  fhConeSumPtSubvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubvsConeSumPtTotPhiCell",
2735  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),
2736  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2737  fhConeSumPtSubvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2738  fhConeSumPtSubvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2739  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiCell);
2740 
2741  fhConeSumPtSubNormvsConeSumPtTotPhiCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiCell",
2742  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),
2743  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2744  fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2745  fhConeSumPtSubNormvsConeSumPtTotPhiCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2746  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiCell);
2747 
2748  fhConeSumPtSubvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubvsConeSumPtTotEtaCell",
2749  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),
2750  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2751  fhConeSumPtSubvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2752  fhConeSumPtSubvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2753  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaCell);
2754 
2755  fhConeSumPtSubNormvsConeSumPtTotEtaCell = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaCell",
2756  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),
2757  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2758  fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2759  fhConeSumPtSubNormvsConeSumPtTotEtaCell->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2760  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaCell);
2761  }
2762  }
2763  }
2764 
2765  // Track only histograms
2766  if(GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyNeutral)
2767  {
2768  fhConeSumPtTrack = new TH2F("hConePtSumTrack",
2769  Form("Track #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2770  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2771  fhConeSumPtTrack->SetYTitle("#Sigma #it{p}_{T}");
2772  fhConeSumPtTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2773  outputContainer->Add(fhConeSumPtTrack) ;
2774 
2775  fhConePtLeadTrack = new TH2F("hConeLeadPtTrack",
2776  Form("Track leading in isolation cone for #it{R} = %2.2f",r),
2777  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2778  fhConePtLeadTrack->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
2779  fhConePtLeadTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2780  outputContainer->Add(fhConePtLeadTrack) ;
2781 
2782  fhPtTrackInCone = new TH2F("hPtTrackInCone",
2783  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f",r),
2784  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2785  fhPtTrackInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2786  fhPtTrackInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2787  outputContainer->Add(fhPtTrackInCone) ;
2788 
2789 
2791  {
2792  fhConeSumPtEtaBandUETrack = new TH2F("hConePtSumEtaBandUETrack",
2793  "#Sigma track #it{p}_{T} in UE Eta Band",
2794  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2795  fhConeSumPtEtaBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
2796  fhConeSumPtEtaBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2797  outputContainer->Add(fhConeSumPtEtaBandUETrack) ;
2798 
2799  fhConeSumPtPhiBandUETrack = new TH2F("hConePtSumPhiBandUETrack",
2800  "#Sigma track #it{p}_{T} in UE Phi Band",
2801  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax*8);
2802  fhConeSumPtPhiBandUETrack->SetYTitle("#Sigma #it{p}_{T}");
2803  fhConeSumPtPhiBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
2804  outputContainer->Add(fhConeSumPtPhiBandUETrack) ;
2805 
2806 
2807  fhConeSumPtEtaBandUETrackTrigEtaPhi = new TH2F("hConePtSumEtaBandUETrackTrigEtaPhi",
2808  "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Eta Band",
2809  netabins,etamin,etamax,nphibins,phimin,phimax);
2810  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2811  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2812  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2813  outputContainer->Add(fhConeSumPtEtaBandUETrackTrigEtaPhi) ;
2814 
2815  fhConeSumPtPhiBandUETrackTrigEtaPhi = new TH2F("hConePtSumPhiBandUETrackTrigEtaPhi",
2816  "Trigger #eta vs #phi, #Sigma track #it{p}_{T} in UE Phi Band",
2817  netabins,etamin,etamax,nphibins,phimin,phimax);
2818  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2819  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2820  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2821  outputContainer->Add(fhConeSumPtPhiBandUETrackTrigEtaPhi) ;
2822 
2823  fhEtaBandTrack = new TH2F("hEtaBandTrack",
2824  Form("#eta vs #phi of tracks in #eta band isolation cone for #it{R} = %2.2f",r),
2825  netabins,-1,1,nphibins,0,TMath::TwoPi());
2826  fhEtaBandTrack->SetXTitle("#eta");
2827  fhEtaBandTrack->SetYTitle("#phi");
2828  outputContainer->Add(fhEtaBandTrack) ;
2829 
2830  fhPhiBandTrack = new TH2F("hPhiBandTrack",
2831  Form("#eta vs #phi of tracks in #phi band isolation cone for #it{R} = %2.2f",r),
2832  netabins,-1,1,nphibins,0,TMath::TwoPi());
2833  fhPhiBandTrack->SetXTitle("#eta");
2834  fhPhiBandTrack->SetYTitle("#phi");
2835  outputContainer->Add(fhPhiBandTrack) ;
2836 
2837  fhConeSumPtEtaUESubTrack = new TH2F("hConeSumPtEtaUESubTrack",
2838  Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} = %2.2f",r),
2839  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2840  fhConeSumPtEtaUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
2841  fhConeSumPtEtaUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2842  outputContainer->Add(fhConeSumPtEtaUESubTrack) ;
2843 
2844  fhConeSumPtPhiUESubTrack = new TH2F("hConeSumPtPhiUESubTrack",
2845  Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} = %2.2f",r),
2846  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
2847  fhConeSumPtPhiUESubTrack->SetYTitle("#Sigma #it{p}_{T}");
2848  fhConeSumPtPhiUESubTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2849  outputContainer->Add(fhConeSumPtPhiUESubTrack) ;
2850 
2851  fhConeSumPtEtaUESubTrackTrigEtaPhi = new TH2F("hConeSumPtEtaUESubTrackTrigEtaPhi",
2852  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),
2853  netabins,etamin,etamax,nphibins,phimin,phimax);
2854  fhConeSumPtEtaUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2855  fhConeSumPtEtaUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2856  fhConeSumPtEtaUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2857  outputContainer->Add(fhConeSumPtEtaUESubTrackTrigEtaPhi) ;
2858 
2859  fhConeSumPtPhiUESubTrackTrigEtaPhi = new TH2F("hConeSumPtPhiUESubTrackTrigEtaPhi",
2860  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),
2861  netabins,etamin,etamax,nphibins,phimin,phimax);
2862  fhConeSumPtPhiUESubTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
2863  fhConeSumPtPhiUESubTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
2864  fhConeSumPtPhiUESubTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2865  outputContainer->Add(fhConeSumPtPhiUESubTrackTrigEtaPhi) ;
2866 
2867  fhFractionTrackOutConeEta = new TH2F("hFractionTrackOutConeEta",
2868  Form("Fraction of the isolation cone #it{R} = %2.2f, out of tracks #eta acceptance",r),
2869  nptbins,ptmin,ptmax,100,0,1);
2870  fhFractionTrackOutConeEta->SetYTitle("#it{fraction}");
2871  fhFractionTrackOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
2872  outputContainer->Add(fhFractionTrackOutConeEta) ;
2873 
2874  fhFractionTrackOutConeEtaTrigEtaPhi = new TH2F("hFractionTrackOutConeEtaTrigEtaPhi",
2875  Form("Fraction of the isolation cone #it{R} = %2.2f, out of tracks #eta acceptance, in trigger #eta-#phi ",r),
2876  netabins,etamin,etamax,nphibins,phimin,phimax);
2877  fhFractionTrackOutConeEtaTrigEtaPhi->SetZTitle("#it{fraction}");
2878  fhFractionTrackOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
2879  fhFractionTrackOutConeEtaTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
2880  outputContainer->Add(fhFractionTrackOutConeEtaTrigEtaPhi) ;
2881 
2882  fhConeSumPtSubvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubvsConeSumPtTotPhiTrack",
2883  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),
2884  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2885  fhConeSumPtSubvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2886  fhConeSumPtSubvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2887  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotPhiTrack);
2888 
2889  fhConeSumPtSubNormvsConeSumPtTotPhiTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotPhiTrack",
2890  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),
2891  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2892  fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2893  fhConeSumPtSubNormvsConeSumPtTotPhiTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2894  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotPhiTrack);
2895 
2896  fhConeSumPtSubvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubvsConeSumPtTotEtaTrack",
2897  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),
2898  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2899  fhConeSumPtSubvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2900  fhConeSumPtSubvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
2901  outputContainer->Add(fhConeSumPtSubvsConeSumPtTotEtaTrack);
2902 
2903  fhConeSumPtSubNormvsConeSumPtTotEtaTrack = new TH2F("hConeSumPtSubNormvsConeSumPtTotEtaTrack",
2904  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),
2905  nptsumbins,ptsummin,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
2906  fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetXTitle("#Sigma #it{p}_{T, tot} (GeV/#it{c})");
2907  fhConeSumPtSubNormvsConeSumPtTotEtaTrack->SetYTitle("#Sigma #it{p}_{T, sub norm} (GeV/#it{c})");
2908  outputContainer->Add(fhConeSumPtSubNormvsConeSumPtTotEtaTrack);
2909 
2910 
2911  // UE in perpendicular cone
2912  fhPerpConeSumPt = new TH2F("hPerpConePtSum",
2913  Form("#Sigma #it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} = %2.2f",r),
2914  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
2915  fhPerpConeSumPt->SetYTitle("#Sigma #it{p}_{T}");
2916  fhPerpConeSumPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2917  outputContainer->Add(fhPerpConeSumPt) ;
2918 
2919  fhPtInPerpCone = new TH2F("hPtInPerpCone",
2920  Form("#it{p}_{T} in isolation cone at #pm 45 degree phi from trigger particle, #it{R} = %2.2f",r),
2921  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
2922  fhPtInPerpCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
2923  fhPtInPerpCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2924  outputContainer->Add(fhPtInPerpCone) ;
2925 
2926  fhEtaPhiTrack= new TH2F("hEtaPhiTrack",
2927  Form("#eta vs #phi of all Tracks"),
2928  netabins,-1,1,nphibins,0,TMath::TwoPi());
2929  fhEtaPhiTrack->SetXTitle("#eta");
2930  fhEtaPhiTrack->SetYTitle("#phi");
2931  outputContainer->Add(fhEtaPhiTrack) ;
2932 
2933  fhEtaPhiInConeTrack= new TH2F("hEtaPhiInConeTrack",
2934  Form("#eta vs #phi of Tracks in cone for #it{R} = %2.2f",r),
2935  netabins,-1,1,nphibins,0,TMath::TwoPi());
2936  fhEtaPhiInConeTrack->SetXTitle("#eta");
2937  fhEtaPhiInConeTrack->SetYTitle("#phi");
2938  outputContainer->Add(fhEtaPhiInConeTrack) ;
2939 
2940  fhConeSumPtVSUETracksEtaBand = new TH2F("hConeSumPtVSUETracksEtaBand",
2941  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in eta band for tracks (before normalization), R=%2.2f",r),
2942  nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);
2943  fhConeSumPtVSUETracksEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2944  fhConeSumPtVSUETracksEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2945  outputContainer->Add(fhConeSumPtVSUETracksEtaBand);
2946 
2947  fhConeSumPtVSUETracksPhiBand = new TH2F("hConeSumPtVSUETracksPhiBand",
2948  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in phi band for tracks (before normalization), R=%2.2f",r),
2949  nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);
2950  fhConeSumPtVSUETracksPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
2951  fhConeSumPtVSUETracksPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
2952  outputContainer->Add(fhConeSumPtVSUETracksPhiBand);
2953  }
2954  }
2955 
2956  if(GetIsolationCut()->GetParticleTypeInCone()==AliIsolationCut::kNeutralAndCharged )
2957  {
2958  fhConeSumPtClustervsTrack = new TH2F("hConePtSumClustervsTrack",
2959  Form("Track vs Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2960  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2961  fhConeSumPtClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
2962  fhConeSumPtClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
2963  outputContainer->Add(fhConeSumPtClustervsTrack) ;
2964 
2965  fhConeSumPtClusterTrackFrac = new TH2F("hConePtSumClusterTrackFraction",
2966  Form("#Sigma #it{p}_{T}^{cluster}/#Sigma #it{p}_{T}^{track} in isolation cone for #it{R} = %2.2f",r),
2967  nptbins,ptmin,ptmax,200,0,5);
2968  fhConeSumPtClusterTrackFrac->SetYTitle("#Sigma #it{p}^{cluster}_{T} /#Sigma #it{p}_{T}^{track}");
2969  fhConeSumPtClusterTrackFrac->SetXTitle("#it{p}^{trigger}_{T} (GeV/#it{c})");
2970  outputContainer->Add(fhConeSumPtClusterTrackFrac) ;
2971 
2972 
2973  fhConePtLeadClustervsTrack = new TH2F("hConePtLeadClustervsTrack",
2974  Form("Track vs Cluster lead #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2975  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2976  fhConePtLeadClustervsTrack->SetXTitle("#it{p}^{leading cluster}_{T} (GeV/#it{c})");
2977  fhConePtLeadClustervsTrack->SetYTitle("#it{p}^{leading track}_{T} (GeV/#it{c})");
2978  outputContainer->Add(fhConePtLeadClustervsTrack) ;
2979 
2980  fhConePtLeadClusterTrackFrac = new TH2F("hConePtLeadClusterTrackFraction",
2981  Form(" #it{p}^{leading cluster}_{T}/#it{p}^{leading track}_{T} in isolation cone for #it{R} = %2.2f",r),
2982  nptbins,ptmin,ptmax,200,0,5);
2983  fhConePtLeadClusterTrackFrac->SetYTitle("#it{p}^{leading cluster}_{T}/ #it{p}^{leading track}_{T}");
2984  fhConePtLeadClusterTrackFrac->SetXTitle("#it{p}^{trigger}_{T} (GeV/#it{c})");
2985  outputContainer->Add(fhConePtLeadClusterTrackFrac) ;
2986 
2987 
2989  {
2990  fhConeSumPtCellvsTrack = new TH2F("hConePtSumCellvsTrack",
2991  Form("Track vs cell #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2992  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
2993  fhConeSumPtCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
2994  fhConeSumPtCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
2995  outputContainer->Add(fhConeSumPtCellvsTrack) ;
2996 
2997  fhConeSumPtCellTrack = new TH2F("hConePtSumCellTrack",
2998  Form("Track and Cell #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
2999  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
3000  fhConeSumPtCellTrack->SetYTitle("#Sigma #it{p}_{T}");
3001  fhConeSumPtCellTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
3002  outputContainer->Add(fhConeSumPtCellTrack) ;
3003 
3004  fhConeSumPtCellTrackTrigEtaPhi = new TH2F("hConePtSumCellTrackTrigEtaPhi",
3005  Form("Trigger #eta vs #phi, #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",r),
3006  netabins,etamin,etamax,nphibins,phimin,phimax);
3007  fhConeSumPtCellTrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
3008  fhConeSumPtCellTrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
3009  fhConeSumPtCellTrackTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
3010  outputContainer->Add(fhConeSumPtCellTrackTrigEtaPhi) ;
3011  }
3012 
3014  {
3015  fhConeSumPtEtaUESub = new TH2F("hConeSumPtEtaUESub",
3016  Form("#Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} = %2.2f",r),
3017  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
3018  fhConeSumPtEtaUESub->SetYTitle("#Sigma #it{p}_{T}");
3019  fhConeSumPtEtaUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3020  outputContainer->Add(fhConeSumPtEtaUESub) ;
3021 
3022  fhConeSumPtPhiUESub = new TH2F("hConeSumPtPhiUESub",
3023  Form("#Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} = %2.2f",r),
3024  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
3025  fhConeSumPtPhiUESub->SetYTitle("#Sigma #it{p}_{T}");
3026  fhConeSumPtPhiUESub->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3027  outputContainer->Add(fhConeSumPtPhiUESub) ;
3028 
3029  fhConeSumPtEtaUESubTrigEtaPhi = new TH2F("hConeSumPtEtaUESubTrigEtaPhi",
3030  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),
3031  netabins,etamin,etamax,nphibins,phimin,phimax);
3032  fhConeSumPtEtaUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
3033  fhConeSumPtEtaUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
3034  fhConeSumPtEtaUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
3035  outputContainer->Add(fhConeSumPtEtaUESubTrigEtaPhi) ;
3036 
3037  fhConeSumPtPhiUESubTrigEtaPhi = new TH2F("hConeSumPtPhiUESubTrigEtaPhi",
3038  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),
3039  netabins,etamin,etamax,nphibins,phimin,phimax);
3040  fhConeSumPtPhiUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
3041  fhConeSumPtPhiUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
3042  fhConeSumPtPhiUESubTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
3043  outputContainer->Add(fhConeSumPtPhiUESubTrigEtaPhi) ;
3044 
3045  fhConeSumPtEtaUESubClustervsTrack = new TH2F("hConePtSumEtaUESubClustervsTrack",
3046  Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} = %2.2f",r),
3047  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3048  fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3049  fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3050  outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
3051 
3052  fhConeSumPtPhiUESubClustervsTrack = new TH2F("hConePhiUESubPtSumClustervsTrack",
3053  Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} = %2.2f",r),
3054  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3055  fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3056  fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3057  outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
3058 
3059  fhEtaBandClustervsTrack = new TH2F("hEtaBandClustervsTrack",
3060  Form("Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} = %2.2f",r),
3061  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3062  fhEtaBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3063  fhEtaBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3064  outputContainer->Add(fhEtaBandClustervsTrack) ;
3065 
3066  fhPhiBandClustervsTrack = new TH2F("hPhiBandClustervsTrack",
3067  Form("Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} = %2.2f",r),
3068  nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
3069  fhPhiBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3070  fhPhiBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3071  outputContainer->Add(fhPhiBandClustervsTrack) ;
3072 
3073  fhEtaBandNormClustervsTrack = new TH2F("hEtaBandNormClustervsTrack",
3074  Form("Track vs Cluster #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} = %2.2f",r),
3075  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3076  fhEtaBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3077  fhEtaBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3078  outputContainer->Add(fhEtaBandNormClustervsTrack) ;
3079 
3080  fhPhiBandNormClustervsTrack = new TH2F("hPhiBandNormClustervsTrack",
3081  Form("Track vs Cluster #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} = %2.2f",r),
3082  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3083  fhPhiBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3084  fhPhiBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3085  outputContainer->Add(fhPhiBandNormClustervsTrack) ;
3086 
3087  fhConeSumPtEtaUESubClustervsTrack = new TH2F("hConePtSumEtaUESubClustervsTrack",
3088  Form("Track vs Cluster #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} = %2.2f",r),
3089  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3090  fhConeSumPtEtaUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3091  fhConeSumPtEtaUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3092  outputContainer->Add(fhConeSumPtEtaUESubClustervsTrack) ;
3093 
3094  fhConeSumPtPhiUESubClustervsTrack = new TH2F("hConePhiUESubPtSumClustervsTrack",
3095  Form("Track vs Cluster #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} = %2.2f",r),
3096  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3097  fhConeSumPtPhiUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T} cluster");
3098  fhConeSumPtPhiUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3099  outputContainer->Add(fhConeSumPtPhiUESubClustervsTrack) ;
3100 
3102  {
3103 
3104  fhConeSumPtEtaUESubCellvsTrack = new TH2F("hConePtSumEtaUESubCellvsTrack",
3105  Form("Track vs Cell #Sigma #it{p}_{T} UE sub eta band in isolation cone for #it{R} = %2.2f",r),
3106  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3107  fhConeSumPtEtaUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3108  fhConeSumPtEtaUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3109  outputContainer->Add(fhConeSumPtEtaUESubCellvsTrack) ;
3110 
3111  fhConeSumPtPhiUESubCellvsTrack = new TH2F("hConePhiUESubPtSumCellvsTrack",
3112  Form("Track vs Cell #Sigma #it{p}_{T} UE sub phi band in isolation cone for #it{R} = %2.2f",r),
3113  2*nptsumbins,-ptsummax,ptsummax,2*nptsumbins,-ptsummax,ptsummax);
3114  fhConeSumPtPhiUESubCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3115  fhConeSumPtPhiUESubCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3116  outputContainer->Add(fhConeSumPtPhiUESubCellvsTrack) ;
3117 
3118  fhEtaBandCellvsTrack = new TH2F("hEtaBandCellvsTrack",
3119  Form("Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} = %2.2f",r),
3120  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3121  fhEtaBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3122  fhEtaBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3123  outputContainer->Add(fhEtaBandCellvsTrack) ;
3124 
3125  fhPhiBandCellvsTrack = new TH2F("hPhiBandCellvsTrack",
3126  Form("Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} = %2.2f",r),
3127  nptsumbins,ptsummin,ptsummax*4,nptsumbins,ptsummin,ptsummax*8);
3128  fhPhiBandCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3129  fhPhiBandCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3130  outputContainer->Add(fhPhiBandCellvsTrack) ;
3131 
3132  fhEtaBandNormCellvsTrack = new TH2F("hEtaBandNormCellvsTrack",
3133  Form("Track vs Cell #Sigma #it{p}_{T} in Eta band in isolation cone for #it{R} = %2.2f",r),
3134  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3135  fhEtaBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3136  fhEtaBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3137  outputContainer->Add(fhEtaBandNormCellvsTrack) ;
3138 
3139  fhPhiBandNormCellvsTrack = new TH2F("hPhiBandNormCellvsTrack",
3140  Form("Track vs Cell #Sigma #it{p}_{T} in Phi band in isolation cone for #it{R} = %2.2f",r),
3141  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
3142  fhPhiBandNormCellvsTrack->SetXTitle("#Sigma #it{p}_{T} cell");
3143  fhPhiBandNormCellvsTrack->SetYTitle("#Sigma #it{p}_{T} track");
3144  outputContainer->Add(fhPhiBandNormCellvsTrack) ;
3145 
3146  fhConeSumPtEtaUESubTrackCell = new TH2F("hConeSumPtEtaUESubTrackCell",
3147  Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from eta band in the isolation cone for #it{R} = %2.2f",r),
3148  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
3149  fhConeSumPtEtaUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
3150  fhConeSumPtEtaUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3151  outputContainer->Add(fhConeSumPtEtaUESubTrackCell) ;
3152 
3153  fhConeSumPtPhiUESubTrackCell = new TH2F("hConeSumPtPhiUESubTrackCell",
3154  Form("Tracks #Sigma #it{p}_{T} after bkg subtraction from phi band in the isolation cone for #it{R} = %2.2f",r),
3155  nptbins,ptmin,ptmax,2*nptsumbins,-ptsummax,ptsummax);
3156  fhConeSumPtPhiUESubTrackCell->SetYTitle("#Sigma #it{p}_{T}");
3157  fhConeSumPtPhiUESubTrackCell->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3158  outputContainer->Add(fhConeSumPtPhiUESubTrackCell) ;
3159 
3160  fhConeSumPtEtaUESubTrackCellTrigEtaPhi = new TH2F("hConeSumPtEtaUESubTrackCellTrigEtaPhi",
3161  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),
3162  netabins,etamin,etamax,nphibins,phimin,phimax);
3163  fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
3164  fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
3165  fhConeSumPtEtaUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
3166  outputContainer->Add(fhConeSumPtEtaUESubTrackCellTrigEtaPhi) ;
3167 
3168  fhConeSumPtPhiUESubTrackCellTrigEtaPhi = new TH2F("hConeSumPtPhiUESubTrackCellTrigEtaPhi",
3169  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),
3170  netabins,etamin,etamax,nphibins,phimin,phimax);
3171  fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
3172  fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetXTitle("#eta_{trigger}");
3173  fhConeSumPtPhiUESubTrackCellTrigEtaPhi->SetYTitle("#phi_{trigger} (rad)");
3174  outputContainer->Add(fhConeSumPtPhiUESubTrackCellTrigEtaPhi) ;
3175  }
3176  }
3177  }
3178 
3179  TString region[] = {"ITS","TPC","TRD","TOF","Top EMCal","In EMCal"}; // conversion regions
3180 
3181  for(Int_t iso = 0; iso < 2; iso++)
3182  {
3183  if(fFillTMHisto)
3184  {
3185  fhTrackMatchedDEta[iso] = new TH2F
3186  (Form("hTrackMatchedDEta%s",isoName[iso].Data()),
3187  Form("%s - d#eta of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
3188  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
3189  fhTrackMatchedDEta[iso]->SetYTitle("d#eta");
3190  fhTrackMatchedDEta[iso]->SetXTitle("E_{cluster} (GeV)");
3191 
3192  fhTrackMatchedDPhi[iso] = new TH2F
3193  (Form("hTrackMatchedDPhi%s",isoName[iso].Data()),
3194  Form("%s - d#phi of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
3195  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
3196  fhTrackMatchedDPhi[iso]->SetYTitle("d#phi (rad)");
3197  fhTrackMatchedDPhi[iso]->SetXTitle("E_{cluster} (GeV)");
3198 
3199  fhTrackMatchedDEtaDPhi[iso] = new TH2F
3200  (Form("hTrackMatchedDEtaDPhi%s",isoName[iso].Data()),
3201  Form("%s - d#eta vs d#phi of cluster-track, %s",isoTitle[iso].Data(),parTitle.Data()),
3202  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
3203  fhTrackMatchedDEtaDPhi[iso]->SetYTitle("d#phi (rad)");
3204  fhTrackMatchedDEtaDPhi[iso]->SetXTitle("d#eta");
3205 
3206  outputContainer->Add(fhTrackMatchedDEta[iso]) ;
3207  outputContainer->Add(fhTrackMatchedDPhi[iso]) ;
3208  outputContainer->Add(fhTrackMatchedDEtaDPhi[iso]) ;
3209 
3210  if(IsDataMC())
3211  {
3212  for(int imc = 0; imc < fgkNmcTypes; imc++)
3213  {
3214  fhTrackMatchedDEtaMC[imc][iso] = new TH2F(Form("hTrackMatchedDEta%s_MC%s",isoName[iso].Data(),mcPartName[imc].Data()),
3215  Form("%s - d#eta of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
3216  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
3217  fhTrackMatchedDEtaMC[imc][iso]->SetYTitle("d#eta");
3218  fhTrackMatchedDEtaMC[imc][iso]->SetXTitle("E_{cluster} (GeV)");
3219 
3220  fhTrackMatchedDPhiMC[imc][iso] = new TH2F(Form("hTrackMatchedDPhi%s_MC%s",isoName[iso].Data(),mcPartName[imc].Data()),
3221  Form("%s - d#phi of cluster-track vs cluster energy, %s",isoTitle[iso].Data(),parTitle.Data()),
3222  nptbins,ptmin,ptmax,nresetabins,resphimin,resphimax);
3223  fhTrackMatchedDPhiMC[imc][iso]->SetYTitle("d#phi");
3224  fhTrackMatchedDPhiMC[imc][iso]->SetXTitle("E_{cluster} (GeV)");
3225 
3226  fhTrackMatchedDEtaDPhiMC[imc][iso] = new TH2F
3227  (Form("hTrackMatchedDEtaDPhi%s_MC%s",isoName[iso].Data(),mcPartName[imc].Data()),
3228  Form("%s - d#eta vs d#phi of cluster-track, %s",isoTitle[iso].Data(),parTitle.Data()),
3229  nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
3230  fhTrackMatchedDEtaDPhiMC[imc][iso]->SetYTitle("d#phi (rad)");
3231  fhTrackMatchedDEtaDPhiMC[imc][iso]->SetXTitle("d#eta");
3232 
3233  outputContainer->Add(fhTrackMatchedDEtaMC[imc][iso]) ;
3234  outputContainer->Add(fhTrackMatchedDPhiMC[imc][iso]) ;
3235  outputContainer->Add(fhTrackMatchedDEtaDPhiMC[imc][iso]);
3236  }
3237 
3238  }
3239 
3240  fhdEdx[iso] = new TH2F
3241  (Form("hdEdx%s",isoName[iso].Data()),
3242  Form("%s - Matched track <d#it{E}/d#it{x}> vs cluster #it{E}, %s",isoTitle[iso].Data(),parTitle.Data()),
3243  nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
3244  fhdEdx[iso]->SetXTitle("#it{E} (GeV)");
3245  fhdEdx[iso]->SetYTitle("<d#it{E}/d#it{x}>");
3246  outputContainer->Add(fhdEdx[iso]);
3247 
3248  fhEOverP[iso] = new TH2F
3249  (Form("hEOverP%s",isoName[iso].Data()),
3250  Form("%s - Matched track #it{E}/#it{p} vs cluster, %s",isoTitle[iso].Data(),parTitle.Data()),
3251  nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
3252  fhEOverP[iso]->SetXTitle("#it{E} (GeV)");
3253  fhEOverP[iso]->SetYTitle("#it{E}/#it{p}");
3254  outputContainer->Add(fhEOverP[iso]);
3255 
3256  if(IsDataMC())
3257  {
3258  fhTrackMatchedMCParticle[iso] = new TH2F
3259  (Form("hTrackMatchedMCParticle%s",isoName[iso].Data()),
3260  Form("%s - Origin of particle vs cluster #it{E}, %s",isoTitle[iso].Data(),parTitle.Data()),
3261  nptbins,ptmin,ptmax,8,0,8);
3262  fhTrackMatchedMCParticle[iso]->SetXTitle("#it{E} (GeV)");
3263  //fhTrackMatchedMCParticle[iso]->SetYTitle("Particle type");
3264 
3265  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(1 ,"Photon");
3266  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(2 ,"Electron");
3267  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
3268  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(4 ,"Rest");
3269  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
3270  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
3271  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
3272  fhTrackMatchedMCParticle[iso]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
3273 
3274  outputContainer->Add(fhTrackMatchedMCParticle[iso]);
3275  }
3276  }
3277 
3278  if(fFillSSHisto)
3279  {
3280  fhELambda0[iso] = new TH2F
3281  (Form("hELambda0%s",isoName[iso].Data()),
3282  Form("%s cluster : #it{E} vs #lambda_{0}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3283  fhELambda0[iso]->SetYTitle("#lambda_{0}^{2}");
3284  fhELambda0[iso]->SetXTitle("#it{E} (GeV)");
3285  outputContainer->Add(fhELambda0[iso]) ;
3286 
3287 // fhELambda1[iso] = new TH2F
3288 // (Form("hELambda1%s",isoName[iso].Data()),
3289 // Form("%s cluster: #it{E} vs #lambda_{1}, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3290 // fhELambda1[iso]->SetYTitle("#lambda_{1}^{2}");
3291 // fhELambda1[iso]->SetXTitle("#it{E} (GeV)");
3292 // outputContainer->Add(fhELambda1[iso]) ;
3293 
3294  fhPtLambda0[iso] = new TH2F
3295  (Form("hPtLambda0%s",isoName[iso].Data()),
3296  Form("%s cluster : #it{p}_{T} vs #lambda_{0}, %s",isoTitle[iso].Data(), parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3297  fhPtLambda0[iso]->SetYTitle("#lambda_{0}^{2}");
3298  fhPtLambda0[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3299  outputContainer->Add(fhPtLambda0[iso]) ;
3300 
3301  if(IsDataMC())
3302  {
3303  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
3304  {
3305  fhPtLambda0MC[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%s",isoName[iso].Data(),mcPartName[imc].Data()),
3306  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3307  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3308  fhPtLambda0MC[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3309  fhPtLambda0MC[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3310  outputContainer->Add( fhPtLambda0MC[imc][iso]) ;
3311 
3312  fhPtLambda0MCConv[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%sConv",isoName[iso].Data(),mcPartName[imc].Data()),
3313  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, from conversion",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3314  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3315  fhPtLambda0MCConv[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3316  fhPtLambda0MCConv[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3317  outputContainer->Add( fhPtLambda0MCConv[imc][iso]) ;
3318 
3320  {
3321  fhPtLambda0MCWith1Overlap[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%s_1Overlap",isoName[iso].Data(),mcPartName[imc].Data()),
3322  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3323  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3324  fhPtLambda0MCWith1Overlap[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3325  fhPtLambda0MCWith1Overlap[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3326  outputContainer->Add( fhPtLambda0MCWith1Overlap[imc][iso]) ;
3327 
3328  fhPtLambda0MCConvWith1Overlap[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%sConv_1Overlap",isoName[iso].Data(),mcPartName[imc].Data()),
3329  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, from conversion, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3330  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3331  fhPtLambda0MCConvWith1Overlap[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3332  fhPtLambda0MCConvWith1Overlap[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3333  outputContainer->Add( fhPtLambda0MCConvWith1Overlap[imc][iso]) ;
3334 
3335  fhPtLambda0MCWithNOverlap[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%s_NOverlap",isoName[iso].Data(),mcPartName[imc].Data()),
3336  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3337  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3338  fhPtLambda0MCWithNOverlap[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3339  fhPtLambda0MCWithNOverlap[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3340  outputContainer->Add( fhPtLambda0MCWithNOverlap[imc][iso]) ;
3341 
3342  fhPtLambda0MCConvWithNOverlap[imc][iso] = new TH2F(Form("hPtLambda0%s_MC%sConv_NOverlap",isoName[iso].Data(),mcPartName[imc].Data()),
3343  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, from conversion, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3344  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3345  fhPtLambda0MCConvWithNOverlap[imc][iso]->SetYTitle("#lambda_{0}^{2}");
3346  fhPtLambda0MCConvWithNOverlap[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3347  outputContainer->Add( fhPtLambda0MCConvWithNOverlap[imc][iso]) ;
3348 
3349 
3350  fhPtNOverlap[imc][iso] = new TH2F(Form("hPtNOverlaps%s_MC%s_1Overlap",isoName[iso].Data(),mcPartName[imc].Data()),
3351  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3352  nptbins,ptmin,ptmax,10,0,10);
3353  fhPtNOverlap[imc][iso]->SetYTitle("#it{N} overlaps");
3354  fhPtNOverlap[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3355  outputContainer->Add( fhPtNOverlap[imc][iso]) ;
3356 
3357  fhPtNOverlapConv[imc][iso] = new TH2F(Form("hPtNOverlaps%s_MC%sConv_1Overlap",isoName[iso].Data(),mcPartName[imc].Data()),
3358  Form("%s cluster : #it{p}_{T} vs #lambda_{0}: %s %s, from conversion, 1 overlap",isoTitle[iso].Data(),mcPartType[imc].Data(),parTitle.Data()),
3359  nptbins,ptmin,ptmax,10,0,10);
3360  fhPtNOverlapConv[imc][iso]->SetYTitle("#it{N} overlaps");
3361  fhPtNOverlapConv[imc][iso]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3362  outputContainer->Add( fhPtNOverlapConv[imc][iso]) ;
3363  }
3364 
3365  }
3366  }
3367 
3369  {
3370  fhPtLambda0TRD[iso] = new TH2F
3371  (Form("hPtLambda0TRD%s",isoName[iso].Data()),
3372  Form("%s cluster: #it{p}_{T} vs #lambda_{0}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3373  fhPtLambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
3374  fhPtLambda0TRD[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3375  outputContainer->Add(fhPtLambda0TRD[iso]) ;
3376 
3377  fhELambda0TRD[iso] = new TH2F
3378  (Form("hELambda0TRD%s",isoName[iso].Data()),
3379  Form("%s cluster: #it{E} vs #lambda_{0}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3380  fhELambda0TRD[iso]->SetYTitle("#lambda_{0}^{2}");
3381  fhELambda0TRD[iso]->SetXTitle("#it{E} (GeV)");
3382  outputContainer->Add(fhELambda0TRD[iso]) ;
3383 
3384 // fhELambda1TRD[iso] = new TH2F
3385 // (Form("hELambda1TRD%s",isoName[iso].Data()),
3386 // Form("%s cluster: #it{E} vs #lambda_{1}, SM behind TRD, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3387 // fhELambda1TRD[iso]->SetYTitle("#lambda_{1}^{2}");
3388 // fhELambda1TRD[iso]->SetXTitle("#it{E} (GeV)");
3389 // outputContainer->Add(fhELambda1TRD[iso]) ;
3390  }
3391 
3392  if(fFillNLMHistograms)
3393  {
3394  fhNLocMax[iso] = new TH2F
3395  (Form("hNLocMax%s",isoName[iso].Data()),
3396  Form("%s - Number of local maxima in cluster, %s",isoTitle[iso].Data(),parTitle.Data()),
3397  nptbins,ptmin,ptmax,10,0,10);
3398  fhNLocMax[iso]->SetYTitle("#it{NLM}");
3399  fhNLocMax[iso]->SetXTitle("#it{E} (GeV)");
3400  outputContainer->Add(fhNLocMax[iso]) ;
3401 
3402  fhELambda0LocMax1[iso] = new TH2F
3403  (Form("hELambda0LocMax1%s",isoName[iso].Data()),
3404  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}=1, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3405  fhELambda0LocMax1[iso]->SetYTitle("#lambda_{0}^{2}");
3406  fhELambda0LocMax1[iso]->SetXTitle("#it{E} (GeV)");
3407  outputContainer->Add(fhELambda0LocMax1[iso]) ;
3408 
3409  fhELambda1LocMax1[iso] = new TH2F
3410  (Form("hELambda1LocMax1%s",isoName[iso].Data()),
3411  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}=1, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3412  fhELambda1LocMax1[iso]->SetYTitle("#lambda_{1}^{2}");
3413  fhELambda1LocMax1[iso]->SetXTitle("#it{E} (GeV)");
3414  outputContainer->Add(fhELambda1LocMax1[iso]) ;
3415 
3416  fhELambda0LocMax2[iso] = new TH2F
3417  (Form("hELambda0LocMax2%s",isoName[iso].Data()),
3418  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}=2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3419  fhELambda0LocMax2[iso]->SetYTitle("#lambda_{0}^{2}");
3420  fhELambda0LocMax2[iso]->SetXTitle("#it{E} (GeV)");
3421  outputContainer->Add(fhELambda0LocMax2[iso]) ;
3422 
3423  fhELambda1LocMax2[iso] = new TH2F
3424  (Form("hELambda1LocMax2%s",isoName[iso].Data()),
3425  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}=2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3426  fhELambda1LocMax2[iso]->SetYTitle("#lambda_{1}^{2}");
3427  fhELambda1LocMax2[iso]->SetXTitle("#it{E} (GeV)");
3428  outputContainer->Add(fhELambda1LocMax2[iso]) ;
3429 
3430  fhELambda0LocMaxN[iso] = new TH2F
3431  ( Form("hELambda0LocMaxN%s",isoName[iso].Data()),
3432  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{0}, #it{NLM}>2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3433  fhELambda0LocMaxN[iso]->SetYTitle("#lambda_{0}^{2}");
3434  fhELambda0LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
3435  outputContainer->Add(fhELambda0LocMaxN[iso]) ;
3436 
3437  fhELambda1LocMaxN[iso] = new TH2F
3438  (Form("hELambda1LocMaxN%s",isoName[iso].Data()),
3439  Form("%s cluster (#eta) pairs: #it{E} vs #lambda_{1}, #it{NLM}>2, %s",isoTitle[iso].Data(),parTitle.Data()),nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3440  fhELambda1LocMaxN[iso]->SetYTitle("#lambda_{1}^{2}");
3441  fhELambda1LocMaxN[iso]->SetXTitle("#it{E} (GeV)");
3442  outputContainer->Add(fhELambda1LocMaxN[iso]) ;
3443  } // NLM
3444  } // SS histo
3445 
3446 
3448  {
3449  for(Int_t ieta = 0; ieta < 4; ieta++)
3450  {
3451  for(Int_t iphi = 0; iphi < 3; iphi++)
3452  {
3453 // fhLam0EMCALRegion[iso][ieta][iphi] =
3454 // new TH2F(Form("hLam0_%s_eta%d_phi%d",isoName[iso].Data(),ieta,iphi),
3455 // Form("%s, cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, region eta %d, phi %d",
3456 // isoTitle[iso].Data(),ieta,iphi),
3457 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3458 // fhLam0EMCALRegion[iso][ieta][iphi]->SetYTitle("#lambda_{0}^{2}");
3459 // fhLam0EMCALRegion[iso][ieta][iphi]->SetXTitle("#it{p}_{T} (GeV)");
3460 // outputContainer->Add(fhLam0EMCALRegion[iso][ieta][iphi]) ;
3461 //
3462 // if(GetFirstSMCoveredByTRD() >= 0)
3463 // {
3464 // fhLam0EMCALRegionTRD[iso][ieta][iphi] =
3465 // new TH2F(Form("hLam0TRD_%s_eta%d_phi%d",isoName[iso].Data(),ieta,iphi),
3466 // Form("%s, cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, region eta %d, phi %d, SM covered by TRD",
3467 // isoTitle[iso].Data(),ieta,iphi),
3468 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3469 // fhLam0EMCALRegionTRD[iso][ieta][iphi]->SetYTitle("#lambda_{0}^{2}");
3470 // fhLam0EMCALRegionTRD[iso][ieta][iphi]->SetXTitle("#it{p}_{T} (GeV)");
3471 // outputContainer->Add(fhLam0EMCALRegionTRD[iso][ieta][iphi]) ;
3472 // } // TRD
3473 
3474  for(Int_t ism = 0; ism < GetCaloUtils()->GetNumberOfSuperModulesUsed(); ism++)
3475  {
3476  fhLam0EMCALRegionPerSM[iso][ieta][iphi][ism] =
3477  new TH2F(Form("hLam0_%s_eta%d_phi%d_sm%d",isoName[iso].Data(),ieta,iphi,ism),
3478  Form("%s, cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, sm %d, region eta %d, phi %d",
3479  isoTitle[iso].Data(),ism,ieta,iphi),
3480  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3481  fhLam0EMCALRegionPerSM[iso][ieta][iphi][ism]->SetYTitle("#lambda_{0}^{2}");
3482  fhLam0EMCALRegionPerSM[iso][ieta][iphi][ism]->SetXTitle("#it{p}_{T} (GeV)");
3483  outputContainer->Add(fhLam0EMCALRegionPerSM[iso][ieta][iphi][ism]) ;
3484  } // ism
3485  } // iphi
3486  } // ieta
3487 
3488  Float_t ptLimit[] = {2,3,4,5,6,8,10,12};
3489  for(Int_t ipt = 0; ipt < 7; ipt++)
3490  {
3491  fhEtaPhiLam0BinPtBin[iso][ipt] = new TH2F
3492  (Form("hEtaPhiLam0BinPtBin%d%s",ipt,isoName[iso].Data()),
3493  Form("%s, #eta vs #phi in #it{p}_{T}=[%2.1f,%2.1f] GeV/#it{c} and #lambda^{2}_{0}=[0.3,0.4]",
3494  isoTitle[iso].Data(),ptLimit[ipt],ptLimit[ipt+1]),
3495  netabins,etamin,etamax,nphibins,phimin,phimax);
3496  fhEtaPhiLam0BinPtBin[iso][ipt]->SetYTitle("#phi (rad)");
3497  fhEtaPhiLam0BinPtBin[iso][ipt]->SetXTitle("#eta");
3498  outputContainer->Add(fhEtaPhiLam0BinPtBin[iso][ipt]) ;
3499  }
3500  } // regions in EMCal
3501 
3502  if(IsDataMC())
3503  {
3504  fhMCConversionVertex[iso] = new TH2F(Form("hMCPhotonConversionVertex%s",isoName[iso].Data()),
3505  Form("%s, cluster from converted photon, #it{p}_{T} vs vertex distance, %s",
3506  isoTitle[iso].Data(),parTitle.Data()),
3507  nptbins,ptmin,ptmax,500,0,500);
3508  fhMCConversionVertex[iso]->SetYTitle("#it{R} (cm)");
3509  fhMCConversionVertex[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3510  outputContainer->Add(fhMCConversionVertex[iso]) ;
3511 
3512  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
3513  {
3514  fhMCConversionVertexTRD[iso] = new TH2F(Form("hMCPhotonConversionVertexTRD%s",isoName[iso].Data()),
3515  Form("%s, cluster from converted photon, #it{p}_{T} vs vertex distance, %s, SM covered by TRD",
3516  isoTitle[iso].Data(),parTitle.Data()),
3517  nptbins,ptmin,ptmax,500,0,500);
3518  fhMCConversionVertexTRD[iso]->SetYTitle("#it{R} (cm)");
3519  fhMCConversionVertexTRD[iso]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3520  outputContainer->Add(fhMCConversionVertexTRD[iso]) ;
3521  }
3522 
3523  if(fFillSSHisto)
3524  {
3525  for(Int_t iR = 0; iR < 6; iR++)
3526  {
3527  fhMCConversionLambda0Rcut[iR][iso] = new TH2F(Form("hMCPhotonConversionLambda0%s_R%d",isoName[iso].Data(),iR),
3528  Form("%s, cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s",
3529  isoTitle[iso].Data(),region[iR].Data()),
3530  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3531  fhMCConversionLambda0Rcut[iR][iso]->SetYTitle("#lambda_{0}^{2}");
3532  fhMCConversionLambda0Rcut[iR][iso]->SetXTitle("#it{p}_{T} (GeV)");
3533  outputContainer->Add(fhMCConversionLambda0Rcut[iR][iso]) ;
3534 
3535  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0)
3536  {
3537  fhMCConversionLambda0RcutTRD[iR][iso] = new TH2F(Form("hMCPhotonConversionLambda0TRD%s_R%d",isoName[iso].Data(),iR),
3538  Form("%s, cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, SM covered by TRD",
3539  isoTitle[iso].Data(),region[iR].Data()),
3540  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3541  fhMCConversionLambda0RcutTRD[iR][iso]->SetYTitle("#lambda_{0}^{2}");
3542  fhMCConversionLambda0RcutTRD[iR][iso]->SetXTitle("#it{p}_{T} (GeV)");
3543  outputContainer->Add(fhMCConversionLambda0RcutTRD[iR][iso]) ;
3544  }
3545  }
3546 
3547 // if(GetCalorimeter() == kEMCAL && fFillEMCALRegionSSHistograms)
3548 // {
3549 // for(Int_t ieta = 0; ieta < 4; ieta++)
3550 // {
3551 // for(Int_t iphi = 0; iphi < 3; iphi++)
3552 // {
3553 // for(Int_t iReg = 0; iReg < 6; iReg++)
3554 // {
3555 // fhLam0EMCALRegionMCConvRcut[iso][ieta][iphi][iReg] =
3556 // new TH2F(Form("hMCPhotonConversionLambda0%s_R%d_eta%d_phi%d",isoName[iso].Data(),iReg,ieta,iphi),
3557 // Form("%s,cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, region eta %d, phi %d",
3558 // isoTitle[iso].Data(),region[iReg].Data(),ieta,iphi),
3559 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3560 // fhLam0EMCALRegionMCConvRcut[iso][ieta][iphi][iReg]->SetYTitle("#lambda_{0}^{2}");
3561 // fhLam0EMCALRegionMCConvRcut[iso][ieta][iphi][iReg]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3562 // outputContainer->Add(fhLam0EMCALRegionMCConvRcut[iso][ieta][iphi][iReg]) ;
3563 //
3564 // if(GetFirstSMCoveredByTRD() >= 0)
3565 // {
3566 // fhLam0EMCALRegionTRDMCConvRcut[iso][ieta][iphi][iReg] =
3567 // new TH2F(Form("hMCPhotonConversionLambda0TRD%s_R%d_eta%d_phi%d",isoName[iso].Data(),iReg,ieta,iphi),
3568 // Form("%s,cluster from converted photon, #it{p}_{T} vs #lambda_{0}^{2}, conversion in %s, region eta %d, phi %d, SM covered by TRD",
3569 // isoTitle[iso].Data(),region[iReg].Data(),ieta,iphi),
3570 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3571 // fhLam0EMCALRegionTRDMCConvRcut[iso][ieta][iphi][iReg]->SetYTitle("#lambda_{0}^{2}");
3572 // fhLam0EMCALRegionTRDMCConvRcut[iso][ieta][iphi][iReg]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3573 // outputContainer->Add(fhLam0EMCALRegionTRDMCConvRcut[iso][ieta][iphi][iReg]) ;
3574 // } // TRD
3575 //
3576 // } // iR
3577 // } // iphi
3578 // } // ieta
3579 // } // regions in EMCal
3580 
3581 
3582  } // Shower shape histograms
3583  }
3584  } // control histograms for isolated and non isolated objects
3585 
3586 
3587  if(IsPileUpAnalysisOn())
3588  {
3589  fhPtTrackInConeOtherBC = new TH2F("hPtTrackInConeOtherBC",
3590  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f, TOF from BC!=0",r),
3591  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3592  fhPtTrackInConeOtherBC->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3593  fhPtTrackInConeOtherBC->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3594  outputContainer->Add(fhPtTrackInConeOtherBC) ;
3595 
3596  fhPtTrackInConeOtherBCPileUpSPD = new TH2F("hPtTrackInConeOtherBCPileUpSPD",
3597  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f, TOF from BC!=0, pile-up from SPD",r),
3598  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3599  fhPtTrackInConeOtherBCPileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3600  fhPtTrackInConeOtherBCPileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3601  outputContainer->Add(fhPtTrackInConeOtherBCPileUpSPD) ;
3602 
3603  fhPtTrackInConeBC0 = new TH2F("hPtTrackInConeBC0",
3604  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f, TOF from BC==0",r),
3605  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3606  fhPtTrackInConeBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3607  fhPtTrackInConeBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3608  outputContainer->Add(fhPtTrackInConeBC0) ;
3609 
3610  fhPtTrackInConeVtxBC0 = new TH2F("hPtTrackInConeVtxBC0",
3611  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f, TOF from BC==0",r),
3612  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3613  fhPtTrackInConeVtxBC0->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3614  fhPtTrackInConeVtxBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3615  outputContainer->Add(fhPtTrackInConeVtxBC0) ;
3616 
3617 
3618  fhPtTrackInConeBC0PileUpSPD = new TH2F("hPtTrackInConeBC0PileUpSPD",
3619  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f, TOF from BC==0, pile-up from SPD",r),
3620  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3621  fhPtTrackInConeBC0PileUpSPD->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3622  fhPtTrackInConeBC0PileUpSPD->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3623  outputContainer->Add(fhPtTrackInConeBC0PileUpSPD) ;
3624 
3625 
3626  for (Int_t i = 0; i < 7 ; i++)
3627  {
3628  fhPtInConePileUp[i] = new TH2F(Form("hPtInConePileUp%s",pileUpName[i].Data()),
3629  Form("#it{p}_{T} in isolation cone for #it{R} = %2.2f, from pile-up (%s)",r,pileUpName[i].Data()),
3630  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3631  fhPtInConePileUp[i]->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
3632  fhPtInConePileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3633  outputContainer->Add(fhPtInConePileUp[i]) ;
3634  }
3635  }
3636 
3637  if(IsDataMC())
3638  {
3639  // For histograms in arrays, index in the array, corresponding to any particle origin
3640 
3641  for(Int_t i = 0; i < fgkNmcPrimTypes; i++)
3642  {
3643  fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
3644  Form("primary photon %s : #it{E}, %s",pptype[i].Data(),parTitle.Data()),
3645  nptbins,ptmin,ptmax);
3646  fhEPrimMC[i]->SetXTitle("#it{E} (GeV)");
3647  outputContainer->Add(fhEPrimMC[i]) ;
3648 
3649  fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
3650  Form("primary photon %s : #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
3651  nptbins,ptmin,ptmax);
3652  fhPtPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3653  outputContainer->Add(fhPtPrimMC[i]) ;
3654 
3655  fhPtPrimMCiso[i] = new TH1F(Form("hPtPrim_MCiso%s",ppname[i].Data()),
3656  Form("primary isolated photon %s : #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
3657  nptbins,ptmin,ptmax);
3658  fhPtPrimMCiso[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3659  outputContainer->Add(fhPtPrimMCiso[i]) ;
3660 
3661  fhEtaPrimMC[i] = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
3662  Form("primary photon %s : #eta vs #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
3663  nptbins,ptmin,ptmax,200,-2,2);
3664  fhEtaPrimMC[i]->SetYTitle("#eta");
3665  fhEtaPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3666  outputContainer->Add(fhEtaPrimMC[i]) ;
3667 
3668  fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
3669  Form("primary photon %s : #phi vs #it{p}_{T}, %s",pptype[i].Data(),parTitle.Data()),
3670  nptbins,ptmin,ptmax,200,0.,TMath::TwoPi());
3671  fhPhiPrimMC[i]->SetYTitle("#phi");
3672  fhPhiPrimMC[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3673  outputContainer->Add(fhPhiPrimMC[i]) ;
3674  }
3675 
3677  {
3678  fhPtPrimMCPi0DecayPairAcceptInConeLowPt = new TH1F("hPtPrim_MCPhotonPi0DecayPairAcceptInConeLowPt",
3679  Form("primary photon %s : #it{p}_{T}, pair in cone, %s",pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3680  nptbins,ptmin,ptmax);
3681  fhPtPrimMCPi0DecayPairAcceptInConeLowPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3682  outputContainer->Add(fhPtPrimMCPi0DecayPairAcceptInConeLowPt) ;
3683 
3684  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPt = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairAcceptInConeLowPt",
3685  Form("isolated primary photon %s, pair in cone : #it{p}_{T}, %s",
3686  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3687  nptbins,ptmin,ptmax);
3688  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3689  outputContainer->Add(fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPt) ;
3690 
3691  fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlap = new TH1F("hPtPrim_MCPhotonPi0DecayPairAcceptInConeLowPtNoOverlap",
3692  Form("primary photon %s, no overlap, pair in cone : #it{p}_{T}, %s",
3693  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3694  nptbins,ptmin,ptmax);
3695  fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3696  outputContainer->Add(fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlap) ;
3697 
3698  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlap = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairAcceptInConeLowPtNoOverlap",
3699  Form("isolated primary photon %s, pair in cone,no overlap : #it{p}_{T}, %s",
3700  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3701  nptbins,ptmin,ptmax);
3702  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3704 
3705  fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlapCaloE = new TH1F("hPtPrim_MCPhotonPi0DecayPairAcceptInConeLowPtNoOverlapCaloE",
3706  Form("primary photon %s, no overlap, pair in cone, E > calo min: #it{p}_{T}, %s",
3707  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3708  nptbins,ptmin,ptmax);
3709  fhPtPrimMCPi0DecayPairAcceptInConeLowPtNoOverlapCaloE->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3711 
3712  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlapCaloE = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairAcceptInConeLowPtNoOverlapCaloE",
3713  Form("isolated primary photon %s, pair in cone,no overlap, E > calo min: #it{p}_{T}, %s",
3714  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3715  nptbins,ptmin,ptmax);
3716  fhPtPrimMCPi0DecayIsoPairAcceptInConeLowPtNoOverlapCaloE->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3718 
3719 
3720  fhPtPrimMCPi0DecayPairNoOverlap = new TH1F("hPtPrim_MCPhotonPi0DecayPairNoOverlap",
3721  Form("primary photon %s, no overlap: #it{p}_{T}, %s",
3722  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3723  nptbins,ptmin,ptmax);
3724  fhPtPrimMCPi0DecayPairNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3725  outputContainer->Add(fhPtPrimMCPi0DecayPairNoOverlap) ;
3726 
3727  fhPtPrimMCPi0DecayIsoPairNoOverlap = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairNoOverlap",
3728  Form("isolated primary photon %s, no overlap: #it{p}_{T}, %s",
3729  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3730  nptbins,ptmin,ptmax);
3731  fhPtPrimMCPi0DecayIsoPairNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3732  outputContainer->Add(fhPtPrimMCPi0DecayIsoPairNoOverlap) ;
3733 
3734  fhPtPrimMCPi0DecayPairOutOfCone = new TH1F("hPtPrim_MCPhotonPi0DecayPairOutOfCone",
3735  Form("primary photon %s : #it{p}_{T}, pair out of cone, %s",pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3736  nptbins,ptmin,ptmax);
3737  fhPtPrimMCPi0DecayPairOutOfCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3738  outputContainer->Add(fhPtPrimMCPi0DecayPairOutOfCone) ;
3739 
3740  fhPtPrimMCPi0DecayIsoPairOutOfCone = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairOutOfCone",
3741  Form("isolated primary photon %s, pair out of cone : #it{p}_{T}, %s",
3742  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3743  nptbins,ptmin,ptmax);
3744  fhPtPrimMCPi0DecayIsoPairOutOfCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3745  outputContainer->Add(fhPtPrimMCPi0DecayIsoPairOutOfCone) ;
3746 
3747  fhPtPrimMCPi0DecayPairOutOfAcceptance = new TH1F("hPtPrim_MCPhotonPi0DecayPairOutOfAcceptance",
3748  Form("primary photon %s : #it{p}_{T}, pair out of acceptance, %s",pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3749  nptbins,ptmin,ptmax);
3750  fhPtPrimMCPi0DecayPairOutOfAcceptance->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3751  outputContainer->Add(fhPtPrimMCPi0DecayPairOutOfAcceptance) ;
3752 
3753  fhPtPrimMCPi0DecayPairOutOfAcceptanceNoOverlap = new TH1F("hPtPrim_MCPhotonPi0DecayPairOutOfAcceptanceNoOverlap",
3754  Form("primary photon %s : #it{p}_{T}, pair out of acceptance, no overlap, %s",pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3755  nptbins,ptmin,ptmax);
3756  fhPtPrimMCPi0DecayPairOutOfAcceptanceNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3757  outputContainer->Add(fhPtPrimMCPi0DecayPairOutOfAcceptanceNoOverlap) ;
3758 
3759  fhPtPrimMCPi0DecayIsoPairOutOfAcceptance = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairOutOfAcceptance",
3760  Form("isolated primary photon %s, pair out of acceptance : #it{p}_{T}, %s",
3761  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3762  nptbins,ptmin,ptmax);
3763  fhPtPrimMCPi0DecayIsoPairOutOfAcceptance->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3764  outputContainer->Add(fhPtPrimMCPi0DecayIsoPairOutOfAcceptance) ;
3765 
3766  fhPtPrimMCPi0DecayIsoPairOutOfAcceptanceNoOverlap = new TH1F("hPtPrim_MCisoPhotonPi0DecayPairOutOfAcceptanceNoOverlap",
3767  Form("isolated primary photon %s, pair out of acceptance, no overlap : #it{p}_{T}, %s",
3768  pptype[kmcPrimPi0Decay].Data(),parTitle.Data()),
3769  nptbins,ptmin,ptmax);
3770  fhPtPrimMCPi0DecayIsoPairOutOfAcceptanceNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3772 
3773  fhPtPrimMCPi0Overlap = new TH1F("hPtPrim_MCPi0Overlap",
3774  Form("primary %s, overlap: #it{p}_{T}, %s",
3775  pptype[kmcPrimPi0].Data(),parTitle.Data()),
3776  nptbins,ptmin,ptmax);
3777  fhPtPrimMCPi0Overlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3778  outputContainer->Add(fhPtPrimMCPi0Overlap) ;
3779 
3780  fhPtPrimMCPi0IsoOverlap = new TH1F("hPtPrim_MCisoPi0Overlap",
3781  Form("primary %s, overlap: #it{p}_{T}, %s",
3782  pptype[kmcPrimPi0].Data(),parTitle.Data()),
3783  nptbins,ptmin,ptmax);
3784  fhPtPrimMCPi0IsoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3785  outputContainer->Add(fhPtPrimMCPi0IsoOverlap) ;
3786 
3787 
3788 
3789 
3790 
3791 
3792 
3793 
3794  fhPtPrimMCEtaDecayPairAcceptInConeLowPt = new TH1F("hPtPrim_MCPhotonEtaDecayPairAcceptInConeLowPt",
3795  Form("primary photon %s : #it{p}_{T}, pair in cone, %s",pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3796  nptbins,ptmin,ptmax);
3797  fhPtPrimMCEtaDecayPairAcceptInConeLowPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3798  outputContainer->Add(fhPtPrimMCEtaDecayPairAcceptInConeLowPt) ;
3799 
3800  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPt = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairAcceptInConeLowPt",
3801  Form("isolated primary photon %s, pair in cone : #it{p}_{T}, %s",
3802  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3803  nptbins,ptmin,ptmax);
3804  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3805  outputContainer->Add(fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPt) ;
3806 
3807  fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlap = new TH1F("hPtPrim_MCPhotonEtaDecayPairAcceptInConeLowPtNoOverlap",
3808  Form("primary photon %s, no overlap, pair in cone : #it{p}_{T}, %s",
3809  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3810  nptbins,ptmin,ptmax);
3811  fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3812  outputContainer->Add(fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlap) ;
3813 
3814  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlap = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairAcceptInConeLowPtNoOverlap",
3815  Form("isolated primary photon %s, pair in cone,no overlap : #it{p}_{T}, %s",
3816  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3817  nptbins,ptmin,ptmax);
3818  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3820 
3821  fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlapCaloE = new TH1F("hPtPrim_MCPhotonEtaDecayPairAcceptInConeLowPtNoOverlapCaloE",
3822  Form("primary photon %s, no overlap, pair in cone, E > calo min: #it{p}_{T}, %s",
3823  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3824  nptbins,ptmin,ptmax);
3825  fhPtPrimMCEtaDecayPairAcceptInConeLowPtNoOverlapCaloE->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3827 
3828  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlapCaloE = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairAcceptInConeLowPtNoOverlapCaloE",
3829  Form("isolated primary photon %s, pair in cone,no overlap, E > calo min: #it{p}_{T}, %s",
3830  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3831  nptbins,ptmin,ptmax);
3832  fhPtPrimMCEtaDecayIsoPairAcceptInConeLowPtNoOverlapCaloE->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3834 
3835 
3836  fhPtPrimMCEtaDecayPairNoOverlap = new TH1F("hPtPrim_MCPhotonEtaDecayPairNoOverlap",
3837  Form("primary photon %s, no overlap: #it{p}_{T}, %s",
3838  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3839  nptbins,ptmin,ptmax);
3840  fhPtPrimMCEtaDecayPairNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3841  outputContainer->Add(fhPtPrimMCEtaDecayPairNoOverlap) ;
3842 
3843  fhPtPrimMCEtaDecayIsoPairNoOverlap = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairNoOverlap",
3844  Form("isolated primary photon %s, no overlap: #it{p}_{T}, %s",
3845  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3846  nptbins,ptmin,ptmax);
3847  fhPtPrimMCEtaDecayIsoPairNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3848  outputContainer->Add(fhPtPrimMCEtaDecayIsoPairNoOverlap) ;
3849 
3850  fhPtPrimMCEtaDecayPairOutOfCone = new TH1F("hPtPrim_MCPhotonEtaDecayPairOutOfCone",
3851  Form("primary photon %s : #it{p}_{T}, pair out of cone, %s",pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3852  nptbins,ptmin,ptmax);
3853  fhPtPrimMCEtaDecayPairOutOfCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3854  outputContainer->Add(fhPtPrimMCEtaDecayPairOutOfCone) ;
3855 
3856  fhPtPrimMCEtaDecayIsoPairOutOfCone = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairOutOfCone",
3857  Form("isolated primary photon %s, pair out of cone : #it{p}_{T}, %s",
3858  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3859  nptbins,ptmin,ptmax);
3860  fhPtPrimMCEtaDecayIsoPairOutOfCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3861  outputContainer->Add(fhPtPrimMCEtaDecayIsoPairOutOfCone) ;
3862 
3863  fhPtPrimMCEtaDecayPairOutOfAcceptance = new TH1F("hPtPrim_MCPhotonEtaDecayPairOutOfAcceptance",
3864  Form("primary photon %s : #it{p}_{T}, pair out of acceptance, %s",pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3865  nptbins,ptmin,ptmax);
3866  fhPtPrimMCEtaDecayPairOutOfAcceptance->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3867  outputContainer->Add(fhPtPrimMCEtaDecayPairOutOfAcceptance) ;
3868 
3869  fhPtPrimMCEtaDecayPairOutOfAcceptanceNoOverlap = new TH1F("hPtPrim_MCPhotonEtaDecayPairOutOfAcceptanceNoOverlap",
3870  Form("primary photon %s : #it{p}_{T}, pair out of acceptance, no overlap, %s",pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3871  nptbins,ptmin,ptmax);
3872  fhPtPrimMCEtaDecayPairOutOfAcceptanceNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3873  outputContainer->Add(fhPtPrimMCEtaDecayPairOutOfAcceptanceNoOverlap) ;
3874 
3875  fhPtPrimMCEtaDecayIsoPairOutOfAcceptance = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairOutOfAcceptance",
3876  Form("isolated primary photon %s, pair out of acceptance : #it{p}_{T}, %s",
3877  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3878  nptbins,ptmin,ptmax);
3879  fhPtPrimMCEtaDecayIsoPairOutOfAcceptance->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3880  outputContainer->Add(fhPtPrimMCEtaDecayIsoPairOutOfAcceptance) ;
3881 
3882  fhPtPrimMCEtaDecayIsoPairOutOfAcceptanceNoOverlap = new TH1F("hPtPrim_MCisoPhotonEtaDecayPairOutOfAcceptanceNoOverlap",
3883  Form("isolated primary photon %s, pair out of acceptance, no overlap : #it{p}_{T}, %s",
3884  pptype[kmcPrimEtaDecay].Data(),parTitle.Data()),
3885  nptbins,ptmin,ptmax);
3886  fhPtPrimMCEtaDecayIsoPairOutOfAcceptanceNoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3888 
3889  fhPtPrimMCEtaOverlap = new TH1F("hPtPrim_MCEtaOverlap",
3890  Form("primary %s, overlap: #it{p}_{T}, %s",
3891  pptype[kmcPrimEta].Data(),parTitle.Data()),
3892  nptbins,ptmin,ptmax);
3893  fhPtPrimMCEtaOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3894  outputContainer->Add(fhPtPrimMCEtaOverlap) ;
3895 
3896  fhPtPrimMCEtaIsoOverlap = new TH1F("hPtPrim_MCisoEtaOverlap",
3897  Form("primary %s, overlap: #it{p}_{T}, %s",
3898  pptype[kmcPrimEta].Data(),parTitle.Data()),
3899  nptbins,ptmin,ptmax);
3900  fhPtPrimMCEtaIsoOverlap->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3901  outputContainer->Add(fhPtPrimMCEtaIsoOverlap) ;
3902 
3903  }
3904 
3905  }//Histos with MC
3906 
3907  }
3908 
3909  if(fMakeSeveralIC)
3910  {
3911  const Int_t buffersize = 255;
3912  char name[buffersize];
3913  char title[buffersize];
3914  for(Int_t icone = 0; icone<fNCones; icone++)
3915  {
3916  // sum pt in cone vs. pt leading
3917  snprintf(name, buffersize,"hSumPtLeadingPt_Cone_%d",icone);
3918  snprintf(title, buffersize,"#Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSizes[icone]);
3919  fhSumPtLeadingPt[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
3920  fhSumPtLeadingPt[icone] ->SetYTitle("#sum_{cone}#it{p}_{T} (GeV/#it{c})");//#Sigma #it{p}_{T}
3921  fhSumPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
3922  outputContainer->Add(fhSumPtLeadingPt[icone]) ;
3923 
3924  // pt in cone vs. pt leading
3925  snprintf(name, buffersize,"hPtLeadingPt_Cone_%d",icone);
3926  snprintf(title, buffersize,"#it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSizes[icone]);
3927  fhPtLeadingPt[icone] = new TH2F(name, title, nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3928  fhPtLeadingPt[icone] ->SetYTitle("#it{p}_{T}^{cone} (GeV/#it{c})");
3929  fhPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
3930  outputContainer->Add(fhPtLeadingPt[icone]) ;
3931 
3932  // sum pt in cone vs. pt leading in the forward region (for background subtraction studies)
3933  snprintf(name, buffersize,"hPerpSumPtLeadingPt_Cone_%d",icone);
3934  snprintf(title, buffersize,"#Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSizes[icone]);
3935  fhPerpSumPtLeadingPt[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
3936  fhPerpSumPtLeadingPt[icone] ->SetYTitle("#sum_{cone}#it{p}_{T} (GeV/#it{c})");//#Sigma #it{p}_{T}
3937  fhPerpSumPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
3938  outputContainer->Add(fhPerpSumPtLeadingPt[icone]) ;
3939 
3940  // pt in cone vs. pt leading in the forward region (for background subtraction studies)
3941  snprintf(name, buffersize,"hPerpPtLeadingPt_Cone_%d",icone);
3942  snprintf(title, buffersize,"#it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSizes[icone]);
3943  fhPerpPtLeadingPt[icone] = new TH2F(name, title, nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
3944  fhPerpPtLeadingPt[icone] ->SetYTitle("#it{p}_{T}^{cone} (GeV/#it{c})");
3945  fhPerpPtLeadingPt[icone] ->SetXTitle("#it{p}_{T}^{leading} (GeV/#it{c})");
3946  outputContainer->Add(fhPerpPtLeadingPt[icone]) ;
3947 
3948  if(IsDataMC())
3949  {
3950  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
3951  {
3952  snprintf(name , buffersize,"hSumPtLeadingPt_MC%s_Cone_%d",mcPartName[imc].Data(),icone);
3953  snprintf(title, buffersize,"Candidate %s #it{p}_{T} vs cone #Sigma #it{p}_{T} for #it{R}=%2.2f",mcPartType[imc].Data(),fConeSizes[icone]);
3954  fhSumPtLeadingPtMC[imc][icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
3955  fhSumPtLeadingPtMC[imc][icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
3956  fhSumPtLeadingPtMC[imc][icone]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
3957  outputContainer->Add(fhSumPtLeadingPtMC[imc][icone]) ;
3958  }
3959  }//Histos with MC
3960 
3961  for(Int_t ipt = 0; ipt<fNPtThresFrac;ipt++)
3962  {
3963  snprintf(name, buffersize,"hPtThres_Cone_%d_Pt%d",icone,ipt);
3964  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]);
3965  fhPtThresIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
3966  fhPtThresIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3967  outputContainer->Add(fhPtThresIsolated[icone][ipt]) ;
3968 
3969  snprintf(name, buffersize,"hPtFrac_Cone_%d_Pt%d",icone,ipt);
3970  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]);
3971  fhPtFracIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
3972  fhPtFracIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3973  outputContainer->Add(fhPtFracIsolated[icone][ipt]) ;
3974 
3975  snprintf(name, buffersize,"hSumPt_Cone_%d_Pt%d",icone,ipt);
3976  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]);
3977  fhSumPtIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
3978  // fhSumPtIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
3979  fhSumPtIsolated[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3980  outputContainer->Add(fhSumPtIsolated[icone][ipt]) ;
3981 
3982  snprintf(name, buffersize,"hPtSumDensity_Cone_%d_Pt%d",icone,ipt);
3983  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]);
3984  fhPtSumDensityIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
3985  //fhPtSumIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
3986  fhPtSumDensityIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3987  outputContainer->Add(fhPtSumDensityIso[icone][ipt]) ;
3988 
3989  snprintf(name, buffersize,"hPtFracPtSum_Cone_%d_Pt%d",icone,ipt);
3990  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]);
3991  fhPtFracPtSumIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
3992  //fhPtSumIsolated[icone][ipt]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
3993  fhPtFracPtSumIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3994  outputContainer->Add(fhPtFracPtSumIso[icone][ipt]) ;
3995 
3996  // eta:phi
3997  snprintf(name, buffersize,"hEtaPhiPtThres_Cone_%d_Pt%d",icone,ipt);
3998  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]);
3999  fhEtaPhiPtThresIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4000  fhEtaPhiPtThresIso[icone][ipt]->SetXTitle("#eta");
4001  fhEtaPhiPtThresIso[icone][ipt]->SetYTitle("#phi");
4002  outputContainer->Add(fhEtaPhiPtThresIso[icone][ipt]) ;
4003 
4004  snprintf(name, buffersize,"hEtaPhiPtFrac_Cone_%d_Pt%d",icone,ipt);
4005  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]);
4006  fhEtaPhiPtFracIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4007  fhEtaPhiPtFracIso[icone][ipt]->SetXTitle("#eta");
4008  fhEtaPhiPtFracIso[icone][ipt]->SetYTitle("#phi");
4009  outputContainer->Add(fhEtaPhiPtFracIso[icone][ipt]) ;
4010 
4011  snprintf(name, buffersize,"hEtaPhiPtSum_Cone_%d_Pt%d",icone,ipt);
4012  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]);
4013  fhEtaPhiPtSumIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4014  fhEtaPhiPtSumIso[icone][ipt]->SetXTitle("#eta");
4015  fhEtaPhiPtSumIso[icone][ipt]->SetYTitle("#phi");
4016  outputContainer->Add(fhEtaPhiPtSumIso[icone][ipt]) ;
4017 
4018  snprintf(name, buffersize,"hEtaPhiSumDensity_Cone_%d_Pt%d",icone,ipt);
4019  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]);
4020  fhEtaPhiSumDensityIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4021  fhEtaPhiSumDensityIso[icone][ipt]->SetXTitle("#eta");
4022  fhEtaPhiSumDensityIso[icone][ipt]->SetYTitle("#phi");
4023  outputContainer->Add(fhEtaPhiSumDensityIso[icone][ipt]) ;
4024 
4025  snprintf(name, buffersize,"hEtaPhiFracPtSum_Cone_%d_Pt%d",icone,ipt);
4026  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]);
4027  fhEtaPhiFracPtSumIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4028  fhEtaPhiFracPtSumIso[icone][ipt]->SetXTitle("#eta");
4029  fhEtaPhiFracPtSumIso[icone][ipt]->SetYTitle("#phi");
4030  outputContainer->Add(fhEtaPhiFracPtSumIso[icone][ipt]) ;
4031 
4033  {
4034  // pt decays isolated
4035  snprintf(name, buffersize,"hPtThres_Decay_Cone_%d_Pt%d",icone,ipt);
4036  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]);
4037  fhPtPtThresDecayIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
4038  fhPtPtThresDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4039  outputContainer->Add(fhPtPtThresDecayIso[icone][ipt]) ;
4040 
4041  snprintf(name, buffersize,"hPtFrac_Decay_Cone_%d_Pt%d",icone,ipt);
4042  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]);
4043  fhPtPtFracDecayIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
4044  fhPtPtFracDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4045  outputContainer->Add(fhPtPtFracDecayIso[icone][ipt]) ;
4046 
4047  snprintf(name, buffersize,"hPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
4048  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]);
4049  fhPtPtSumDecayIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
4050  // fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
4051  fhPtPtSumDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4052  outputContainer->Add(fhPtPtSumDecayIso[icone][ipt]) ;
4053 
4054  snprintf(name, buffersize,"hPtSumDensity_Decay_Cone_%d_Pt%d",icone,ipt);
4055  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]);
4056  fhPtSumDensityDecayIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
4057  // fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
4058  fhPtSumDensityDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4059  outputContainer->Add(fhPtSumDensityDecayIso[icone][ipt]) ;
4060 
4061  snprintf(name, buffersize,"hPtFracPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
4062  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]);
4063  fhPtFracPtSumDecayIso[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);//,nptsumbins,ptsummin,ptsummax);
4064  // fhPtPtSumDecayIso[icone]->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
4065  fhPtFracPtSumDecayIso[icone][ipt]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4066  outputContainer->Add(fhPtFracPtSumDecayIso[icone][ipt]) ;
4067 
4068  // eta:phi decays
4069  snprintf(name, buffersize,"hEtaPhiPtThres_Decay_Cone_%d_Pt%d",icone,ipt);
4070  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]);
4071  fhEtaPhiPtThresDecayIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4072  fhEtaPhiPtThresDecayIso[icone][ipt]->SetXTitle("#eta");
4073  fhEtaPhiPtThresDecayIso[icone][ipt]->SetYTitle("#phi");
4074  outputContainer->Add(fhEtaPhiPtThresDecayIso[icone][ipt]) ;
4075 
4076  snprintf(name, buffersize,"hEtaPhiPtFrac_Decay_Cone_%d_Pt%d",icone,ipt);
4077  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]);
4078  fhEtaPhiPtFracDecayIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4079  fhEtaPhiPtFracDecayIso[icone][ipt]->SetXTitle("#eta");
4080  fhEtaPhiPtFracDecayIso[icone][ipt]->SetYTitle("#phi");
4081  outputContainer->Add(fhEtaPhiPtFracDecayIso[icone][ipt]) ;
4082 
4083 
4084  snprintf(name, buffersize,"hEtaPhiPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
4085  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]);
4086  fhEtaPhiPtSumDecayIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4087  fhEtaPhiPtSumDecayIso[icone][ipt]->SetXTitle("#eta");
4088  fhEtaPhiPtSumDecayIso[icone][ipt]->SetYTitle("#phi");
4089  outputContainer->Add(fhEtaPhiPtSumDecayIso[icone][ipt]) ;
4090 
4091  snprintf(name, buffersize,"hEtaPhiSumDensity_Decay_Cone_%d_Pt%d",icone,ipt);
4092  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]);
4093  fhEtaPhiSumDensityDecayIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4094  fhEtaPhiSumDensityDecayIso[icone][ipt]->SetXTitle("#eta");
4095  fhEtaPhiSumDensityDecayIso[icone][ipt]->SetYTitle("#phi");
4096  outputContainer->Add(fhEtaPhiSumDensityDecayIso[icone][ipt]) ;
4097 
4098  snprintf(name, buffersize,"hEtaPhiFracPtSum_Decay_Cone_%d_Pt%d",icone,ipt);
4099  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]);
4100  fhEtaPhiFracPtSumDecayIso[icone][ipt] = new TH2F(name, title,netabins,etamin,etamax,nphibins,phimin,phimax);
4101  fhEtaPhiFracPtSumDecayIso[icone][ipt]->SetXTitle("#eta");
4102  fhEtaPhiFracPtSumDecayIso[icone][ipt]->SetYTitle("#phi");
4103  outputContainer->Add(fhEtaPhiFracPtSumDecayIso[icone][ipt]) ;
4104 
4105  }
4106 
4107  if(IsDataMC())
4108  {
4109  for(Int_t imc = 0; imc < fgkNmcTypes; imc++)
4110  {
4111  snprintf(name , buffersize,"hPtThreshMC%s_Cone_%d_Pt%d",mcPartName[imc].Data(),icone,ipt);
4112  snprintf(title, buffersize,"Isolated %s #it{p}_{T} for #it{R}=%2.2f and #it{p}_{T}^{th}=%2.2f",
4113  mcPartType[imc].Data(),fConeSizes[icone], fPtThresholds[ipt]);
4114  fhPtThresIsolatedMC[imc][icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
4115  fhPtThresIsolatedMC[imc][icone][ipt]->SetYTitle("#it{counts}");
4116  fhPtThresIsolatedMC[imc][icone][ipt]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
4117  outputContainer->Add(fhPtThresIsolatedMC[imc][icone][ipt]) ;
4118 
4119 
4120  snprintf(name , buffersize,"hPtFracMC%s_Cone_%d_Pt%d",mcPartName[imc].Data(),icone,ipt);
4121  snprintf(title, buffersize,"Isolated %s #it{p}_{T} for #it{R}=%2.2f and #Sigma #it{p}_{T}^{in cone}/#it{p}_{T}^{trig}=%2.2f",
4122  mcPartType[imc].Data(),fConeSizes[icone], fPtFractions[ipt]);
4123  fhPtFracIsolatedMC[imc][icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
4124  fhPtFracIsolatedMC[imc][icone][ipt]->SetYTitle("#it{counts}");
4125  fhPtFracIsolatedMC[imc][icone][ipt]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
4126  outputContainer->Add(fhPtFracIsolatedMC[imc][icone][ipt]) ;
4127 
4128  snprintf(name , buffersize,"hSumPtMC%s_Cone_%d_Pt%d",mcPartName[imc].Data(),icone,ipt);
4129  snprintf(title, buffersize,"Isolated %s #it{p}_{T} for #it{R}=%2.2f and #Sigma #it{p}_{T}^{in cone}=%2.2f",
4130  mcPartType[imc].Data(),fConeSizes[icone], fSumPtThresholds[ipt]);
4131  fhSumPtIsolatedMC[imc][icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax);
4132  fhSumPtIsolatedMC[imc][icone][ipt]->SetYTitle("#it{counts}");
4133  fhSumPtIsolatedMC[imc][icone][ipt]->SetXTitle("#it{p}_{T}(GeV/#it{c})");
4134  outputContainer->Add(fhSumPtIsolatedMC[imc][icone][ipt]) ;
4135  }
4136  }//Histos with MC
4137  }//icone loop
4138  }//ipt loop
4139  }
4140 
4141  if(IsPileUpAnalysisOn())
4142  {
4143  for (Int_t i = 0; i < 7 ; i++)
4144  {
4145  fhEIsoPileUp[i] = new TH1F(Form("hEPileUp%s",pileUpName[i].Data()),
4146  Form("Number of isolated particles vs E, %s, pile-up event by %s",parTitle.Data(),pileUpName[i].Data()),
4147  nptbins,ptmin,ptmax);
4148  fhEIsoPileUp[i]->SetYTitle("d#it{N} / d#it{E}");
4149  fhEIsoPileUp[i]->SetXTitle("#it{E} (GeV)");
4150  outputContainer->Add(fhEIsoPileUp[i]) ;
4151 
4152  fhPtIsoPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
4153  Form("Number of isolated particles vs #it{p}_{T}, %s, pile-up event by %s",parTitle.Data(),pileUpName[i].Data()),
4154  nptbins,ptmin,ptmax);
4155  fhPtIsoPileUp[i]->SetYTitle("d#it{N} / #it{p}_{T}");
4156  fhPtIsoPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4157  outputContainer->Add(fhPtIsoPileUp[i]) ;
4158 
4159  fhENoIsoPileUp[i] = new TH1F(Form("hENoIsoPileUp%s",pileUpName[i].Data()),
4160  Form("Number of not isolated particles vs E, %s, pile-up event by %s",parTitle.Data(),pileUpName[i].Data()),
4161  nptbins,ptmin,ptmax);
4162  fhENoIsoPileUp[i]->SetYTitle("d#it{N} / dE");
4163  fhENoIsoPileUp[i]->SetXTitle("#it{E} (GeV)");
4164  outputContainer->Add(fhENoIsoPileUp[i]) ;
4165 
4166  fhPtNoIsoPileUp[i] = new TH1F(Form("hPtNoIsoPileUp%s",pileUpName[i].Data()),
4167  Form("Number of not isolated particles vs #it{p}_{T}, %s, pile-up event by %s",parTitle.Data(),pileUpName[i].Data()),
4168  nptbins,ptmin,ptmax);
4169  fhPtNoIsoPileUp[i]->SetYTitle("d#it{N} / #it{p}_{T}");
4170  fhPtNoIsoPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
4171  outputContainer->Add(fhPtNoIsoPileUp[i]) ;
4172  }
4173 
4174  fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
4175  fhTimeENoCut->SetXTitle("#it{E} (GeV)");
4176  fhTimeENoCut->SetYTitle("#it{time} (ns)");
4177  outputContainer->Add(fhTimeENoCut);
4178 
4179  fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
4180  fhTimeESPD->SetXTitle("#it{E} (GeV)");
4181  fhTimeESPD->SetYTitle("#it{time} (ns)");
4182  outputContainer->Add(fhTimeESPD);
4183 
4184  fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
4185  fhTimeESPDMulti->SetXTitle("#it{E} (GeV)");
4186  fhTimeESPDMulti->SetYTitle("#it{time} (ns)");
4187  outputContainer->Add(fhTimeESPDMulti);
4188 
4189  fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
4190  fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
4191  fhTimeNPileUpVertSPD->SetXTitle("#it{time} (ns)");
4192  outputContainer->Add(fhTimeNPileUpVertSPD);
4193 
4194  fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
4195  fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
4196  fhTimeNPileUpVertTrack->SetXTitle("#it{time} (ns)");
4197  outputContainer->Add(fhTimeNPileUpVertTrack);
4198 
4199  fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
4200  fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
4201  fhTimeNPileUpVertContributors->SetXTitle("#it{time} (ns)");
4202  outputContainer->Add(fhTimeNPileUpVertContributors);
4203 
4204  fhTimePileUpMainVertexZDistance = new TH2F ("hTime_PileUpMainVertexZDistance","time of cluster vs distance in Z pile-up SPD vertex - main SPD vertex",ntimebins,timemin,timemax,100,0,50);
4205  fhTimePileUpMainVertexZDistance->SetYTitle("distance #it{z} (cm) ");
4206  fhTimePileUpMainVertexZDistance->SetXTitle("#it{time} (ns)");
4207  outputContainer->Add(fhTimePileUpMainVertexZDistance);
4208 
4209  fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
4210  fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance #it{z} (cm) ");
4211  fhTimePileUpMainVertexZDiamond->SetXTitle("#it{time} (ns)");
4212  outputContainer->Add(fhTimePileUpMainVertexZDiamond);
4213  }
4214 
4215  return outputContainer ;
4216 }
4217 
4218 //____________________________________________________
4220 //____________________________________________________
4222 {
4223  if(!IsDataMC()) return -1;
4224 
4225  if (GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPrompt))
4226  {
4227  return kmcPrompt;
4228  }
4229  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCFragmentation) ||
4230  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCISR))
4231  {
4232  return kmcFragment;
4233  }
4234  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0))
4235  {
4236  return kmcPi0;
4237  }
4238  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
4239  {
4240  return kmcEta;
4241  }
4242  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0Decay))
4243  {
4244  return kmcPi0Decay;
4245  }
4246  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEtaDecay))
4247  {
4248  return kmcEtaDecay;
4249  }
4250  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton))
4251  {
4252  return kmcOtherDecay;
4253  }
4254  else if(GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
4255  {
4256  return kmcElectron;
4257  }
4258  else // anything else
4259  {
4260  // careful can contain also other decays, to be checked.
4261  return kmcHadron;
4262  }
4263 }
4264 
4265 //__________________________________
4267 //__________________________________
4269 {
4270  // In case of several cone and thresholds analysis, open the cuts for the filling of the
4271  // track and cluster reference arrays in cone when done in the MakeAnalysisFillAOD().
4272  // The different cones, thresholds are tested for this list of tracks, clusters.
4273  if(fMakeSeveralIC)
4274  {
4275  AliInfo("Open default isolation cuts for multiple Isolation analysis");
4279  }
4280 
4281  if(!GetReader()->IsCTSSwitchedOn() && GetIsolationCut()->GetParticleTypeInCone()!=AliIsolationCut::kOnlyNeutral)
4282  AliFatal("STOP!: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!");
4283 }
4284 
4285 //____________________________________________
4288 //____________________________________________
4290 {
4291  SetInputAODName("PWG4Particle");
4292  SetAODObjArrayName("IsolationCone");
4293  AddToHistogramsName("AnaIsolation_");
4294 
4295  fIsoDetectorString = "EMCAL" ;
4296  fIsoDetector = kEMCAL ;
4297 
4298  fReMakeIC = kFALSE ;
4299  fMakeSeveralIC = kFALSE ;
4300 
4301  fMinCellsAngleOverlap = 3.;
4302 
4303  fLeadingOnly = kTRUE;
4305 
4306  fNDecayBits = 1;
4313  fDecayBits[6] = AliNeutralMesonSelection::kPi0LeftSide ; // Leave it last since likely not used
4314  fDecayBits[7] = AliNeutralMesonSelection::kPi0BothSides; // Leave it last since likely not used
4315 
4316  fDecayTagsM02Cut = 0.27;
4317 
4318  fNBkgBin = 11;
4319  fBkgBinLimit[ 0] = 00.0; fBkgBinLimit[ 1] = 00.2; fBkgBinLimit[ 2] = 00.3; fBkgBinLimit[ 3] = 00.4; fBkgBinLimit[ 4] = 00.5;
4320  fBkgBinLimit[ 5] = 01.0; fBkgBinLimit[ 6] = 01.5; fBkgBinLimit[ 7] = 02.0; fBkgBinLimit[ 8] = 03.0; fBkgBinLimit[ 9] = 05.0;
4321  fBkgBinLimit[10] = 10.0; fBkgBinLimit[11] = 100.;
4322  for(Int_t ibin = fNBkgBin+1; ibin < 20; ibin++) fBkgBinLimit[ibin] = 00.0;
4323 
4324  fNPtTrigBin = 6;
4325  fPtTrigBinLimit[ 0] = 8; fPtTrigBinLimit[ 1] = 10; fPtTrigBinLimit[ 2] = 12; fPtTrigBinLimit[ 3] = 14; fPtTrigBinLimit[ 4] = 16;
4326  fPtTrigBinLimit[ 5] = 20; fPtTrigBinLimit[ 6] = 25; ;
4327  for(Int_t ibin = fNPtTrigBin+1; ibin < 20; ibin++) fPtTrigBinLimit[ibin] = 00.0;
4328 
4329  //----------- Several IC-----------------
4330  fNCones = 5 ;
4331  fNPtThresFrac = 5 ;
4332  fConeSizes [0] = 0.1; fConeSizes [1] = 0.2; fConeSizes [2] = 0.3; fConeSizes [3] = 0.4; fConeSizes [4] = 0.5;
4333  fPtThresholds [0] = 1.; fPtThresholds [1] = 2.; fPtThresholds [2] = 3.; fPtThresholds [3] = 4.; fPtThresholds [4] = 5.;
4334  fPtFractions [0] = 0.05; fPtFractions [1] = 0.075; fPtFractions [2] = 0.1; fPtFractions [3] = 1.25; fPtFractions [4] = 1.5;
4335  fSumPtThresholds[0] = 1.; fSumPtThresholds[1] = 2.; fSumPtThresholds[2] = 3.; fSumPtThresholds[3] = 4.; fSumPtThresholds[4] = 5.;
4336 }
4337 
4338 //_________________________________________________________________________________________
4341 //_________________________________________________________________________________________
4343 {
4344  Double_t ptTrig = GetMinPt();
4345  Double_t phiTrig = 0 ;
4346  Int_t index =-1 ;
4347  AliAODPWG4ParticleCorrelation* pLeading = 0;
4348 
4349  // Loop on stored AOD particles, find leading trigger on the selected list, with at least min pT.
4350 
4351  for(Int_t iaod = 0; iaod < GetInputAODBranch()->GetEntriesFast() ; iaod++)
4352  {
4353  AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
4354  particle->SetLeadingParticle(kFALSE); // set it later
4355 
4356  // Vertex cut in case of mixing
4357  if(GetMixedEvent())
4358  {
4359  Int_t check = CheckMixedEventVertex(particle->GetCaloLabel(0), particle->GetTrackLabel(0));
4360  if(check == 0) continue;
4361  if(check == -1) return kFALSE; // not sure if it is correct.
4362  }
4363 
4364  //check if it is low pt trigger particle
4365  if((particle->Pt() < GetIsolationCut()->GetPtThreshold() ||
4366  particle->Pt() < GetIsolationCut()->GetSumPtThreshold()) &&
4367  !fMakeSeveralIC)
4368  {
4369  continue ; //trigger should not come from underlying event
4370  }
4371 
4372  // find the leading particles with highest momentum
4373  if (particle->Pt() > ptTrig)
4374  {
4375  ptTrig = particle->Pt() ;
4376  phiTrig = particle->Phi();
4377  index = iaod ;
4378  pLeading = particle ;
4379  }
4380  }// finish search of leading trigger particle on the AOD branch.
4381 
4382  if(index < 0) return kFALSE;
4383 
4384  idLeading = index;
4385 
4386  //printf("AOD leading pT %2.2f, ID %d\n", pLeading->Pt(),pLeading->GetCaloLabel(0));
4387 
4388  if(phiTrig < 0 ) phiTrig += TMath::TwoPi();
4389 
4390  // Compare if it is the leading of all tracks
4391 
4392  for(Int_t ipr = 0;ipr < GetCTSTracks()->GetEntriesFast() ; ipr ++ )
4393  {
4394  AliVTrack * track = (AliVTrack *) (GetCTSTracks()->At(ipr)) ;
4395 
4396  if(track->GetID() == pLeading->GetTrackLabel(0) || track->GetID() == pLeading->GetTrackLabel(1) ||
4397  track->GetID() == pLeading->GetTrackLabel(2) || track->GetID() == pLeading->GetTrackLabel(3) ) continue ;
4398 
4399  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
4400  Float_t pt = fTrackVector.Pt();
4401  Float_t phi = fTrackVector.Phi() ;
4402  if(phi < 0) phi+=TMath::TwoPi();
4403 
4404  //skip this event if near side associated particle pt larger than trigger
4405 
4406  Float_t deltaPhi = phiTrig-phi;
4407  //
4408  // Calculate deltaPhi shift so that for the particles on the opposite side
4409  // it is defined between 90 and 270 degrees
4410  // Shift [-360,-90] to [0, 270]
4411  // and [270,360] to [-90,0]
4412  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4413  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4414 
4415  if(pt > ptTrig && deltaPhi < TMath::PiOver2()) return kFALSE;
4416 
4417  }// track loop
4418 
4419  // Compare if it is leading of all calorimeter clusters
4420 
4422  {
4423  // Select the calorimeter cluster list
4424  TObjArray * nePl = 0x0;
4425  if (pLeading->GetDetectorTag() == kPHOS )
4426  nePl = GetPHOSClusters();
4427  else
4428  nePl = GetEMCALClusters();
4429 
4430  if(!nePl) return kTRUE; // Do the selection just with the tracks if no calorimeter is available.
4431 
4432  for(Int_t ipr = 0;ipr < nePl->GetEntriesFast() ; ipr ++ )
4433  {
4434  AliVCluster * cluster = (AliVCluster *) (nePl->At(ipr)) ;
4435 
4436  if(cluster->GetID() == pLeading->GetCaloLabel(0) || cluster->GetID() == pLeading->GetCaloLabel(1) ) continue ;
4437 
4438  cluster->GetMomentum(fMomentum,GetVertex(0));
4439 
4440  Float_t pt = fMomentum.Pt();
4441  Float_t phi = fMomentum.Phi() ;
4442  if(phi < 0) phi+=TMath::TwoPi();
4443 
4444  if(IsTrackMatched(cluster,GetReader()->GetInputEvent())) continue ; // avoid charged clusters, already covered by tracks, or cluster merging with track.
4445 
4446  // skip this event if near side associated particle pt larger than trigger
4447  // not really needed for calorimeter, unless DCal is included
4448 
4449  Float_t deltaPhi = phiTrig-phi;
4450  if(deltaPhi <= -TMath::PiOver2()) deltaPhi+=TMath::TwoPi();
4451  if(deltaPhi > 3*TMath::PiOver2()) deltaPhi-=TMath::TwoPi();
4452 
4453  if(pt > ptTrig && deltaPhi < TMath::PiOver2()) return kFALSE ;
4454 
4455  }// cluster loop
4456  } // check neutral clusters
4457 
4458  idLeading = index ;
4459  pLeading->SetLeadingParticle(kTRUE);
4460 
4461  AliDebug(1,Form("Particle AOD with index %d is leading with pT %2.2f",idLeading, pLeading->Pt()));
4462 
4463  return kTRUE;
4464 }
4465 
4466 //__________________________________________________
4470 //__________________________________________________
4472 {
4473  if(!GetInputAODBranch())
4474  AliFatal(Form("No input particles in AOD with name branch < %s >, STOP",GetInputAODName().Data()));
4475 
4476  if(strcmp(GetInputAODBranch()->GetClass()->GetName(), "AliAODPWG4ParticleCorrelation"))
4477  AliFatal(Form("Wrong type of AOD object, change AOD class name in input AOD: It should be <AliAODPWG4ParticleCorrelation> and not <%s>",
4478  GetInputAODBranch()->GetClass()->GetName()));
4479 
4480  Int_t n = 0, nfrac = 0;
4481  Bool_t isolated = kFALSE ;
4482  Float_t coneptsum = 0, coneptlead = 0;
4483  TObjArray * pl = 0x0; ;
4484 
4485  //Select the calorimeter for candidate isolation with neutral particles
4486  if (GetCalorimeter() == kPHOS )
4487  pl = GetPHOSClusters();
4488  else if (GetCalorimeter() == kEMCAL)
4489  pl = GetEMCALClusters();
4490 
4491  //Loop on AOD branch, filled previously in AliAnaPhoton, find leading particle to do isolation only with it
4492  Int_t idLeading = -1 ;
4493  Int_t iaod0 = 0;
4494  Int_t naod = GetInputAODBranch()->GetEntriesFast();
4495 
4496  AliDebug(1,Form("Input aod branch entries %d", naod));
4497 
4498  if(IsLeadingOnlyOn())
4499  {
4500  Bool_t leading = IsTriggerTheNearSideEventLeadingParticle(idLeading);
4501  if(!leading)
4502  {
4503  AliDebug(1,"Not leading; End fill AODs");
4504  return;
4505  }
4506  iaod0 = idLeading ; // first entry in particle loop
4507  naod = idLeading+1; // last entry in particle loop
4508  }
4509 
4510  // Check isolation of list of candidate particles or leading particle
4511 
4512  for(Int_t iaod = iaod0; iaod < naod; iaod++)
4513  {
4514  AliAODPWG4ParticleCorrelation * aodinput = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
4515 
4516  // Check isolation only of clusters in fiducial region
4517 
4518  if(IsFiducialCutOn())
4519  {
4520  Bool_t in = GetFiducialCut()->IsInFiducialCut(aodinput->Eta(), aodinput->Phi(), aodinput->GetDetectorTag()) ;
4521  if(! in ) continue ;
4522  }
4523 
4524  //If too small or too large pt, skip
4525  Float_t pt = aodinput->Pt();
4526  if(pt < GetMinPt() || pt > GetMaxPt() ) continue ;
4527 
4528 
4529  //check if it is low pt trigger particle
4530  if( ( pt < GetIsolationCut()->GetPtThreshold() || pt < GetIsolationCut()->GetSumPtThreshold() ) &&
4531  !fMakeSeveralIC)
4532  {
4533  continue ; //trigger should not come from underlying event
4534  }
4535 
4536  //After cuts, study isolation
4537  n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; coneptlead = 0;
4539  GetReader(), GetCaloPID(),
4540  kTRUE, aodinput, GetAODObjArrayName(),
4541  n,nfrac,coneptsum,coneptlead,isolated);
4542 
4543  if(!fMakeSeveralIC) aodinput->SetIsolated(isolated);
4544 
4545  AliDebug(1,Form("Particle isolated? %i; if so with index %d",isolated,iaod));
4546  } // particle isolation loop
4547 }
4548 
4549 //_________________________________________________________
4551 //_________________________________________________________
4553 {
4554  // In case of simulated data, fill acceptance histograms
4555  // Not ready for multiple case analysis.
4557 
4558  //Loop on stored AOD
4559  Int_t naod = GetInputAODBranch()->GetEntriesFast();
4560 
4561  AliDebug(1,Form("Histo aod branch entries %d", naod));
4562 
4563  for(Int_t iaod = 0; iaod < naod ; iaod++)
4564  {
4565  AliAODPWG4ParticleCorrelation* aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod));
4566 
4567  if(IsLeadingOnlyOn() && !aod->IsLeadingParticle()) continue; // Try to isolate only leading cluster or track
4568 
4569  // Check isolation only of clusters in fiducial region
4570  if(IsFiducialCutOn())
4571  {
4572  Bool_t in = GetFiducialCut()->IsInFiducialCut(aod->Eta(),aod->Phi(),aod->GetDetectorTag()) ;
4573  if(! in ) continue ;
4574  }
4575 
4576  Float_t pt = aod->Pt();
4577 
4578  //If too small or too large pt, skip
4579  if(pt < GetMinPt() || pt > GetMaxPt() ) continue ;
4580 
4581  Int_t mcTag = aod->GetTag() ;
4582  Int_t mcIndex = GetMCIndex(mcTag);
4583 
4584  // --- In case of redoing isolation from delta AOD ----
4585  // Not standard case, not used since its implementation
4586  if(fMakeSeveralIC)
4587  {
4588  //Analysis of multiple IC at same time
4589  MakeSeveralICAnalysis(aod,mcIndex);
4590  continue;
4591  }
4592 
4593  // --- In case of redoing isolation multiple cuts ----
4594 
4595  if(fReMakeIC)
4596  {
4597  //In case a more strict IC is needed in the produced AOD
4598  Bool_t isolated = kFALSE;
4599  Int_t n = 0, nfrac = 0;
4600  Float_t coneptsum = 0, coneptlead = 0;
4601 
4602  // Recover reference arrays with clusters and tracks
4603  TObjArray * refclusters = aod->GetObjArray(GetAODObjArrayName()+"Clusters");
4604  TObjArray * reftracks = aod->GetObjArray(GetAODObjArrayName()+"Tracks");
4605 
4606  GetIsolationCut()->MakeIsolationCut(reftracks, refclusters,
4607  GetReader(), GetCaloPID(),
4608  kFALSE, aod, "",
4609  n,nfrac,coneptsum,coneptlead,isolated);
4610  }
4611 
4612  Bool_t isolated = aod->IsIsolated();
4613  Float_t energy = aod->E();
4614  Float_t phi = aod->Phi();
4615  Float_t eta = aod->Eta();
4616  Float_t m02 = aod->GetM02();
4617  Int_t iSM = aod->GetSModNumber();
4618 
4619  AliDebug(1,Form("pt %1.1f, eta %1.1f, phi %1.1f, Isolated %d",pt, eta, phi, isolated));
4620 
4621  //
4622  // EMCAL SM regions
4623  //
4624  AliVCluster *cluster = 0;
4626  {
4627  // Get original cluster, needed to feed the subregion selection method
4628 
4629  Int_t iclus = -1;
4630  cluster = FindCluster(GetEMCALClusters(),aod->GetCaloLabel(0),iclus);
4631 
4632  Int_t etaRegion = -1, phiRegion = -1;
4633 
4634  GetCaloUtils()->GetEMCALSubregion(cluster,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
4635 
4636  if(etaRegion >= 0 && etaRegion < 4 && phiRegion >=0 && phiRegion < 3)
4637  {
4638 // fhLam0EMCALRegion[isolated][etaRegion][phiRegion]->Fill(pt, m02, GetEventWeight());
4639 //
4640 // if(GetFirstSMCoveredByTRD() >= 0 && iSM >= GetFirstSMCoveredByTRD() )
4641 // {
4642 // fhLam0EMCALRegionTRD[isolated][etaRegion][phiRegion]->Fill(pt, m02, GetEventWeight());
4643 // }
4644 
4645  fhLam0EMCALRegionPerSM[isolated][etaRegion][phiRegion][iSM]->Fill(pt, m02, GetEventWeight());
4646  }
4647 
4648  if(m02 >=0.3 && m02 <= 0.4)
4649  {
4650  Float_t ptLimit[] = {2,3,4,5,6,8,10,12};
4651  Int_t ptbin = -1;
4652  for(Int_t ipt = 0; ipt < 7; ipt++)
4653  {
4654  if( pt >= ptLimit[ipt] && pt < ptLimit[ipt+1] )
4655  {
4656  ptbin = ipt;
4657  break;
4658  }
4659  }
4660  if(ptbin >= 0) fhEtaPhiLam0BinPtBin[isolated][ptbin]->Fill(eta, phi, GetEventWeight());
4661  }
4662  }
4663 
4664  // Conversion radius
4665  if( IsDataMC() &&
4666  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
4667  GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
4668  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
4669  !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)
4670  )
4671  {
4672  Int_t pdg = 0, status = 0, momLabel = -1;
4673  Int_t pdgD = 0, statusD = 0, daugLabel = -1;
4674  Bool_t ok = kFALSE, okD = kFALSE;
4675 
4676  //fPrimaryMom =
4677  GetMCAnalysisUtils()->GetMother(aod->GetLabel(),GetReader(), pdg, status, ok, momLabel);
4678  //fMomentum =
4679  GetMCAnalysisUtils()->GetDaughter(0,momLabel,GetReader(),pdgD, statusD, okD, daugLabel, fProdVertex);
4680 
4681  if(okD)
4682  {
4683  Float_t prodR = TMath::Sqrt(fProdVertex.X()*fProdVertex.X()+fProdVertex.Y()*fProdVertex.Y());
4684 
4685  //printf("Iso %d, Conversion: mom pdg %d (stat %d), 1st daugher %d (stat %d), mom label %d, org label %d, daugh label %d, prodR %f\n", isolated, pdg,status, pdgD, statusD,
4686  // momLabel, aod->GetLabel(),daugLabel,prodR);
4687 
4688  fhMCConversionVertex[isolated]->Fill(pt,prodR,GetEventWeight());
4689  if(GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 && iSM >= GetFirstSMCoveredByTRD() )
4690  fhMCConversionVertexTRD[isolated]->Fill(pt,prodR,GetEventWeight());
4691 
4692  if(fFillSSHisto)
4693  {
4694 
4695  Int_t convR = -1;
4696  if ( prodR < 75. ) convR = 0;
4697  else if ( prodR < 275. ) convR = 1;
4698  else if ( prodR < 375. ) convR = 2;
4699  else if ( prodR < 400. ) convR = 3;
4700  else if ( prodR < 430. ) convR = 4;
4701  else convR = 5;
4702 
4703  if ( convR >= 0 )
4704  {
4705  fhMCConversionLambda0Rcut[convR][isolated]->Fill(pt,m02,GetEventWeight());
4706  if ( GetCalorimeter() == kEMCAL && GetFirstSMCoveredByTRD() >= 0 && iSM >= GetFirstSMCoveredByTRD() )
4707  fhMCConversionLambda0Rcut[convR][isolated]->Fill(pt,m02,GetEventWeight());
4708 
4709  //
4710  // EMCAL SM regions
4711  //
4712 // if ( GetCalorimeter() == kEMCAL && fFillEMCALRegionSSHistograms )
4713 // {
4714 // Int_t etaRegion = -1, phiRegion = -1;
4715 //
4716 // if ( cluster ) GetCaloUtils()->GetEMCALSubregion(cluster,GetReader()->GetEMCALCells(),etaRegion,phiRegion);
4717 //
4718 // if( etaRegion >= 0 && etaRegion < 4 && phiRegion >=0 && phiRegion < 3 )
4719 // {
4720 // fhLam0EMCALRegionMCConvRcut[isolated][etaRegion][phiRegion][convR]->Fill(pt,m02, GetEventWeight());
4721 //
4722 // if ( GetFirstSMCoveredByTRD() >= 0 && iSM >= GetFirstSMCoveredByTRD() )
4723 // fhLam0EMCALRegionTRDMCConvRcut[isolated][etaRegion][phiRegion][convR]->Fill(pt, m02, GetEventWeight());
4724 //
4725 // } // region found
4726 // } // check region
4727 
4728  } // convR > 0
4729 
4730  }
4731  } // ok MC daughter
4732  } // ok MC conversion
4733 
4734  //---------------------------------------------------------------
4735  // Fill pt/sum pT distribution of particles in cone or in UE band
4736  //---------------------------------------------------------------
4737 
4738  Float_t coneptLeadCluster= 0;
4739  Float_t coneptLeadTrack = 0;
4740  Float_t coneptsumCluster = 0;
4741  Float_t coneptsumTrack = 0;
4742  Float_t coneptsumCell = 0;
4743  Float_t etaBandptsumClusterNorm = 0;
4744  Float_t etaBandptsumTrackNorm = 0;
4745 
4746