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