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