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