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