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