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