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