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