AliPhysics  vAN-20150630 (513c479)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnaInsideClusterInvariantMass.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 is 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 <TList.h>
18 #include <TClonesArray.h>
19 #include <TObjString.h>
20 #include <TH2F.h>
21 #include <TDatabasePDG.h>
22 
23 // --- Analysis system ---
25 #include "AliCaloTrackReader.h"
26 #include "AliMCAnalysisUtils.h"
27 #include "AliStack.h"
28 #include "AliFiducialCut.h"
29 #include "TParticle.h"
30 #include "AliVCluster.h"
31 #include "AliAODEvent.h"
32 #include "AliAODMCParticle.h"
33 #include "AliEMCALGeoParams.h"
34 
35 // --- Detectors ---
36 #include "AliEMCALGeometry.h"
37 
41 
42 //__________________________________________________________________
45 //__________________________________________________________________
48  fMinNCells(0), fMinBadDist(0),
49  fHistoECut(0), fCheckSplitDistToBad(0), fFillAngleHisto(kFALSE),
50  fFillTMHisto(kFALSE), fFillTMResidualHisto(kFALSE), fFillSSExtraHisto(kFALSE),
51  fFillMCHisto(kFALSE), fFillSSWeightHisto(kFALSE),
52  fFillNLMDiffCutHisto(kFALSE), fFillEbinHisto(0),
53  fFillMCOverlapHisto(0), fFillNCellHisto(0), fFillIdConvHisto(0),
54  fFillIdEtaHisto(0), fFillHighMultHisto(0),
55  fFillArmenterosHisto(0), fFillThetaStarHisto(0),
56  fSSWeightN(0), fSSECellCutN(0),
57  fNLMSettingN(0), fWSimu(),
58  fClusterMomentum(), fSubClusterMom1(), fSubClusterMom2(),
59  fSubClusterMomSum(), fSubClusterMomBoost(),
60  fPrimaryMom(), fGrandMotherMom(),
61  fMCDaughMom1(), fMCDaughMom2(),
62  fProdVertex(),
63  // Histograms
64  fhMassAsyCutNLocMax1(0), fhMassAsyCutNLocMax2(0), fhMassAsyCutNLocMaxN(0),
65  fhM02AsyCutNLocMax1(0), fhM02AsyCutNLocMax2(0), fhM02AsyCutNLocMaxN(0),
66  fhMassM02CutNLocMax1(0), fhMassM02CutNLocMax2(0), fhMassM02CutNLocMaxN(0),
67  fhAsymM02CutNLocMax1(0), fhAsymM02CutNLocMax2(0), fhAsymM02CutNLocMaxN(0),
68  fhMassEnCutNLocMax1(0), fhMassEnCutNLocMax2(0), fhMassEnCutNLocMaxN(0),
69  fhM02EnCutNLocMax1(0), fhM02EnCutNLocMax2(0), fhM02EnCutNLocMaxN(0),
70  fhAsymEnCutNLocMax1(0), fhAsymEnCutNLocMax2(0), fhAsymEnCutNLocMaxN(0),
71  fhSplitEFracEnCutNLocMax1(0), fhSplitEFracEnCutNLocMax2(0), fhSplitEFracEnCutNLocMaxN(0),
72  fhMassSplitECutNLocMax1(0), fhMassSplitECutNLocMax2(0), fhMassSplitECutNLocMaxN(0),
73  fhMCGenFracAfterCutsNLocMax1MCPi0(0), fhMCGenFracAfterCutsNLocMax2MCPi0(0), fhMCGenFracAfterCutsNLocMaxNMCPi0(0),
74  fhMCGenSplitEFracAfterCutsNLocMax1MCPi0(0),fhMCGenSplitEFracAfterCutsNLocMax2MCPi0(0),fhMCGenSplitEFracAfterCutsNLocMaxNMCPi0(0),
75  fhNCellMassEHighNLocMax1MCPi0(0), fhNCellM02EHighNLocMax1MCPi0(0),
76  fhNCellMassELowNLocMax1MCPi0(0), fhNCellM02ELowNLocMax1MCPi0(0),
77  fhNCellMassEHighNLocMax2MCPi0(0), fhNCellM02EHighNLocMax2MCPi0(0),
78  fhNCellMassELowNLocMax2MCPi0(0), fhNCellM02ELowNLocMax2MCPi0(0),
79  fhNCellMassEHighNLocMaxNMCPi0(0), fhNCellM02EHighNLocMaxNMCPi0(0),
80  fhNCellMassELowNLocMaxNMCPi0(0), fhNCellM02ELowNLocMaxNMCPi0(0),
81  fhAnglePairPrimPi0RecoNLocMax1(0), fhAnglePairPrimPi0RecoNLocMax2(0), fhAnglePairPrimPi0RecoNLocMaxN(0),
82  fhAnglePairPrimPi0vsRecoNLocMax1(0), fhAnglePairPrimPi0vsRecoNLocMax2(0), fhAnglePairPrimPi0vsRecoNLocMaxN(0),
83  fhAnglePairPrimPi0OverM02NLocMax1(0), fhAnglePairPrimPi0OverM02NLocMax2(0), fhAnglePairPrimPi0OverM02NLocMaxN(0),
84  fhCentralityPi0NLocMax1(0), fhCentralityEtaNLocMax1(0),
85  fhCentralityPi0NLocMax2(0), fhCentralityEtaNLocMax2(0),
86  fhCentralityPi0NLocMaxN(0), fhCentralityEtaNLocMaxN(0),
87  fhEventPlanePi0NLocMax1(0), fhEventPlaneEtaNLocMax1(0),
88  fhEventPlanePi0NLocMax2(0), fhEventPlaneEtaNLocMax2(0),
89  fhEventPlanePi0NLocMaxN(0), fhEventPlaneEtaNLocMaxN(0),
90  fhClusterEtaPhiNLocMax1(0), fhClusterEtaPhiNLocMax2(0), fhClusterEtaPhiNLocMaxN(0),
91  fhPi0EtaPhiNLocMax1(0), fhPi0EtaPhiNLocMax2(0), fhPi0EtaPhiNLocMaxN(0),
92  fhEtaEtaPhiNLocMax1(0), fhEtaEtaPhiNLocMax2(0), fhEtaEtaPhiNLocMaxN(0),
93  fhPi0EPairDiffTimeNLM1(0), fhPi0EPairDiffTimeNLM2(0), fhPi0EPairDiffTimeNLMN(0),
94  fhEtaEPairDiffTimeNLM1(0), fhEtaEPairDiffTimeNLM2(0), fhEtaEPairDiffTimeNLMN(0),
95  fhMCPi0HighNLMPair(0), fhMCPi0LowNLMPair(0),
96  fhMCPi0AnyNLMPair(0), fhMCPi0NoneNLMPair(0),
97  fhMCPi0HighNLMPairNoMCMatch(0), fhMCPi0LowNLMPairNoMCMatch(0),
98  fhMCPi0AnyNLMPairNoMCMatch(0), fhMCPi0NoneNLMPairNoMCMatch(0),
99  fhMCPi0HighNLMPairOverlap(0), fhMCPi0LowNLMPairOverlap(0),
100  fhMCPi0AnyNLMPairOverlap(0), fhMCPi0NoneNLMPairOverlap(0),
101  fhMCPi0HighNLMPairNoMCMatchOverlap(0), fhMCPi0LowNLMPairNoMCMatchOverlap(0),
102  fhMCPi0AnyNLMPairNoMCMatchOverlap(0), fhMCPi0NoneNLMPairNoMCMatchOverlap(0),
103  fhMCPi0DecayPhotonHitHighLM(0), fhMCPi0DecayPhotonAdjHighLM(0),
104  fhMCPi0DecayPhotonHitOtherLM(0), fhMCPi0DecayPhotonAdjOtherLM(0),
105  fhMCPi0DecayPhotonAdjacent(0), fhMCPi0DecayPhotonHitNoLM(0),
106  fhMCPi0DecayPhotonHitHighLMOverlap(0), fhMCPi0DecayPhotonAdjHighLMOverlap(0),
107  fhMCPi0DecayPhotonHitOtherLMOverlap(0), fhMCPi0DecayPhotonAdjOtherLMOverlap(0),
108  fhMCPi0DecayPhotonAdjacentOverlap(0), fhMCPi0DecayPhotonHitNoLMOverlap(0),
109  fhMCEOverlapType(0), fhMCEOverlapTypeMatch(0)
110 {
111  for(Int_t i = 0; i < 7; i++)
112  {
113  for(Int_t j = 0; j < 2; j++)
114  {
115  fhMassNLocMax1[i][j] = 0;
116  fhMassNLocMax2[i][j] = 0;
117  fhMassNLocMaxN[i][j] = 0;
118  fhMassSplitENLocMax1[i][j] = 0;
119  fhMassSplitENLocMax2[i][j] = 0;
120  fhMassSplitENLocMaxN[i][j] = 0;
121  fhNLocMax[i][j] = 0;
122  fhNLocMaxM02Cut[i][j] = 0;
123  fhSplitClusterENLocMax [i][j] = 0;
124  fhSplitClusterEPi0NLocMax[i][j] = 0;
125  fhM02NLocMax1[i][j] = 0;
126  fhM02NLocMax2[i][j] = 0;
127  fhM02NLocMaxN[i][j] = 0;
128  fhNCellNLocMax1[i][j] = 0;
129  fhNCellNLocMax2[i][j] = 0;
130  fhNCellNLocMaxN[i][j] = 0;
131  fhM02Pi0NLocMax1[i][j] = 0;
132  fhM02EtaNLocMax1[i][j] = 0;
133  fhM02ConNLocMax1[i][j] = 0;
134  fhM02Pi0NLocMax2[i][j] = 0;
135  fhM02EtaNLocMax2[i][j] = 0;
136  fhM02ConNLocMax2[i][j] = 0;
137  fhM02Pi0NLocMaxN[i][j] = 0;
138  fhM02EtaNLocMaxN[i][j] = 0;
139  fhM02ConNLocMaxN[i][j] = 0;
140 
141  fhMassPi0NLocMax1[i][j] = 0;
142  fhMassEtaNLocMax1[i][j] = 0;
143  fhMassConNLocMax1[i][j] = 0;
144  fhMassPi0NLocMax2[i][j] = 0;
145  fhMassEtaNLocMax2[i][j] = 0;
146  fhMassConNLocMax2[i][j] = 0;
147  fhMassPi0NLocMaxN[i][j] = 0;
148  fhMassEtaNLocMaxN[i][j] = 0;
149  fhMassConNLocMaxN[i][j] = 0;
150 
151  fhNCellPi0NLocMax1[i][j] = 0;
152  fhNCellEtaNLocMax1[i][j] = 0;
153  fhNCellPi0NLocMax2[i][j] = 0;
154  fhNCellEtaNLocMax2[i][j] = 0;
155  fhNCellPi0NLocMaxN[i][j] = 0;
156  fhNCellEtaNLocMaxN[i][j] = 0;
157 
158  fhAsyPi0NLocMax1[i][j] = 0;
159  fhAsyEtaNLocMax1[i][j] = 0;
160  fhAsyConNLocMax1[i][j] = 0;
161  fhAsyPi0NLocMax2[i][j] = 0;
162  fhAsyEtaNLocMax2[i][j] = 0;
163  fhAsyConNLocMax2[i][j] = 0;
164  fhAsyPi0NLocMaxN[i][j] = 0;
165  fhAsyEtaNLocMaxN[i][j] = 0;
166  fhAsyConNLocMaxN[i][j] = 0;
167 
168  fhMassM02NLocMax1[i][j]= 0;
169  fhMassM02NLocMax2[i][j]= 0;
170  fhMassM02NLocMaxN[i][j]= 0;
171 
172  fhMassSplitEPi0NLocMax1[i][j] = 0;
173  fhMassSplitEPi0NLocMax2[i][j] = 0;
174  fhMassSplitEPi0NLocMaxN[i][j] = 0;
175 
179 
180 
181  fhMassDispEtaNLocMax1[i][j]= 0;
182  fhMassDispEtaNLocMax2[i][j]= 0;
183  fhMassDispEtaNLocMaxN[i][j]= 0;
184  fhMassDispPhiNLocMax1[i][j]= 0;
185  fhMassDispPhiNLocMax2[i][j]= 0;
186  fhMassDispPhiNLocMaxN[i][j]= 0;
187  fhMassDispAsyNLocMax1[i][j]= 0;
188  fhMassDispAsyNLocMax2[i][j]= 0;
189  fhMassDispAsyNLocMaxN[i][j]= 0;
190 
191  fhSplitEFractionNLocMax1[i][j]=0;
192  fhSplitEFractionNLocMax2[i][j]=0;
193  fhSplitEFractionNLocMaxN[i][j]=0;
194 
195  fhAnglePairNLocMax1 [i][j] = 0;
196  fhAnglePairNLocMax2 [i][j] = 0;
197  fhAnglePairNLocMaxN [i][j] = 0;
198 
202 
203  fhAnglePairPi0NLocMax1 [i][j] = 0;
204  fhAnglePairPi0NLocMax2 [i][j] = 0;
205  fhAnglePairPi0NLocMaxN [i][j] = 0;
206 
207  fhAnglePairMassNLocMax1 [i][j] = 0;
208  fhAnglePairMassNLocMax2 [i][j] = 0;
209  fhAnglePairMassNLocMaxN [i][j] = 0;
210 
211  fhAnglePairM02NLocMax1 [i][j] = 0;
212  fhAnglePairM02NLocMax2 [i][j] = 0;
213  fhAnglePairM02NLocMaxN [i][j] = 0;
214 
215  fhAnglePairOverM02NLocMax1 [i][j] = 0;
216  fhAnglePairOverM02NLocMax2 [i][j] = 0;
217  fhAnglePairOverM02NLocMaxN [i][j] = 0;
218 
222 
223  fhCosThStarNLocMax1 [i][j] = 0;
224  fhCosThStarNLocMax2 [i][j] = 0;
225  fhCosThStarNLocMaxN [i][j] = 0;
226 
230 
231  fhCosThStarPi0NLocMax1 [i][j] = 0;
232  fhCosThStarPi0NLocMax2 [i][j] = 0;
233  fhCosThStarPi0NLocMaxN [i][j] = 0;
234 
235  fhMCGenFracNLocMax1[i][j]= 0;
236  fhMCGenFracNLocMax2[i][j]= 0;
237  fhMCGenFracNLocMaxN[i][j]= 0;
238 
242 
243  fhMCGenSplitEFracNLocMax1[i][j]= 0;
244  fhMCGenSplitEFracNLocMax2[i][j]= 0;
245  fhMCGenSplitEFracNLocMaxN[i][j]= 0;
246 
250 
254 
255  fhMCGenEvsSplitENLocMax1[i][j]= 0;
256  fhMCGenEvsSplitENLocMax2[i][j]= 0;
257  fhMCGenEvsSplitENLocMaxN[i][j]= 0;
258 
259  fhAsymNLocMax1 [i][j] = 0;
260  fhAsymNLocMax2 [i][j] = 0;
261  fhAsymNLocMaxN [i][j] = 0;
262 
263  fhMassAfterCutsNLocMax1[i][j] = 0;
264  fhMassAfterCutsNLocMax2[i][j] = 0;
265  fhMassAfterCutsNLocMaxN[i][j] = 0;
266 
270  }
271 
272  for(Int_t jj = 0; jj < 4; jj++)
273  {
274  fhM02MCGenFracNLocMax1Ebin[i][jj] = 0;
275  fhM02MCGenFracNLocMax2Ebin[i][jj] = 0;
276  fhM02MCGenFracNLocMaxNEbin[i][jj] = 0;
277 
278  fhMassMCGenFracNLocMax1Ebin[i][jj]= 0;
279  fhMassMCGenFracNLocMax2Ebin[i][jj]= 0;
280  fhMassMCGenFracNLocMaxNEbin[i][jj]= 0;
281 
282  fhMCGenFracNLocMaxEbin[i][jj] = 0;
284 
288  }
289 
296 
303 
310 
311  for(Int_t nlm = 0; nlm < 3; nlm++)
312  {
313  fhMCEM02Overlap0 [nlm][i] = 0;
314  fhMCEM02Overlap1 [nlm][i] = 0;
315  fhMCEM02OverlapN [nlm][i] = 0;
316  fhMCEM02Overlap0Match[nlm][i] = 0;
317  fhMCEM02Overlap1Match[nlm][i] = 0;
318  fhMCEM02OverlapNMatch[nlm][i] = 0;
319 
320  fhMCEMassOverlap0 [nlm][i] = 0;
321  fhMCEMassOverlap1 [nlm][i] = 0;
322  fhMCEMassOverlapN [nlm][i] = 0;
323  fhMCEMassOverlap0Match[nlm][i] = 0;
324  fhMCEMassOverlap1Match[nlm][i] = 0;
325  fhMCEMassOverlapNMatch[nlm][i] = 0;
326 
327  fhMCEAsymOverlap0 [nlm][i] = 0;
328  fhMCEAsymOverlap1 [nlm][i] = 0;
329  fhMCEAsymOverlapN [nlm][i] = 0;
330  fhMCEAsymOverlap0Match[nlm][i] = 0;
331  fhMCEAsymOverlap1Match[nlm][i] = 0;
332  fhMCEAsymOverlapNMatch[nlm][i] = 0;
333 
334  fhMCENCellOverlap0 [nlm][i] = 0;
335  fhMCENCellOverlap1 [nlm][i] = 0;
336  fhMCENCellOverlapN [nlm][i] = 0;
337  fhMCENCellOverlap0Match[nlm][i] = 0;
338  fhMCENCellOverlap1Match[nlm][i] = 0;
339  fhMCENCellOverlapNMatch[nlm][i] = 0;
340 
341  fhMCEEpriOverlap0 [nlm][i] = 0;
342  fhMCEEpriOverlap1 [nlm][i] = 0;
343  fhMCEEpriOverlapN [nlm][i] = 0;
344  fhMCEEpriOverlap0Match[nlm][i] = 0;
345  fhMCEEpriOverlap1Match[nlm][i] = 0;
346  fhMCEEpriOverlapNMatch[nlm][i] = 0;
347 
348  fhMCEEpriOverlap0IdPi0[nlm][i] = 0;
349  fhMCEEpriOverlap1IdPi0[nlm][i] = 0;
350  fhMCEEpriOverlapNIdPi0[nlm][i] = 0;
351 
352  fhMCESplitEFracOverlap0 [nlm][i] = 0;
353  fhMCESplitEFracOverlap1 [nlm][i] = 0;
354  fhMCESplitEFracOverlapN [nlm][i] = 0;
355  fhMCESplitEFracOverlap0Match[nlm][i] = 0;
356  fhMCESplitEFracOverlap1Match[nlm][i] = 0;
357  fhMCESplitEFracOverlapNMatch[nlm][i] = 0;
358 
359  fhMCENOverlaps [nlm][i] = 0;
360  fhMCENOverlapsMatch [nlm][i] = 0;
361 
362  if(i > 3) continue ;
363 
364  fhMCPi0MassM02Overlap0 [nlm][i] = 0;
365  fhMCPi0MassM02Overlap1 [nlm][i] = 0;
366  fhMCPi0MassM02OverlapN [nlm][i] = 0;
367  fhMCPi0MassM02Overlap0Match[nlm][i] = 0;
368  fhMCPi0MassM02Overlap1Match[nlm][i] = 0;
369  fhMCPi0MassM02OverlapNMatch[nlm][i] = 0;
370  }
371  }
372 
373  for(Int_t i = 0; i < 2; i++)
374  {
378  }
379 
380  for(Int_t i = 0; i < 4; i++)
381  {
382  fhMassM02NLocMax1Ebin[i] = 0 ;
383  fhMassM02NLocMax2Ebin[i] = 0 ;
384  fhMassM02NLocMaxNEbin[i] = 0 ;
385 
386  fhMassAsyNLocMax1Ebin[i] = 0 ;
387  fhMassAsyNLocMax2Ebin[i] = 0 ;
388  fhMassAsyNLocMaxNEbin[i] = 0 ;
389 
393 
397 
400  fhMassDispPhiNLocMaxNEbin[i] = 0 ;
401 
404  fhMassDispAsyNLocMaxNEbin[i] = 0 ;
405 
409  }
410 
411  for(Int_t nlm = 0; nlm < 3; nlm++)
412  {
413 
418 
423 
428 
433 
438 
443 
448 
453 
458  fhMCPi0DecayPhotonAdjacentMass [nlm] = 0 ;
459  fhMCPi0DecayPhotonHitNoLMMass [nlm] = 0 ;
460 
467 
468  fhPi0CellE [nlm] = 0 ;
469  fhPi0CellEFrac [nlm] = 0 ;
470  fhPi0CellLogEFrac[nlm] = 0 ;
471 
472  fhPi0CellEMaxEMax2Frac [nlm] = 0 ;
473  fhPi0CellEMaxClusterFrac [nlm] = 0 ;
474  fhPi0CellEMax2ClusterFrac[nlm] = 0 ;
475 
476  fhPi0CellEMaxFrac [nlm] = 0 ;
477  fhPi0CellEMax2Frac[nlm] = 0 ;
478 
479  for(Int_t i = 0; i < 20; i++)
480  {
481  fhM02WeightPi0 [nlm][i] = 0;
482  fhM02ECellCutPi0[nlm][i] = 0;
483  }
484 
485  fhMassBadDistClose[nlm] = 0;
486  fhM02BadDistClose [nlm] = 0;
487  fhMassOnBorder [nlm] = 0;
488  fhM02OnBorder [nlm] = 0;
489 
490  fhAsyMCGenRecoDiffMCPi0 [nlm] = 0;
492 
493  }
494 
495  for(Int_t i = 0; i < 7; i++)
496  {
497  for(Int_t j = 0; j < 4; j++)
498  {
499  fhArmNLocMax1[i][j] = 0;
500  fhArmNLocMax2[i][j] = 0;
501  fhArmNLocMaxN[i][j] = 0;
502 
503  fhArmPi0NLocMax1[i][j] = 0;
504  fhArmPi0NLocMax2[i][j] = 0;
505  fhArmPi0NLocMaxN[i][j] = 0;
506 
507  fhArmAfterCutsNLocMax1[i][j] = 0;
508  fhArmAfterCutsNLocMax2[i][j] = 0;
509  fhArmAfterCutsNLocMaxN[i][j] = 0;
510  }
511  }
512 
513  for(Int_t i = 0; i < 5; i++)
514  {
515  for(Int_t j = 0; j < 5; j++)
516  {
517  fhNLocMaxDiffCut [i][j][0] = 0;
518  fhNLocMaxDiffCut [i][j][1] = 0;
519  fhNLocMaxDiffCutPi0[i][j][0] = 0;
520  fhNLocMaxDiffCutPi0[i][j][1] = 0;
521  for(Int_t k = 0; k < 3; k++)
522  {
523  fhM02NLocMaxDiffCut [i][j][k][0] = 0;
524  fhM02NLocMaxDiffCut [i][j][k][1] = 0;
525  fhM02NLocMaxDiffCutPi0 [i][j][k][0] = 0;
526  fhM02NLocMaxDiffCutPi0 [i][j][k][1] = 0;
527  fhMassNLocMaxDiffCut [i][j][k][0] = 0;
528  fhMassNLocMaxDiffCut [i][j][k][1] = 0;
529  fhMassNLocMaxDiffCutPi0[i][j][k][0] = 0;
530  fhMassNLocMaxDiffCutPi0[i][j][k][1] = 0;
531  }
532  }
533  }
534 
535  InitParameters();
536 }
537 
538 //___________________________________________________________________________________________________________________
541 //___________________________________________________________________________________________________________________
542 void AliAnaInsideClusterInvariantMass::CheckLocalMaximaMCOrigin(AliVCluster* cluster, Int_t mcindex, Int_t noverlaps,
543  Float_t e1, Float_t e2, Float_t mass)
544  //Float_t m02,
545  //TLorentzVector l1, TLorentzVector l2)
546 {
547  if(mcindex != kmcPi0 && mcindex != kmcPi0Conv) return;
548 
549  const UInt_t nc = cluster->GetNCells();
550  Int_t list[nc];
551  Float_t elist[nc];
552  Int_t nMax = GetCaloUtils()->GetNumberOfLocalMaxima(cluster, GetEMCALCells(),list, elist);
553 
555 
556  //if(mcindex==kmcPi0) printf("** Normal Pi0 **\n");
557  //if(mcindex==kmcPi0Conv) printf("** Converted Pi0 **\n");
558 
559 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
560 // {
561 // printf("** N max %d - Overlaps = %d **, mass %2.2f, m02 %2.2f, Cl1(E,eta,phi)=(%2.2f,%2.2f,%2.2f),Cl2(E,eta,phi)=(%2.2f,%2.2f,%2.2f), mass(1,2) %2.2f \n",
562 // nMax, noverlaps,mass,m02,
563 // l1.E(),l1.Eta(),l1.Phi()*TMath::RadToDeg(),
564 // l2.E(),l2.Eta(),l2.Phi()*TMath::RadToDeg(), (l1+l2).M());
565 //
566 // // Study the mothers of cluster
567 // printf("Cluster MC labels %d \n", cluster->GetNLabels());
568 // for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
569 // {
570 // Int_t mclabel = cluster->GetLabels()[ilab];
571 //
572 // Bool_t mOK = 0;
573 // Int_t mpdg = -999999;
574 // Int_t mstatus = -1;
575 // Int_t grandLabel = -1;
576 // fPrimaryMom = GetMCAnalysisUtils()->GetMother(mclabel,GetReader(),mpdg,mstatus,mOK,grandLabel);
577 //
578 // printf("******** mother %d : Label %d, pdg %d; status %d, E %2.2f, Eta %2.2f, Phi %2.2f, ok %d, mother label %d\n",
579 // ilab, mclabel, mpdg, mstatus,fPrimaryMom.E(), fPrimaryMom.Eta(),fPrimaryMom.Phi()*TMath::RadToDeg(),mOK,grandLabel);
580 //
581 // if( ( mpdg == 22 || TMath::Abs(mpdg)==11 ) && grandLabel >=0 )
582 // {
583 // while( ( mpdg == 22 || TMath::Abs(mpdg)==11 ) && grandLabel >=0 )
584 // {
585 // Int_t newLabel = -1;
586 // TLorentzVector grandmother = GetMCAnalysisUtils()->GetMother(grandLabel,GetReader(),mpdg,mstatus,mOK,newLabel);
587 // printf("\t grandmother %d : Label %d, pdg %d; status %d, E %2.2f, Eta %2.2f, Phi %2.2f, ok %d, mother label %d\n",
588 // ilab, grandLabel, mpdg, mstatus,grandmother.E(), grandmother.Eta(), grandmother.Phi()*TMath::RadToDeg(),mOK,newLabel);
589 // grandLabel = newLabel;
590 //
591 // }
592 // }
593 // }
594 //
595 // printf("Cells in cluster %d\n",cluster->GetNCells() );
596 // for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
597 // {
598 // Int_t absIdCell = cluster->GetCellAbsId(icell);
599 // Int_t mcLabel = GetEMCALCells()->GetCellMCLabel(absIdCell);
600 // GetReader()->RemapMCLabelForAODs(mcLabel);
601 // Int_t ietac=-1; Int_t iphic = 0; Int_t rcuc = 0;
602 // Int_t smc = GetModuleNumberCellIndexes(absIdCell,GetCalorimeter(), ietac, iphic, rcuc);
603 //
604 // printf(" \t cell i %d, abs %d, amp %2.3f, mclabel %d, (sm,ieta,iphi)=(%d,%d,%d)\n",icell,absIdCell,GetEMCALCells()->GetCellAmplitude(absIdCell),mcLabel,smc,ietac,iphic);
605 // }
606 // }
608 
609  //If only one maxima, consider all the towers in the cluster
610  if(nMax==1)
611  {
612  for (UInt_t icell = 0; icell < nc; icell++ )
613  {
614  list [icell] = cluster->GetCellAbsId(icell);
615  elist[icell] = GetEMCALCells()->GetCellAmplitude(list[icell]);
616  }
617  }
618 
619  Int_t nmaxima = nMax;
620  if(nMax==1) nmaxima = nc ;
621 
622  //Find highest energy Local Maxima Towers
623  Int_t imax = 999;
624  Int_t imax2 = 999;
625  Float_t emax = -1;
626  Float_t emax2 = -1;
627  for(Int_t i = 0; i < nmaxima; i++)
628  {
629  //printf("i %d: AbsId %d; E %2.3f\n",i,list[i],elist[i]);
630  if(elist[i] > emax)
631  {
632  imax = i;
633  emax = elist[i];
634  }
635  }
636 
637  //Find second highest
638  for(Int_t i = 0; i < nmaxima; i++)
639  {
640  if(i==imax) continue;
641 
642  //printf("j %d: AbsId %d; E %2.3f\n",i,list[i],elist[i]);
643 
644  if(elist[i] > emax2)
645  {
646  imax2 = i;
647  emax2 = elist[i];
648  }
649  }
650 
651 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
652 // printf("Local maxima: a) index %d, absId %d; b) index %d, absId %d\n",imax, list[imax], imax2, list[imax2]);
653 
654  //---------------------------------------------------------
655  //---------------------------------------------------------
656  // Compare ancestors of all local maxima at cell MC level
657  //---------------------------------------------------------
658  //---------------------------------------------------------
659 
660  // Check that the highest mc label and the max cluster label are the same
661  Int_t mcLabelMax = -1 ;
662  if(imax >=0 && imax < 999)
663  {
664  mcLabelMax = GetEMCALCells()->GetCellMCLabel(list[imax]);
665  GetReader()->RemapMCLabelForAODs(mcLabelMax);
666  }
667 
668  Int_t mcLabelMax2 = -1 ;
669  if(imax2 >=0 && imax2 < 999)
670  {
671  mcLabelMax2 = GetEMCALCells()->GetCellMCLabel(list[imax2]);
672  GetReader()->RemapMCLabelForAODs(mcLabelMax2);
673  }
674 
675  Int_t mcLabelclusterMax = cluster->GetLabels()[0];
676  Bool_t matchHighLMAndHighMC = kFALSE;
677 
678  //printf("MC label: LM1 %d, LM2 %d, cluster %d\n",mcLabelMax,mcLabelMax2,mcLabelclusterMax);
679 
680  if(mcLabelclusterMax == mcLabelMax && mcLabelclusterMax >= 0)
681  {
682  matchHighLMAndHighMC = kTRUE;
683  //printf("\t *** MATCH cluster and LM maximum ***\n");
684  }
685  else
686  {
687  //printf("\t *** NO MATCH cluster and LM maximum, check second ***\n");
688  if(mcLabelclusterMax == mcLabelMax2 && mcLabelclusterMax >= 0)
689  {
690  //printf("\t \t *** MATCH cluster and 2nd LM maximum ***\n");
691  matchHighLMAndHighMC = kTRUE;
692  }
693  else
694  {
695  //printf("\t \t *** NO MATCH***\n");
696  matchHighLMAndHighMC = kFALSE;
697  }
698  }
699 
700  // Compare the common ancestors of the 2 highest energy local maxima
701  Int_t ancPDG = 0, ancStatus = -1;
702  Int_t ancLabel = 0;
703  Bool_t high = kFALSE;
704  Bool_t low = kFALSE;
705 
706 // // print maxima origin
707 // for(Int_t i = 0; i < nMax; i++)
708 // {
709 // Int_t mcLabel1 = GetEMCALCells()->GetCellMCLabel(list[i]);
710 // GetReader()->RemapMCLabelForAODs(mcLabel1);
711 //
712 // Bool_t ok =kFALSE,gok = kFALSE;
713 // Int_t pdg = -22222, status = -1;
714 // Int_t gpdg = -22222, gstatus = -1;
715 // Int_t ggpdg = -22222, ggstatus = -1;
716 // Int_t gLabel = -1, ggLabel = -1;
717 // TLorentzVector primary =GetMCAnalysisUtils()->GetMother (mcLabel1,GetReader(), pdg, status, ok);
718 // TLorentzVector gprimary =GetMCAnalysisUtils()->GetGrandMother(mcLabel1,GetReader(), gpdg, gstatus,gok, gLabel,ggLabel);
719 // TLorentzVector ggprimary =GetMCAnalysisUtils()->GetMother(ggLabel ,GetReader(),ggpdg,ggstatus,gok);
720 // printf("Max index %d; mother: Label %d; PDG %d; E %2.2f - grand mother label %d; PDG %d; E %2.2f- great grand mother label %d; PDG %d; E %2.2f\n",
721 // i,mcLabel1,pdg,primary.E(), gLabel,gpdg,gprimary.E(), ggLabel,ggpdg,ggprimary.E());
722 // }
723 
724  for(Int_t i = 0; i < nmaxima-1; i++)
725  {
726  Int_t mcLabel1 = GetEMCALCells()->GetCellMCLabel(list[i]);
727  GetReader()->RemapMCLabelForAODs(mcLabel1);
728 
729  for(Int_t j = i+1; j < nmaxima; j++)
730  {
731  Int_t mcLabel2 = GetEMCALCells()->GetCellMCLabel(list[j]);
732  GetReader()->RemapMCLabelForAODs(mcLabel2);
733 
734  if(mcLabel1 < 0 || mcLabel2 < 0 )
735  {
736  //printf("\t i %d label %d - j %d label %d; skip!\n",i,mcLabel1,j,mcLabel2);
737  continue;
738  }
739 
740  ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(mcLabel1,mcLabel2,
741  GetReader(),ancPDG,ancStatus,fPrimaryMom,fProdVertex);
742  if(ancPDG==111)
743  {
744  if((i==imax && j==imax2) || (j==imax && i==imax2))
745  high = kTRUE;
746  else
747  low = kTRUE;
748  }
749  else if(ancPDG==22 || TMath::Abs(ancPDG)==11)
750  {
751  // If both bits are set, it could be that one of the maxima had a conversion
752  // reset the bit in this case
753  if(high && low)
754  {
755  //printf("\t Reset low bit\n");
756  low = kFALSE;
757  }
758  }
759 
760  Bool_t ok =kFALSE;
761  Int_t pdg = -22222, status = -1;
762  fPrimaryMom = GetMCAnalysisUtils()->GetMother(ancLabel,GetReader(), pdg, status, ok);
763  //printf("\t i %d label %d - j %d label %d; ancestor label %d, PDG %d-%d; E %2.2f; high %d, any %d \n",i,mcLabel1,j,mcLabel2, ancLabel, ancPDG,pdg, primary.E(), high, low);
764  }
765  }
766 
767  Float_t en = cluster->E();
768 
769 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
770 // printf("Cell MC match: nMax %d; Match MC? %d; high %d; low %d\n",nMax,matchHighLMAndHighMC,high,low);
771 
772  if(!noverlaps)
773  {
774  if(matchHighLMAndHighMC)
775  {
776  if (high && !low) fhMCPi0HighNLMPair->Fill(en, nMax, GetEventWeight());
777  else if(low && !high) fhMCPi0LowNLMPair ->Fill(en, nMax, GetEventWeight());
778  else if(low && high) fhMCPi0AnyNLMPair ->Fill(en, nMax, GetEventWeight());
779  else fhMCPi0NoneNLMPair->Fill(en, nMax, GetEventWeight());
780  }
781  else
782  {
783  if (high && !low) fhMCPi0HighNLMPairNoMCMatch->Fill(en, nMax, GetEventWeight());
784  else if(low && !high) fhMCPi0LowNLMPairNoMCMatch ->Fill(en, nMax, GetEventWeight());
785  else if(low && high) fhMCPi0AnyNLMPairNoMCMatch ->Fill(en, nMax, GetEventWeight());
786  else fhMCPi0NoneNLMPairNoMCMatch->Fill(en, nMax, GetEventWeight());
787  }
788  }
789  else
790  {
791  if(matchHighLMAndHighMC)
792  {
793  if (high && !low) fhMCPi0HighNLMPairOverlap->Fill(en, nMax, GetEventWeight());
794  else if(low && !high) fhMCPi0LowNLMPairOverlap ->Fill(en, nMax, GetEventWeight());
795  else if(low && high) fhMCPi0AnyNLMPairOverlap ->Fill(en, nMax, GetEventWeight());
796  else fhMCPi0NoneNLMPairOverlap->Fill(en, nMax, GetEventWeight());
797  }
798  else
799  {
800  if (high && !low) fhMCPi0HighNLMPairNoMCMatchOverlap->Fill(en, nMax, GetEventWeight());
801  else if(low && !high) fhMCPi0LowNLMPairNoMCMatchOverlap ->Fill(en, nMax, GetEventWeight());
802  else if(low && high) fhMCPi0AnyNLMPairNoMCMatchOverlap ->Fill(en, nMax, GetEventWeight());
803  else fhMCPi0NoneNLMPairNoMCMatchOverlap->Fill(en, nMax, GetEventWeight());
804  }
805  }
806 
807  //----------------------------------------------------------------------
808  //----------------------------------------------------------------------
809  // Compare MC decay photon projection to cell location and Local Maxima
810  //----------------------------------------------------------------------
811  //----------------------------------------------------------------------
812 
813  // Get the mother pi0
814 
815  Bool_t ok = kFALSE;
816  Int_t pdg = -22222, status = -1;
817  Int_t gLabel = -1;
818 
819  Int_t label = cluster->GetLabel();
820 
821  while( pdg!=111 && label >=0 )
822  {
823  fPrimaryMom = GetMCAnalysisUtils()->GetGrandMother(label,GetReader(),pdg,status,ok, label,gLabel);
824  }
825 
826  if(pdg!=111 || label < 0)
827  {
828  AliWarning("Mother Pi0 not found!");
829  return;
830  }
831 
832  Int_t nDaugthers = GetMCAnalysisUtils()->GetNDaughters(label,GetReader(),ok);
833 
834  if(nDaugthers != 2)
835  {
836  AliWarning(Form("N daughters %d !=2!",nDaugthers));
837  return;
838  }
839 
840  // Get daughter photon kinematics
841  Int_t pdg0 = -22222, status0 = -1; Int_t label0 = -1;
842  fMCDaughMom1 = GetMCAnalysisUtils()->GetDaughter(0,label,GetReader(),pdg0,status0,ok,label0);
843  Int_t pdg1 = -22222, status1 = -1; Int_t label1 = -1;
844  fMCDaughMom2 = GetMCAnalysisUtils()->GetDaughter(1,label,GetReader(),pdg1,status1,ok,label1);
845 
846  if(pdg1!=22 || pdg0 != 22)
847  {
848  AliWarning(Form("Wrong daughters PDG: photon0 %d - photon1 %d",pdg0,pdg1));
849  return;
850  }
851 
852  // In what cells did the photons hit
853  Float_t eta0 = fMCDaughMom1.Eta();
854  Float_t eta1 = fMCDaughMom2.Eta();
855 
856  Float_t phi0 = fMCDaughMom1.Phi();
857  Float_t phi1 = fMCDaughMom2.Phi();
858 
859 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
860 // {
861 // printf("MC pi0 label %d E %2.2f, eta %2.2f, phi %2.2f, mass (ph1, ph2) %2.2f: \n \t photon0 label %d E %2.2f, eta %2.2f, phi %2.2f \n \t photon1 label %d E %2.2f eta %2.2f, phi %2.2f\n",
862 // label , fPrimaryMom.E() , fPrimaryMom.Eta(),fPrimaryMom.Phi()*TMath::RadToDeg(), (fMCDaughMom1+fMCDaughMom2).M(),
863 // label0, fMCDaughMom1.E(), eta0, phi0*TMath::RadToDeg(),
864 // label1, fMCDaughMom2.E(), eta1, phi1*TMath::RadToDeg());
865 //
866 // TLorentzVector momclus;
867 // cluster->GetMomentum(momclus,GetVertex(0));
868 // printf("Cluster E %2.2F eta %2.2f, phi %2.2f, dist to bad %2.2f\n",momclus.E(),momclus.Eta(),momclus.Phi()*TMath::RadToDeg(), cluster->GetDistanceToBadChannel());
869 // }
870 
871  if(phi0 < 0 ) phi0+=TMath::TwoPi();
872  if(phi1 < 0 ) phi1+=TMath::TwoPi();
873 
874  Int_t absId0=-1, absId1=-1;
875  GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(eta0, phi0, absId0);
876  GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(eta1, phi1, absId1);
877 
878  if(absId0 < 0 || absId1 < 0)
879  {
880  //printf("AliAnaInsideClusterInvariantMass::CheckLocalMaximaMCOrigin(() - Photon hit AbsId: photon0 %d - photon1 %d\n",absId0,absId1);
881  return;
882  }
883 
884  //-----------------------------------------------
885  // Check that the 2 photons hit the Local Maxima
886  //-----------------------------------------------
887 
888 
889 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
890 // {
891 // printf("Photons AbsId (%d,%d); Local Maxima AbsId(%d,%d)\n",absId0,absId1,list[imax],list[imax2]);
892 // printf("Photon1 (eta,phi)=(%f,%f); Photon2 (eta,phi)=(%f,%f);\n",eta0,phi0*TMath::RadToDeg(),eta1,phi1*TMath::RadToDeg());
893 //
894 // Int_t ieta0=-1; Int_t iphi0 = 0; Int_t rcu0 = 0;
895 // Int_t sm0 = GetModuleNumberCellIndexes(absId0,GetCalorimeter(), ieta0, iphi0, rcu0);
896 // Int_t ieta1=-1; Int_t iphi1 = 0; Int_t rcu1 = 0;
897 // Int_t sm1 = GetModuleNumberCellIndexes(absId1,GetCalorimeter(), ieta1, iphi1, rcu1);
898 //
899 // printf("Photon1 (id,sm,eta,phi)=(%d,%d,%d,%d), Photon2 (id,sm,eta,phi)=(%d,%d,%d,%d)\n",
900 // absId0,sm0,ieta0,iphi0,absId1,sm1,ieta1,iphi1);
901 //
902 // Int_t ietam0=-1; Int_t iphim0 = 0; Int_t rcum0 = 0; Int_t smm0 = -1 ;
903 // if(imax >= 0) smm0 = GetModuleNumberCellIndexes(list[imax] ,GetCalorimeter(), ietam0, iphim0, rcum0);
904 // Int_t ietam1=-1; Int_t iphim1 = 0; Int_t rcum1 = 0; Int_t smm1 = -1 ;
905 // if(imax2 >= 0) smm1 = GetModuleNumberCellIndexes(list[imax2],GetCalorimeter(), ietam1, iphim1, rcum1);
906 //
907 // printf("Max (id, sm,eta,phi)=(%d,%d,%d,%d), Max2 (id, sm,eta,phi)=(%d,%d,%d,%d)\n",
908 // list[imax],smm0,ietam0,iphim0,list[imax2],smm1,ietam1,iphim1);
909 // }
910 
911  Int_t inlm = nMax-1;
912  if(inlm > 2) inlm = 2;
913 
914  Bool_t match0 = kFALSE;
915  Bool_t match1 = kFALSE;
916  Int_t imatch0 = -1;
917  Int_t imatch1 = -1;
918  if(imax >= 0 && imax2 >=0 && absId0 > 0 && absId1 > 0 )
919  {
920  if (absId0 == list[imax] ) { match0 = kTRUE ; imatch0 = imax ; }
921  else if(absId0 == list[imax2]) { match0 = kTRUE ; imatch0 = imax2 ; }
922 
923  if (absId1 == list[imax] ) { match1 = kTRUE ; imatch1 = imax ; }
924  else if(absId1 == list[imax2]) { match1 = kTRUE ; imatch1 = imax2 ; }
925  }
926 
927  //printf("primary imatch0 %d, imatch1 %d\n",imatch0,imatch1);
928 
929  // If one or the 2 not matched, check with the other MC labels
930  // only in case there was a conversion
931 
932  Int_t absId0second = -1;
933  Int_t absId1second = -1;
934  Int_t secLabel0 = -1;
935  Int_t secLabel1 = -1;
936  Int_t mcLabel0 = -1;
937  Int_t mcLabel1 = -1;
938  Bool_t secOK = 0;
939  Int_t secpdg = -999999;
940  Int_t secstatus = -1;
941  Int_t secgrandLabel = -1;
942 
943  if(match0) { secLabel0 = label0 ; mcLabel0 = label0 ; }
944  if(match1) { secLabel1 = label1 ; mcLabel1 = label1 ; }
945 
946  if((!match0 || !match1) && mcindex == kmcPi0Conv)
947  {
948  for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
949  {
950  Int_t mclabel = cluster->GetLabels()[ilab];
951 
952  //printf("Check label %d - %d\n",ilab,mclabel);
953 
954  if(mclabel == label0 || mclabel == label1)
955  {
956  //printf("continue: secLabel %d, label0 %d, label1 %d\n",mclabel,label0,label1);
957  if(mclabel == label0 && secLabel0 < 0) { secLabel0 = label0 ; mcLabel0 = label0 ; }
958  if(mclabel == label1 && secLabel1 < 0) { secLabel1 = label1 ; mcLabel1 = label1 ; }
959  continue ;
960  }
961 
962  //printf("Before while: secLabel0 %d, secLabel1 %d\n",secLabel0,secLabel1);
963 
964  // match mc label and parent photon
965  Int_t tmplabel = mclabel;
966  while((secLabel0 < 0 || secLabel1 < 0) && tmplabel > 0 )
967  {
968  fPrimaryMom = GetMCAnalysisUtils()->GetMother(tmplabel,GetReader(),secpdg,secstatus,secOK,secgrandLabel);
969 
970  //printf("\t \t while secLabel %d, mom %d, granmom %d\n",mclabel,tmplabel,secgrandLabel);
971 
972  if((secgrandLabel == label0) || (secgrandLabel == label1 ))
973  {
974  //printf("mcMatch! grand label %d, secLabel %d\n",secgrandLabel, mclabel);
975  if(!match0 && mcLabel1 != secgrandLabel) { secLabel0 = mclabel; mcLabel0 = secgrandLabel; }
976  if(!match1 && mcLabel0 != secgrandLabel) { secLabel1 = mclabel; mcLabel1 = secgrandLabel; }
977  }
978 
979  //printf("\t GrandMother %d, secLabel0 %d, secLabel1 %d \n",secgrandLabel, secLabel0,secLabel1);
980 
981  tmplabel = secgrandLabel;
982  }
983  }
984 
985  // Get the position of the found secondaries mother
986  if(!match0 && secLabel0 > 0)
987  {
988  fPrimaryMom = GetMCAnalysisUtils()->GetMother(secLabel0,GetReader(),secpdg,secstatus,secOK,secgrandLabel);
989 
990  //Float_t eta = fPrimaryMom.Eta();
991  //Float_t phi = fPrimaryMom.Phi();
992  //if(phi < 0 ) phi+=TMath::TwoPi();
993  //GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(eta, phi, absId0second);
994 
995  //printf("Secondary MC0 label %d, absId %d E %2.2F eta %2.2f, phi %f\n", secLabel0,absId0second, fPrimaryMom.E(),fPrimaryMom.Eta(),fPrimaryMom.Phi()*TMath::RadToDeg());
996 
997  if(absId0second == list[imax] ) { match0 = kTRUE ; imatch0 = imax ; }
998  if(absId0second == list[imax2]) { match0 = kTRUE ; imatch0 = imax2 ; }
999  }
1000 
1001  if(!match1 && secLabel1 > 0)
1002  {
1003  fPrimaryMom = GetMCAnalysisUtils()->GetMother(secLabel1,GetReader(),secpdg,secstatus,secOK,secgrandLabel);
1004 
1005  //Float_t eta = fPrimaryMom.Eta();
1006  //Float_t phi = fPrimaryMom.Phi();
1007  //if(phi < 0 ) phi+=TMath::TwoPi();
1008  //GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(eta, phi, absId1second);
1009 
1010  //printf("Secondary MC1 label %d absId %d E %2.2F eta %2.2f, phi %f\n",secLabel1, absId1second, fPrimaryMom.E(),fPrimaryMom.Eta(),fPrimaryMom.Phi()*TMath::RadToDeg());
1011 
1012  if(absId1second == list[imax] ) { match1 = kTRUE ; imatch1 = imax ; }
1013  if(absId1second == list[imax2]) { match1 = kTRUE ; imatch1 = imax2 ; }
1014  }
1015 
1016  //printf("secondary label mc0 %d, mc1 %d, imatch0 %d, imatch1 %d\n",secLabel0,secLabel1,imatch0,imatch1);
1017  }
1018 
1019  //printf("imatch0 %d, imatch1 %d\n",imatch0,imatch1);
1020  if( match0 && match1 )
1021  {
1022 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1023 // printf("a) Both Photons hit local maxima \n");
1024 
1025  if(!noverlaps)
1026  {
1027  fhMCPi0DecayPhotonHitHighLM ->Fill(en, nMax, GetEventWeight());
1028  fhMCPi0DecayPhotonHitHighLMMass[inlm]->Fill(en, mass, GetEventWeight());
1029  if(match0 && imatch0 == imax)
1030  {
1031  if(fMCDaughMom1.E()>0)
1033  if(fMCDaughMom2.E()>0)
1035  if(fMCDaughMom1.E()>0)
1037  if(fMCDaughMom2.E()>0)
1039  }
1040  else
1041  {
1042  if(fMCDaughMom2.E()>0)
1044  if(fMCDaughMom1.E()>0)
1046  if(fMCDaughMom2.E()>0)
1048  if(fMCDaughMom1.E()>0)
1050  }
1051  }
1052  else
1053  {
1055  fhMCPi0DecayPhotonHitHighLMOverlapMass[inlm]->Fill(en, mass, GetEventWeight());
1056  if(match0 && imatch0 == imax )
1057  {
1058  if(fMCDaughMom1.E()>0)
1060  if(fMCDaughMom2.E()>0)
1062  if(fMCDaughMom1.E()>0)
1064  if(fMCDaughMom2.E()>0)
1066  }
1067  else
1068  {
1069  if(fMCDaughMom2.E()>0)
1071  if(fMCDaughMom1.E()>0)
1073  if(fMCDaughMom2.E()>0)
1075  if(fMCDaughMom1.E()>0)
1077  }
1078  }
1079 
1080  return ;
1081  }
1082 
1083  //printf("Any match? photon0 %d, photon1 %d\n",match0,match1);
1084  //if(!match0 && !match1) printf("WARNING, LM not matched to any photon decay!\n");
1085 
1086  //---------------------------------------------
1087  // Check the adjacent cells to the local maxima
1088  //---------------------------------------------
1089 
1090  if(!match0)
1091  {
1092  if(imatch1!=imax && GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId0,list[imax])) { match0 = kTRUE; imatch0 = imax ; }
1093  //printf("imax - match0? (%d-%d)=%d, (%d-%d)=%d\n",ieta0,ietam0,ieta0-ietam0, iphi0,iphim0,iphi0-iphim0);
1094  if(imatch1!=imax2 && GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId0,list[imax2]) ) { match0 = kTRUE; imatch0 = imax2 ; }
1095  //printf("imax2 - match0? (%d-%d)=%d, (%d-%d)=%d\n",ieta0,ietam1,ieta0-ietam1, iphi0,iphim1,iphi0-iphim1);
1096  }
1097 
1098  if(!match1)
1099  {
1100  if(imatch0!=imax && GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId1,list[imax]) ) { match1 = kTRUE; imatch1 = imax ; }
1101  //printf("imax - match1? (%d-%d)=%d, (%d-%d)=%d\n",ieta1,ietam0,ieta1-ietam0, iphi1,iphim0,iphi1-iphim0);
1102 
1103  if(imatch0!=imax2 && GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId1,list[imax2])) { match1 = kTRUE; imatch1 = imax2 ; }
1104  //printf("imax2 - match1? (%d-%d)=%d, (%d-%d)=%d\n",ieta1,ietam1,ieta1-ietam1, iphi1,iphim1,iphi1-iphim1);
1105  }
1106 
1107  //printf("Local Maxima: adjacent0 %d,adjacent1 %d \n",match0,match1);
1108 
1109  if(match0 && match1)
1110  {
1111 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1112 // printf("b) Both Photons hit local maxima or cell adjacent or 2 cells adjacent \n");
1113 
1114  if(!noverlaps)
1115  {
1116  fhMCPi0DecayPhotonAdjHighLM ->Fill(en, nMax, GetEventWeight());
1117  fhMCPi0DecayPhotonAdjHighLMMass[inlm]->Fill(en, mass, GetEventWeight());
1118 
1119  if(match0 && imatch0 == imax)
1120  {
1121  if(fMCDaughMom1.E()>0)
1123  if(fMCDaughMom2.E()>0)
1125  if(fMCDaughMom1.E()>0)
1127  if(fMCDaughMom2.E()>0)
1129  }
1130  else
1131  {
1132  if(fMCDaughMom2.E()>0)
1134  if(fMCDaughMom1.E()>0)
1136  if(fMCDaughMom2.E()>0)
1138  if(fMCDaughMom1.E()>0)
1140  }
1141  }
1142  else
1143  {
1145  fhMCPi0DecayPhotonAdjHighLMOverlapMass[inlm]->Fill(en, mass, GetEventWeight());
1146  if(match0 && imatch0 == imax)
1147  {
1148  if(fMCDaughMom1.E()>0)
1150  if(fMCDaughMom2.E()>0)
1152  if(fMCDaughMom1.E()>0)
1154  if(fMCDaughMom2.E()>0)
1156  }
1157  else
1158  {
1159  if(fMCDaughMom2.E()>0)
1161  if(fMCDaughMom1.E()>0)
1163  if(fMCDaughMom2.E()>0)
1165  if(fMCDaughMom1.E()>0)
1167  }
1168  }
1169 
1170  return;
1171  }
1172 
1173  // Decay photon cells are adjacent?
1174 
1175  if( (match0 || match1) && GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId0,absId1) )
1176  {
1177 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1178 // printf("c) Both Photons hit a local maxima and in adjacent cells \n");
1179  if(!noverlaps)
1180  {
1181  fhMCPi0DecayPhotonAdjacent ->Fill(en, nMax, GetEventWeight());
1182  fhMCPi0DecayPhotonAdjacentMass[inlm]->Fill(en, mass, GetEventWeight());
1183  }
1184  else
1185  {
1187  fhMCPi0DecayPhotonAdjacentOverlapMass[inlm]->Fill(en, mass, GetEventWeight());
1188  }
1189 
1190  return;
1191  }
1192 
1193  //--------------------
1194  // Other Local maxima
1195  //--------------------
1196 
1197  Bool_t matchMCHitOtherLM = kFALSE;
1198  if(!match1)
1199  {
1200  for(Int_t i = 0; i < nmaxima; i++)
1201  {
1202  if(imax!=i && imax2!=i && absId1 == list[i]) { match1 = kTRUE; matchMCHitOtherLM = kTRUE; }
1203  }
1204  }
1205 
1206  if(!match0)
1207  {
1208  for(Int_t i = 0; i < nmaxima; i++)
1209  {
1210  if(imax!=i && imax2!=i && absId0 == list[i]) { match0 = kTRUE; matchMCHitOtherLM = kTRUE; }
1211  }
1212  }
1213 
1214  if(matchMCHitOtherLM)
1215  {
1216 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1217 // printf("d) One Photon hits a local maxima, the other another not high \n");
1218 
1219  if(!noverlaps)
1220  {
1221  fhMCPi0DecayPhotonHitOtherLM ->Fill(en, nMax, GetEventWeight());
1222  fhMCPi0DecayPhotonHitOtherLMMass[inlm]->Fill(en, mass, GetEventWeight());
1223  if(match0 && imatch0 == imax)
1224  {
1225  if(fMCDaughMom1.E()>0)
1227  if(fMCDaughMom2.E()>0)
1229  }
1230  else
1231  {
1232  if(fMCDaughMom2.E()>0)
1234  if(fMCDaughMom1.E()>0)
1236  }
1237  }
1238  else
1239  {
1241  fhMCPi0DecayPhotonHitOtherLMMass[inlm]->Fill(en, mass, GetEventWeight());
1242  if(match0 && imatch0 == imax)
1243  {
1244  if(fMCDaughMom1.E()>0)
1246  if(fMCDaughMom2.E()>0)
1248  }
1249  else
1250  {
1251  if(fMCDaughMom2.E()>0)
1253  if(fMCDaughMom1.E()>0)
1255  }
1256  }
1257 
1258  return ;
1259  }
1260 
1261  // Adjacent to other maxima
1262 
1263  Bool_t adjacentOther1 = kFALSE;
1264  if(match0)
1265  {
1266  for(Int_t i = 0; i < nmaxima; i++)
1267  {
1268  Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
1269  GetModuleNumberCellIndexes(list[i] ,GetCalorimeter(), ieta, iphi, rcu);
1270 
1271  //printf(" Other Max (eta,phi)=(%d,%d)\n",ieta,iphi);
1272 
1273  if(GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId1,list[i]) ) adjacentOther1 = kTRUE;
1274 
1275  //printf("Other Maxima: adjacentOther1 %d\n",adjacentOther1);
1276  }
1277  }
1278 
1279  Bool_t adjacentOther0 = kFALSE;
1280  if(match1)
1281  {
1282  for(Int_t i = 0; i < nmaxima; i++)
1283  {
1284  Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
1285  GetModuleNumberCellIndexes(list[i] ,GetCalorimeter(), ieta, iphi, rcu);
1286 
1287  //printf(" Other Max (eta,phi)=(%d,%d)\n",ieta,iphi);
1288 
1289  if(GetCaloUtils()->AreNeighbours(GetCalorimeter(),absId0,list[i]) ) adjacentOther0 = kTRUE;
1290 
1291  //printf("Other Maxima: adjacentOther0 %d\n",adjacentOther0);
1292  }
1293  }
1294 
1295  if((match0 && adjacentOther1) || (match1 && adjacentOther0))
1296  {
1297 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1298 // printf("e) One Photon hits a local maxima, the other another not high, adjacent \n");
1299 
1300  if(!noverlaps)
1301  {
1302  fhMCPi0DecayPhotonAdjOtherLM ->Fill(en, nMax, GetEventWeight());
1303  fhMCPi0DecayPhotonAdjOtherLMMass[inlm]->Fill(en, mass, GetEventWeight());
1304  if(match0 && imatch0 == imax)
1305  {
1306  if(fMCDaughMom1.E()>0)
1308  if(fMCDaughMom2.E()>0)
1310  }
1311  else
1312  {
1313  if(fMCDaughMom2.E()>0)
1315  if(fMCDaughMom1.E()>0)
1317  }
1318  }
1319  else
1320  {
1323  if(match0 && imatch0 == imax)
1324  {
1325  if(fMCDaughMom1.E()>0)
1327  if(fMCDaughMom2.E()>0)
1329  }
1330  else
1331  {
1332  if(fMCDaughMom2.E()>0)
1334  if(fMCDaughMom1.E()>0)
1336  }
1337  }
1338 
1339  return;
1340  }
1341 
1342 // if((mass < 0.06 || mass > 1.8) && mcindex==kmcPi0 && noverlaps == 0)
1343 // printf("f) No hit found \n");
1344  if(!noverlaps)
1345  {
1346  fhMCPi0DecayPhotonHitNoLM ->Fill(en, nMax, GetEventWeight());
1347  fhMCPi0DecayPhotonHitNoLMMass[inlm]->Fill(en, mass, GetEventWeight());
1348  }
1349  else
1350  {
1352  fhMCPi0DecayPhotonHitNoLMOverlapMass[inlm]->Fill(en, mass, GetEventWeight());
1353  }
1354 }
1355 
1356 //___________________________________________________________________________________________________________
1358 //___________________________________________________________________________________________________________
1359 void AliAnaInsideClusterInvariantMass::FillAngleHistograms(Int_t nMax, Bool_t matched, Int_t mcIndex,
1360  Float_t en, Float_t e1, Float_t e2,
1361  Float_t angle, Float_t mass,
1362  Float_t anglePrim, Float_t m02,
1363  Float_t asym, Int_t pid, Int_t noverlaps)
1364 {
1365  Bool_t m02OK = GetCaloPID()->IsInPi0M02Range(en,m02,nMax);
1366  Bool_t asyOK = GetCaloPID()->IsInPi0SplitAsymmetryRange(en,asym,nMax);
1367  Bool_t m02On = GetCaloPID()->IsSplitShowerShapeCutOn();
1368  Bool_t asyOn = GetCaloPID()->IsSplitAsymmetryCutOn();
1369 
1370  Bool_t eCutOK= kFALSE;
1371  Int_t inlm = nMax-1;
1372  if(inlm > 2 ) inlm = 2;
1373  Float_t ensubcut = GetCaloPID()->GetSubClusterEnergyMinimum(inlm);
1374  if (ensubcut > 0.1 && ensubcut < e1 && ensubcut < e2 ) eCutOK = kTRUE;
1375  else if(ensubcut < 0.1) eCutOK = kTRUE;
1376 
1377  if (nMax==1)
1378  {
1379  fhAnglePairNLocMax1[0][matched]->Fill(en, angle, GetEventWeight());
1380 
1381  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1382  fhAnglePairAfterCutsNLocMax1[0][matched]->Fill(en, angle, GetEventWeight());
1383  if(pid==AliCaloPID::kPi0)
1384  fhAnglePairPi0NLocMax1[0][matched]->Fill(en, angle, GetEventWeight());
1385 
1386  if(m02 > 0)
1387  {
1388  fhAnglePairOverM02NLocMax1[0][matched]->Fill(en, angle/m02, GetEventWeight());
1389  if(noverlaps == 0) fhAnglePairOverM02NLocMax1Overlap0[0][matched]->Fill(en, angle/m02, GetEventWeight());
1390  }
1391 
1392  if( en > 15 )
1393  {
1394  fhAnglePairMassNLocMax1[0][matched]->Fill(mass, angle, GetEventWeight());
1395  fhAnglePairM02NLocMax1 [0][matched]->Fill(m02 , angle, GetEventWeight());
1396  }
1397  }
1398  else if(nMax==2)
1399  {
1400  fhAnglePairNLocMax2[0][matched]->Fill(en, angle, GetEventWeight());
1401 
1402  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1403  fhAnglePairAfterCutsNLocMax2[0][matched]->Fill(en, angle, GetEventWeight());
1404  if(pid==AliCaloPID::kPi0)
1405  fhAnglePairPi0NLocMax2[0][matched]->Fill(en, angle, GetEventWeight());
1406 
1407  if(m02 > 0)
1408  {
1409  fhAnglePairOverM02NLocMax2[0][matched]->Fill(en, angle/m02, GetEventWeight());
1410  if(noverlaps == 0) fhAnglePairOverM02NLocMax2Overlap0[0][matched]->Fill(angle/m02, en, GetEventWeight());
1411  }
1412 
1413  if( en > fHistoECut )
1414  {
1415  fhAnglePairMassNLocMax2[0][matched]->Fill(mass, angle, GetEventWeight());
1416  fhAnglePairM02NLocMax2 [0][matched]->Fill(m02 , angle, GetEventWeight());
1417  }
1418  }
1419  else if(nMax >2)
1420  {
1421  fhAnglePairNLocMaxN[0][matched]->Fill(en, angle, GetEventWeight());
1422 
1423  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1424  fhAnglePairAfterCutsNLocMaxN[0][matched]->Fill(en, angle, GetEventWeight());
1425  if(pid==AliCaloPID::kPi0)
1426  fhAnglePairPi0NLocMaxN[0][matched]->Fill(en, angle, GetEventWeight());
1427 
1428  if(m02 > 0)
1429  {
1430  fhAnglePairOverM02NLocMaxN[0][matched]->Fill(en, angle/m02, GetEventWeight());
1431  if(noverlaps == 0) fhAnglePairOverM02NLocMaxNOverlap0[0][matched]->Fill(angle/m02, en, GetEventWeight());
1432  }
1433 
1434  if( en > fHistoECut )
1435  {
1436  fhAnglePairMassNLocMaxN[0][matched]->Fill(mass, angle, GetEventWeight());
1437  fhAnglePairM02NLocMaxN [0][matched]->Fill(m02 , angle, GetEventWeight());
1438  }
1439  }
1440 
1441  if(IsDataMC() && mcIndex > 0 && mcIndex < 7)
1442  {
1443  if (nMax==1)
1444  {
1445  fhAnglePairNLocMax1[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1446  if( en > 15 )
1447  {
1448  fhAnglePairMassNLocMax1[mcIndex][matched]->Fill(mass, angle, GetEventWeight());
1449  fhAnglePairM02NLocMax1 [mcIndex][matched]->Fill(m02 , angle, GetEventWeight());
1450  }
1451  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1452  fhAnglePairAfterCutsNLocMax1[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1453  if(pid==AliCaloPID::kPi0)
1454  fhAnglePairPi0NLocMax1[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1455 
1456  if(m02 > 0)
1457  {
1458  fhAnglePairOverM02NLocMax1[mcIndex][matched]->Fill(en, angle/m02, GetEventWeight());
1459  if(noverlaps == 0) fhAnglePairOverM02NLocMax1Overlap0[mcIndex][matched]->Fill(angle/m02, en, GetEventWeight());
1460  }
1461 
1462  if((mcIndex == kmcPi0 || mcIndex == kmcPi0Conv) && !matched && anglePrim > 0)
1463  {
1464  fhAnglePairPrimPi0RecoNLocMax1->Fill(en, angle/anglePrim, GetEventWeight());
1465  if(m02>0)fhAnglePairPrimPi0OverM02NLocMax1->Fill(en, anglePrim/m02, GetEventWeight());
1466  if(en > 15) fhAnglePairPrimPi0vsRecoNLocMax1->Fill(anglePrim, angle, GetEventWeight());
1467  }
1468  }
1469  else if(nMax==2)
1470  {
1471  fhAnglePairNLocMax2[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1472  if( en > fHistoECut )
1473  {
1474  fhAnglePairMassNLocMax2[mcIndex][matched]->Fill(mass, angle, GetEventWeight());
1475  fhAnglePairM02NLocMax2 [mcIndex][matched]->Fill(m02 , angle, GetEventWeight());
1476  }
1477 
1478  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1479  fhAnglePairAfterCutsNLocMax2[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1480  if(pid==AliCaloPID::kPi0)
1481  fhAnglePairPi0NLocMax2[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1482 
1483  if(m02 > 0)
1484  {
1485  fhAnglePairOverM02NLocMax2[mcIndex][matched]->Fill(en, angle/m02, GetEventWeight());
1486  if(noverlaps == 0) fhAnglePairOverM02NLocMax2Overlap0[mcIndex][matched]->Fill(angle/m02, en, GetEventWeight());
1487  }
1488 
1489  if((mcIndex == kmcPi0 || mcIndex == kmcPi0Conv) && !matched && anglePrim > 0)
1490  {
1491  fhAnglePairPrimPi0RecoNLocMax2->Fill(en, angle/anglePrim, GetEventWeight());
1492  if(m02>0)fhAnglePairPrimPi0OverM02NLocMax2->Fill(en, anglePrim/m02, GetEventWeight());
1493  if(en > 10) fhAnglePairPrimPi0vsRecoNLocMax2->Fill(anglePrim, angle, GetEventWeight());
1494  }
1495  }
1496  else if(nMax >2)
1497  {
1498  fhAnglePairNLocMaxN[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1499  if( en > fHistoECut )
1500  {
1501  fhAnglePairMassNLocMaxN[mcIndex][matched]->Fill(mass, angle, GetEventWeight());
1502  fhAnglePairM02NLocMaxN [mcIndex][matched]->Fill(m02 , angle, GetEventWeight());
1503  }
1504  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1505  fhAnglePairAfterCutsNLocMaxN[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1506  if(pid==AliCaloPID::kPi0)
1507  fhAnglePairPi0NLocMaxN[mcIndex][matched]->Fill(en, angle, GetEventWeight());
1508 
1509  if(m02 > 0)
1510  {
1511  fhAnglePairOverM02NLocMaxN[mcIndex][matched]->Fill(en, angle/m02, GetEventWeight());
1512  if(noverlaps == 0) fhAnglePairOverM02NLocMaxNOverlap0[mcIndex][matched]->Fill(angle/m02, en, GetEventWeight());
1513  }
1514 
1515  if((mcIndex == kmcPi0 || mcIndex == kmcPi0Conv) && !matched && anglePrim > 0)
1516  {
1517  fhAnglePairPrimPi0RecoNLocMaxN->Fill(en, angle/anglePrim, GetEventWeight());
1518  if(m02>0)fhAnglePairPrimPi0OverM02NLocMaxN->Fill(en, anglePrim/m02, GetEventWeight());
1519  if(en > 10) fhAnglePairPrimPi0vsRecoNLocMaxN->Fill(anglePrim, angle, GetEventWeight());
1520  }
1521  }
1522  }
1523 }
1524 
1525 //____________________________________________________________________________________________________
1527 //____________________________________________________________________________________________________
1528 void AliAnaInsideClusterInvariantMass::FillArmenterosHistograms(Int_t nMax, Int_t ebin, Int_t mcIndex,
1529  Float_t en, Float_t m02, Int_t pid)
1530 {
1531  // Get pTArm and AlphaArm
1533  Float_t momentumSquaredMother = fSubClusterMomSum.P()*fSubClusterMomSum.P();
1534  Float_t momentumDaughter1AlongMother = 0.;
1535  Float_t momentumDaughter2AlongMother = 0.;
1536 
1537  if (momentumSquaredMother > 0.)
1538  {
1539  momentumDaughter1AlongMother = (fSubClusterMom1.Px()*fSubClusterMomSum.Px() + fSubClusterMom1.Py()*fSubClusterMomSum.Py()+ fSubClusterMom1.Pz()*fSubClusterMomSum.Pz()) / sqrt(momentumSquaredMother);
1540  momentumDaughter2AlongMother = (fSubClusterMom2.Px()*fSubClusterMomSum.Px() + fSubClusterMom2.Py()*fSubClusterMomSum.Py()+ fSubClusterMom2.Pz()*fSubClusterMomSum.Pz()) / sqrt(momentumSquaredMother);
1541  }
1542 
1543  Float_t momentumSquaredDaughter1 = fSubClusterMom1.P()*fSubClusterMom1.P();
1544  Float_t ptArmSquared = momentumSquaredDaughter1 - momentumDaughter1AlongMother*momentumDaughter1AlongMother;
1545 
1546  Float_t pTArm = 0.;
1547  if (ptArmSquared > 0.)
1548  pTArm = sqrt(ptArmSquared);
1549 
1550  Float_t alphaArm = 0.;
1551  if(momentumDaughter1AlongMother +momentumDaughter2AlongMother > 0)
1552  alphaArm = (momentumDaughter1AlongMother -momentumDaughter2AlongMother) / (momentumDaughter1AlongMother + momentumDaughter2AlongMother);
1553 
1554  Float_t asym = TMath::Abs( fSubClusterMom1.Energy()-fSubClusterMom2.Energy() )/( fSubClusterMom1.Energy()+fSubClusterMom2.Energy() ) ;
1555 
1556  AliDebug(2,Form("E %f, alphaArm %f, pTArm %f",en,alphaArm,pTArm));
1557 
1558  Bool_t m02OK = GetCaloPID()->IsInPi0M02Range(en,m02,nMax);
1559  Bool_t asyOK = GetCaloPID()->IsInPi0SplitAsymmetryRange(en,asym,nMax);
1560  Bool_t m02On = GetCaloPID()->IsSplitShowerShapeCutOn();
1561  Bool_t asyOn = GetCaloPID()->IsSplitAsymmetryCutOn();
1562 
1563  Bool_t eCutOK= kFALSE;
1564  Int_t inlm = nMax-1;
1565  if(inlm > 2 ) inlm = 2;
1566 
1567  Float_t ensubcut = GetCaloPID()->GetSubClusterEnergyMinimum(inlm);
1568  if (ensubcut > 0.1 && ensubcut < fSubClusterMom1.E() && ensubcut < fSubClusterMom2.E() )
1569  eCutOK = kTRUE;
1570  else if(ensubcut < 0.1)
1571  eCutOK = kTRUE;
1572 
1573  if (nMax==1)
1574  {
1575  fhArmNLocMax1[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1576  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1577  fhArmAfterCutsNLocMax1[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1578  if(pid==AliCaloPID::kPi0)
1579  fhArmPi0NLocMax1[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1580  }
1581  else if(nMax==2)
1582  {
1583  fhArmNLocMax2[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1584  if((m02OK && asyOK) && (asyOn || m02On))
1585  fhArmAfterCutsNLocMax2[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1586  if(pid==AliCaloPID::kPi0)
1587  fhArmPi0NLocMax2[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1588  }
1589  else if(nMax >2)
1590  {
1591  fhArmNLocMaxN[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1592  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1593  fhArmAfterCutsNLocMaxN[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1594  if(pid==AliCaloPID::kPi0)
1595  fhArmPi0NLocMaxN[0][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1596  }
1597 
1598  if(IsDataMC() && mcIndex > 0 && mcIndex < 7)
1599  {
1600  if (nMax==1)
1601  {
1602  fhArmNLocMax1[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1603  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1604  fhArmAfterCutsNLocMax1[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1605  if(pid==AliCaloPID::kPi0)
1606  fhArmPi0NLocMax1[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1607  }
1608  else if(nMax==2)
1609  {
1610  fhArmNLocMax2[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1611  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1612  fhArmAfterCutsNLocMax2[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1613  if(pid==AliCaloPID::kPi0)
1614  fhArmPi0NLocMax2[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1615  }
1616  else if(nMax >2)
1617  {
1618  fhArmNLocMaxN[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1619  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1620  fhArmAfterCutsNLocMaxN[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1621  if(pid==AliCaloPID::kPi0)
1622  fhArmPi0NLocMaxN[mcIndex][ebin]->Fill(alphaArm, pTArm, GetEventWeight());
1623  }
1624  }
1625 }
1626 
1627 //_______________________________________________________________________________________________________
1628 // Fill cos Theta^star histograms for split clusters.
1629 //_______________________________________________________________________________________________________
1630 void AliAnaInsideClusterInvariantMass::FillThetaStarHistograms(Int_t nMax, Bool_t matched, Int_t mcIndex,
1631  Float_t en, Float_t m02, Int_t pid)
1632 {
1633  // Get cos Theta^star
1636  fSubClusterMomBoost.Boost(-fSubClusterMomSum.BoostVector());
1637  Float_t cosThStar=TMath::Cos(fSubClusterMomBoost.Vect().Angle(fSubClusterMomSum.Vect()));
1638 
1639  Float_t asym = TMath::Abs( fSubClusterMom1.Energy()-fSubClusterMom2.Energy() )/( fSubClusterMom1.Energy()+fSubClusterMom2.Energy() ) ;
1640 
1641  Bool_t m02OK = GetCaloPID()->IsInPi0M02Range(en,m02,nMax);
1642  Bool_t asyOK = GetCaloPID()->IsInPi0SplitAsymmetryRange(en,asym,nMax);
1643  Bool_t m02On = GetCaloPID()->IsSplitShowerShapeCutOn();
1644  Bool_t asyOn = GetCaloPID()->IsSplitAsymmetryCutOn();
1645 
1646  Bool_t eCutOK= kFALSE;
1647  Int_t inlm = nMax-1;
1648  if(inlm > 2 ) inlm = 2;
1649  Float_t ensubcut = GetCaloPID()->GetSubClusterEnergyMinimum(inlm);
1650  if (ensubcut > 0.1 && ensubcut < fSubClusterMom1.E() && ensubcut < fSubClusterMom2.E() ) eCutOK = kTRUE;
1651  else if(ensubcut < 0.1) eCutOK = kTRUE;
1652 
1653  //printf("Reco cos %f, asy %f\n",cosThStar,asym);
1654 
1655  if (nMax==1)
1656  {
1657  fhCosThStarNLocMax1[0][matched]->Fill(en, cosThStar, GetEventWeight());
1658 
1659  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1660  fhCosThStarAfterCutsNLocMax1[0][matched]->Fill(en, cosThStar, GetEventWeight());
1661  if(pid==AliCaloPID::kPi0)
1662  fhCosThStarPi0NLocMax1[0][matched]->Fill(en, cosThStar, GetEventWeight());
1663  }
1664  else if(nMax==2)
1665  {
1666  fhCosThStarNLocMax2[0][matched]->Fill(en, cosThStar, GetEventWeight());
1667 
1668  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1669  fhCosThStarAfterCutsNLocMax2[0][matched]->Fill(en, cosThStar, GetEventWeight());
1670  if(pid==AliCaloPID::kPi0)
1671  fhCosThStarPi0NLocMax2[0][matched]->Fill(en, cosThStar, GetEventWeight());
1672  }
1673  else if(nMax >2)
1674  {
1675  fhCosThStarNLocMaxN[0][matched]->Fill(en, cosThStar, GetEventWeight());
1676 
1677  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1678  fhCosThStarAfterCutsNLocMaxN[0][matched]->Fill(en, cosThStar, GetEventWeight());
1679  if(pid==AliCaloPID::kPi0)
1680  fhCosThStarPi0NLocMaxN[0][matched]->Fill(en, cosThStar, GetEventWeight());
1681  }
1682 
1683  if(IsDataMC() && mcIndex > 0 && mcIndex < 7)
1684  {
1685  if (nMax==1)
1686  {
1687  fhCosThStarNLocMax1[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1688 
1689  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1690  fhCosThStarAfterCutsNLocMax1[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1691  if(pid==AliCaloPID::kPi0)
1692  fhCosThStarPi0NLocMax1[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1693  }
1694  else if(nMax==2)
1695  {
1696  fhCosThStarNLocMax2[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1697 
1698  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1699  fhCosThStarAfterCutsNLocMax2[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1700  if(pid==AliCaloPID::kPi0)
1701  fhCosThStarPi0NLocMax2[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1702  }
1703  else if(nMax >2)
1704  {
1705  fhCosThStarNLocMaxN[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1706 
1707  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1708  fhCosThStarAfterCutsNLocMaxN[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1709  if(pid==AliCaloPID::kPi0)
1710  fhCosThStarPi0NLocMaxN[mcIndex][matched]->Fill(en, cosThStar, GetEventWeight());
1711  }
1712  }
1713 }
1714 
1715 //__________________________________________________________________________________________________________________
1717 //__________________________________________________________________________________________________________________
1718 void AliAnaInsideClusterInvariantMass::FillEBinHistograms(Int_t ebin , Int_t nMax, Int_t mcindex,
1719  Float_t splitFrac, Float_t mass, Float_t asym, Float_t l0)
1720 {
1721  if (nMax==1)
1722  {
1723  fhMassSplitEFractionNLocMax1Ebin[0][ebin]->Fill(splitFrac, mass, GetEventWeight());
1724  if(IsDataMC() && mcindex > 0 && mcindex < 7)fhMassSplitEFractionNLocMax1Ebin[mcindex][ebin]->Fill(splitFrac, mass, GetEventWeight());
1725 
1726  fhMassM02NLocMax1Ebin [ebin]->Fill(l0 , mass, GetEventWeight());
1727  fhMassAsyNLocMax1Ebin [ebin]->Fill(asym, mass, GetEventWeight());
1728  }
1729  else if(nMax==2)
1730  {
1731  fhMassSplitEFractionNLocMax2Ebin[0][ebin]->Fill(splitFrac, mass, GetEventWeight());
1732  if(IsDataMC() && mcindex > 0 && mcindex < 7)fhMassSplitEFractionNLocMax2Ebin[mcindex][ebin]->Fill(splitFrac, mass, GetEventWeight());
1733 
1734  fhMassM02NLocMax2Ebin [ebin]->Fill(l0 , mass, GetEventWeight());
1735  fhMassAsyNLocMax2Ebin [ebin]->Fill(asym, mass, GetEventWeight());
1736  }
1737  else if(nMax > 2 )
1738  {
1739  fhMassSplitEFractionNLocMaxNEbin[0][ebin]->Fill(splitFrac, mass, GetEventWeight());
1740  if(IsDataMC() && mcindex > 0 && mcindex < 7)fhMassSplitEFractionNLocMaxNEbin[mcindex][ebin]->Fill(splitFrac, mass, GetEventWeight());
1741 
1742  fhMassM02NLocMaxNEbin [ebin]->Fill(l0 , mass, GetEventWeight());
1743  fhMassAsyNLocMaxNEbin [ebin]->Fill(asym, mass, GetEventWeight());
1744  }
1745 }
1746 
1747 //________________________________________________________________________________________________
1749 //________________________________________________________________________________________________
1750 void AliAnaInsideClusterInvariantMass::FillHistograms1(Float_t en, Float_t e1, Float_t e2,
1751  Int_t nMax, Float_t mass, Float_t l0,
1752  Float_t eta, Float_t phi,
1753  Bool_t matched, Int_t mcindex)
1754 {
1755  Float_t splitFrac = (e1+e2)/en;
1756 
1757  Float_t asym = -10;
1758  if(e1+e2>0) asym = (e1-e2)/(e1+e2);
1759 
1760  fhNLocMax [0][matched]->Fill(en, nMax, GetEventWeight());
1761  fhLM1NLocMax[0][matched]->Fill(e1, nMax, GetEventWeight());
1762  fhLM2NLocMax[0][matched]->Fill(e2, nMax, GetEventWeight());
1763 
1764  fhSplitClusterENLocMax[0][matched]->Fill(e1, nMax, GetEventWeight());
1765  fhSplitClusterENLocMax[0][matched]->Fill(e2, nMax, GetEventWeight());
1766 
1767  if(IsDataMC() && mcindex > 0 && mcindex < 7)
1768  {
1769  fhNLocMax [mcindex][matched]->Fill(en, nMax, GetEventWeight());
1770  fhLM1NLocMax[mcindex][matched]->Fill(e1, nMax, GetEventWeight());
1771  fhLM2NLocMax[mcindex][matched]->Fill(e2, nMax, GetEventWeight());
1772 
1773  fhSplitClusterENLocMax[mcindex][matched]->Fill(e1, nMax, GetEventWeight());
1774  fhSplitClusterENLocMax[mcindex][matched]->Fill(e2, nMax, GetEventWeight());
1775  }
1776 
1777  if ( nMax == 1 )
1778  {
1779  fhM02NLocMax1[0][matched]->Fill(en, l0, GetEventWeight()) ;
1780  fhSplitEFractionNLocMax1[0][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1781 
1782  if(IsDataMC() && mcindex > 0 && mcindex < 7)
1783  {
1784  fhM02NLocMax1[mcindex][matched]->Fill(en, l0, GetEventWeight()) ;
1785  fhSplitEFractionNLocMax1[mcindex][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1786  }
1787 
1788  if(en > fHistoECut)
1789  {
1790  fhMassM02NLocMax1[0][matched]->Fill(l0, mass, GetEventWeight());
1791  if( IsDataMC() && mcindex > 0 && mcindex < 7 ) fhMassM02NLocMax1[mcindex][matched]->Fill(l0, mass, GetEventWeight());
1792 
1793  fhSplitEFractionvsAsyNLocMax1[matched]->Fill(asym, splitFrac, GetEventWeight()) ;
1794  if(!matched)fhClusterEtaPhiNLocMax1->Fill(eta, phi, GetEventWeight());
1795  }
1796  }
1797  else if( nMax == 2 )
1798  {
1799  fhM02NLocMax2[0][matched]->Fill(en, l0, GetEventWeight()) ;
1800  fhSplitEFractionNLocMax2[0][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1801 
1802  if(IsDataMC() && mcindex > 0 && mcindex < 7)
1803  {
1804  fhM02NLocMax2[mcindex][matched]->Fill(en, l0, GetEventWeight()) ;
1805  fhSplitEFractionNLocMax2[mcindex][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1806  }
1807 
1808  if(en > fHistoECut)
1809  {
1810  fhMassM02NLocMax2[0][matched]->Fill(l0, mass, GetEventWeight());
1811  if( IsDataMC() && mcindex > 0 && mcindex < 7 ) fhMassM02NLocMax2[mcindex][matched]->Fill(l0, mass, GetEventWeight());
1812 
1813  fhSplitEFractionvsAsyNLocMax2[matched]->Fill(asym, splitFrac, GetEventWeight()) ;
1814  if(!matched)fhClusterEtaPhiNLocMax2->Fill(eta, phi, GetEventWeight());
1815  }
1816  }
1817  else if( nMax >= 3 )
1818  {
1819  fhM02NLocMaxN[0][matched]->Fill(en, l0, GetEventWeight()) ;
1820  fhSplitEFractionNLocMaxN[0][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1821 
1822  if(IsDataMC() && mcindex > 0 && mcindex < 7)
1823  {
1824  fhM02NLocMaxN[mcindex][matched]->Fill(en, l0, GetEventWeight()) ;
1825  fhSplitEFractionNLocMaxN[mcindex][matched]->Fill(en, splitFrac, GetEventWeight()) ;
1826  }
1827 
1828  if(en > fHistoECut)
1829  {
1830 
1831  fhMassM02NLocMaxN[0][matched]->Fill(l0, mass, GetEventWeight());
1832  if( IsDataMC() && mcindex > 0 && mcindex < 7 ) fhMassM02NLocMaxN[mcindex][matched]->Fill(l0, mass, GetEventWeight());
1833 
1834  fhSplitEFractionvsAsyNLocMaxN[matched]->Fill(asym, splitFrac, GetEventWeight()) ;
1835  if(!matched)fhClusterEtaPhiNLocMaxN->Fill(eta, phi, GetEventWeight());
1836  }
1837  }
1838 }
1839 
1840 //________________________________________________________________________________________________
1842 //________________________________________________________________________________________________
1844  Float_t e1, Float_t e2,
1845  Int_t nMax, Float_t mass, Float_t l0,
1846  Bool_t matched, Int_t mcindex)
1847 {
1848  Float_t efrac = eprim/en;
1849  Float_t efracSplit = 0;
1850  if(e1+e2 > 0) efracSplit = eprim/(e1+e2);
1851 
1852  Float_t splitFrac = (e1+e2)/en;
1853 
1854  Float_t asym = -10;
1855  if(e1+e2>0) asym = (e1-e2)/(e1+e2);
1856 
1857  Int_t inlm = nMax-1;
1858  if(inlm > 2) inlm = 2;
1859  Float_t splitFracMin = GetCaloPID()->GetSplitEnergyFractionMinimum(inlm) ;
1860 
1861  Bool_t m02OK = GetCaloPID()->IsInPi0M02Range(en,l0,nMax);
1862  Bool_t asyOK = GetCaloPID()->IsInPi0SplitAsymmetryRange(en,asym,nMax);
1863  Bool_t m02On = GetCaloPID()->IsSplitShowerShapeCutOn();
1864  Bool_t asyOn = GetCaloPID()->IsSplitAsymmetryCutOn();
1865 
1866  Bool_t eCutOK = kFALSE;
1867  Float_t ensubcut = GetCaloPID()->GetSubClusterEnergyMinimum(inlm);
1868  if (ensubcut > 0.1 && ensubcut < e1 && ensubcut < e2 ) eCutOK = kTRUE;
1869  else if(ensubcut < 0.1) eCutOK = kTRUE;
1870 
1871  //printf("splitFracMin %f, val %f, m02ok %d, asyok %d, m02On %d, asyOn %d, ecutOK %d\n",splitFracMin,splitFrac,m02OK,asyOK,m02On,asyOn,eCutOK);
1872 
1873  if(m02On && m02OK)
1874  {
1875  fhNLocMaxM02Cut [0][matched]->Fill(en, nMax, GetEventWeight());
1876  fhLM1NLocMaxM02Cut[0][matched]->Fill(e1, nMax, GetEventWeight());
1877  fhLM2NLocMaxM02Cut[0][matched]->Fill(e2, nMax, GetEventWeight());
1878 
1879  if(IsDataMC() && mcindex > 0 && mcindex < 7)
1880  {
1881  fhNLocMaxM02Cut [mcindex][matched]->Fill(en, nMax, GetEventWeight());
1882  fhLM1NLocMaxM02Cut[mcindex][matched]->Fill(e1, nMax, GetEventWeight());
1883  fhLM2NLocMaxM02Cut[mcindex][matched]->Fill(e2, nMax, GetEventWeight());
1884  }
1885  }
1886 
1887  if (nMax==1)
1888  {
1889  fhMassNLocMax1[0][matched]->Fill(en, mass, GetEventWeight());
1890  fhAsymNLocMax1[0][matched]->Fill(en, asym, GetEventWeight());
1891  fhMassSplitENLocMax1[0][matched]->Fill(e1+e2, mass, GetEventWeight());
1892 
1893  // Effect of cuts in mass histograms
1894 
1895  if( !matched && asyOK && asyOn )
1896  {
1897  fhMassAsyCutNLocMax1->Fill(en, mass, GetEventWeight());
1898  fhM02AsyCutNLocMax1 ->Fill(en, l0 , GetEventWeight());
1899  }
1900 
1901  if( !matched && m02OK && m02On )
1902  {
1903  fhMassM02CutNLocMax1->Fill(en, mass, GetEventWeight());
1904  fhAsymM02CutNLocMax1->Fill(en, asym, GetEventWeight());
1905  if(splitFrac > splitFracMin && fhMassSplitECutNLocMax1) fhMassSplitECutNLocMax1->Fill(en, mass, GetEventWeight());
1906  }
1907 
1908  if(!matched && eCutOK && ensubcut > 0.1)
1909  {
1910  fhMassEnCutNLocMax1->Fill(en, mass, GetEventWeight());
1911  fhM02EnCutNLocMax1 ->Fill(en, l0 , GetEventWeight());
1912  fhAsymEnCutNLocMax1->Fill(en, asym, GetEventWeight());
1913  fhSplitEFracEnCutNLocMax1->Fill(en, splitFrac, GetEventWeight());
1914  }
1915 
1916  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1917  {
1918  fhSplitEFractionAfterCutsNLocMax1[0][matched]->Fill(en, splitFrac, GetEventWeight());
1919  if(splitFrac > splitFracMin)
1920  {
1921  fhMassAfterCutsNLocMax1[0][matched]->Fill(en, mass, GetEventWeight());
1922  fhMassSplitEAfterCutsNLocMax1[0][matched]->Fill(e1+e2, mass, GetEventWeight());
1923  }
1924  if(!matched && IsDataMC() && fFillMCHisto && mcindex == kmcPi0)
1925  {
1926  fhMCGenFracAfterCutsNLocMax1MCPi0 ->Fill(en , efrac , GetEventWeight());
1927  fhMCGenSplitEFracAfterCutsNLocMax1MCPi0->Fill(en , efracSplit, GetEventWeight());
1928  }
1929  }
1930  }
1931  else if( nMax == 2 )
1932  {
1933  fhMassNLocMax2[0][matched]->Fill(en, mass, GetEventWeight());
1934  fhAsymNLocMax2[0][matched]->Fill(en, asym, GetEventWeight());
1935  fhMassSplitENLocMax2[0][matched]->Fill(e1+e2, mass, GetEventWeight());
1936 
1937  // Effect of cuts in mass histograms
1938 
1939  if( !matched && asyOK && asyOn )
1940  {
1941  fhMassAsyCutNLocMax2->Fill(en, mass, GetEventWeight());
1942  fhM02AsyCutNLocMax2 ->Fill(en, l0 , GetEventWeight());
1943  }
1944 
1945  if( !matched && m02OK && m02On )
1946  {
1947  fhMassM02CutNLocMax2->Fill(en, mass, GetEventWeight());
1948  fhAsymM02CutNLocMax2->Fill(en, asym, GetEventWeight());
1949  if(splitFrac > splitFracMin && fhMassSplitECutNLocMax2) fhMassSplitECutNLocMax2->Fill(en, mass, GetEventWeight());
1950  }
1951 
1952  if( !matched && eCutOK && ensubcut > 0.1 )
1953  {
1954  fhMassEnCutNLocMax2->Fill(en, mass, GetEventWeight());
1955  fhM02EnCutNLocMax2 ->Fill(en, l0 , GetEventWeight());
1956  fhAsymEnCutNLocMax2->Fill(en, asym, GetEventWeight());
1957  fhSplitEFracEnCutNLocMax2->Fill(en, splitFrac, GetEventWeight());
1958  }
1959 
1960  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
1961  {
1962  fhSplitEFractionAfterCutsNLocMax2[0][matched]->Fill(en, splitFrac, GetEventWeight());
1963  if(splitFrac > splitFracMin)
1964  {
1965  fhMassAfterCutsNLocMax2[0][matched]->Fill(en, mass, GetEventWeight());
1966  fhMassSplitEAfterCutsNLocMax2[0][matched]->Fill(e1+e2, mass, GetEventWeight());
1967  }
1968 
1969  if( !matched && IsDataMC() && fFillMCHisto && mcindex == kmcPi0 )
1970  {
1971  fhMCGenFracAfterCutsNLocMax2MCPi0 ->Fill(en, efrac , GetEventWeight());
1973  }
1974  }
1975  }
1976  else if( nMax > 2 )
1977  {
1978  fhMassNLocMaxN[0][matched]->Fill(en, mass, GetEventWeight());
1979  fhAsymNLocMaxN[0][matched]->Fill(en, asym, GetEventWeight());
1980  fhMassSplitENLocMaxN[0][matched]->Fill(e1+e2, mass, GetEventWeight());
1981 
1982  // Effect of cuts in mass histograms
1983 
1984  if( !matched && asyOK && asyOn )
1985  {
1986  fhMassAsyCutNLocMaxN->Fill(en, mass, GetEventWeight());
1987  fhM02AsyCutNLocMaxN ->Fill(en, l0 , GetEventWeight());
1988  }
1989 
1990  if(!matched && m02OK && m02On )
1991  {
1992  fhMassM02CutNLocMaxN->Fill(en, mass, GetEventWeight());
1993  fhAsymM02CutNLocMaxN->Fill(en, asym, GetEventWeight());
1994  if(splitFrac > splitFracMin && fhMassSplitECutNLocMaxN) fhMassSplitECutNLocMaxN->Fill(en, mass, GetEventWeight());
1995  }
1996 
1997  if( !matched && eCutOK && ensubcut > 0.1 )
1998  {
1999  fhMassEnCutNLocMaxN->Fill(en, mass, GetEventWeight());
2000  fhM02EnCutNLocMaxN ->Fill(en, l0 , GetEventWeight());
2001  fhAsymEnCutNLocMaxN->Fill(en, asym, GetEventWeight());
2002  fhSplitEFracEnCutNLocMaxN->Fill(en, splitFrac, GetEventWeight());
2003  }
2004 
2005  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
2006  {
2007  fhSplitEFractionAfterCutsNLocMaxN[0][matched]->Fill(en, splitFrac, GetEventWeight());
2008  if(splitFrac > splitFracMin)
2009  {
2010  fhMassAfterCutsNLocMaxN[0][matched]->Fill(en, mass, GetEventWeight());
2011  fhMassSplitEAfterCutsNLocMaxN[0][matched]->Fill(e1+e2, mass, GetEventWeight());
2012  }
2013 
2014  if(!matched && IsDataMC() && fFillMCHisto && mcindex==kmcPi0)
2015  {
2016  fhMCGenFracAfterCutsNLocMaxNMCPi0 ->Fill(en, efrac , GetEventWeight());
2018  }
2019  }
2020  }
2021 
2022  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2023  {
2024  if (nMax==1)
2025  {
2026  fhMassNLocMax1[mcindex][matched]->Fill(en, mass, GetEventWeight());
2027  fhAsymNLocMax1[mcindex][matched]->Fill(en, asym, GetEventWeight());
2028  fhMassSplitENLocMax1[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2029 
2030  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
2031  {
2032  fhSplitEFractionAfterCutsNLocMax1[mcindex][matched]->Fill(en, splitFrac, GetEventWeight());
2033  if(splitFrac > splitFracMin)
2034  {
2035  fhMassAfterCutsNLocMax1[mcindex][matched]->Fill(en, mass, GetEventWeight());
2036  fhMassSplitEAfterCutsNLocMax1[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2037  }
2038  }
2039  }
2040  else if(nMax==2)
2041  {
2042  fhMassNLocMax2[mcindex][matched]->Fill(en, mass, GetEventWeight());
2043  fhAsymNLocMax2[mcindex][matched]->Fill(en, asym, GetEventWeight());
2044  fhMassSplitENLocMax2[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2045 
2046  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
2047  {
2048  fhSplitEFractionAfterCutsNLocMax2[mcindex][matched]->Fill(en, splitFrac, GetEventWeight());
2049  if(splitFrac > splitFracMin)
2050  {
2051  fhMassAfterCutsNLocMax2[mcindex][matched]->Fill(en, mass, GetEventWeight());
2052  fhMassSplitEAfterCutsNLocMax2[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2053  }
2054  }
2055  }
2056  else if(nMax >2)
2057  {
2058  fhMassNLocMaxN[mcindex][matched]->Fill(en, mass, GetEventWeight());
2059  fhAsymNLocMaxN[mcindex][matched]->Fill(en, asym, GetEventWeight());
2060  fhMassSplitENLocMaxN[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2061 
2062  if((m02OK && asyOK) && (asyOn || m02On) && eCutOK)
2063  {
2064  fhSplitEFractionAfterCutsNLocMaxN[mcindex][matched]->Fill(en, splitFrac, GetEventWeight());
2065  if(splitFrac > splitFracMin)
2066  {
2067  fhMassAfterCutsNLocMaxN[mcindex][matched]->Fill(en, mass, GetEventWeight());
2068  fhMassSplitEAfterCutsNLocMaxN[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2069  }
2070  }
2071  }
2072  } // Work with MC truth
2073 }
2074 
2075 //_________________________________________________________________________________________________________
2077 //_________________________________________________________________________________________________________
2078 void AliAnaInsideClusterInvariantMass::FillIdPi0Histograms(Float_t en, Float_t e1, Float_t e2,
2079  Int_t nc, Int_t nMax, Float_t t12diff,
2080  Float_t mass, Float_t l0,
2081  Float_t eta, Float_t phi,
2082  Bool_t matched, Int_t mcindex)
2083 {
2084  Float_t asym = -10;
2085  if(e1+e2>0) asym = (e1-e2)/(e1+e2);
2086 
2087  fhNLocMaxIdPi0 [0][matched]->Fill(en, nMax, GetEventWeight());
2088  fhLM1NLocMaxIdPi0[0][matched]->Fill(e1, nMax, GetEventWeight());
2089  fhLM2NLocMaxIdPi0[0][matched]->Fill(e2, nMax, GetEventWeight());
2090 
2091  fhSplitClusterEPi0NLocMax[0][matched]->Fill(e1, nMax, GetEventWeight());
2092  fhSplitClusterEPi0NLocMax[0][matched]->Fill(e2, nMax, GetEventWeight());
2093 
2094  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2095  {
2096  fhSplitClusterEPi0NLocMax[mcindex][matched]->Fill(e1, nMax, GetEventWeight());
2097  fhSplitClusterEPi0NLocMax[mcindex][matched]->Fill(e2, nMax, GetEventWeight());
2098  }
2099 
2100  if (nMax==1)
2101  {
2102  fhM02Pi0NLocMax1 [0][matched]->Fill(en, l0 , GetEventWeight());
2103  fhMassPi0NLocMax1[0][matched]->Fill(en, mass, GetEventWeight());
2104  fhAsyPi0NLocMax1 [0][matched]->Fill(en, asym, GetEventWeight());
2105  fhMassSplitEPi0NLocMax1[0][matched]->Fill(e1+e2, mass, GetEventWeight());
2106  if(fFillNCellHisto) fhNCellPi0NLocMax1[0][matched]->Fill(en, nc, GetEventWeight());
2107 
2108  if(!matched)
2109  {
2110  if(fFillHighMultHisto)
2111  {
2114  }
2115 
2116  if(en > fHistoECut)fhPi0EtaPhiNLocMax1->Fill(eta, phi, GetEventWeight());
2117  fhPi0EPairDiffTimeNLM1->Fill(e1+e2, t12diff, GetEventWeight());
2118  }
2119  }
2120  else if(nMax==2)
2121  {
2122  fhM02Pi0NLocMax2 [0][matched]->Fill(en, l0 , GetEventWeight());
2123  fhMassPi0NLocMax2[0][matched]->Fill(en, mass, GetEventWeight());
2124  fhAsyPi0NLocMax2 [0][matched]->Fill(en, asym, GetEventWeight());
2125  fhMassSplitEPi0NLocMax2[0][matched]->Fill(e1+e2, mass, GetEventWeight());
2126  if(fFillNCellHisto) fhNCellPi0NLocMax2[0][matched]->Fill(en, nc, GetEventWeight());
2127 
2128  if(!matched)
2129  {
2130  if(fFillHighMultHisto)
2131  {
2134  }
2135  if(en > fHistoECut)fhPi0EtaPhiNLocMax2->Fill(eta, phi, GetEventWeight());
2136  fhPi0EPairDiffTimeNLM2->Fill(e1+e2, t12diff, GetEventWeight());
2137  }
2138  }
2139  else if(nMax >2)
2140  {
2141  fhM02Pi0NLocMaxN [0][matched]->Fill(en, l0 , GetEventWeight());
2142  fhMassPi0NLocMaxN[0][matched]->Fill(en, mass, GetEventWeight());
2143  fhAsyPi0NLocMaxN [0][matched]->Fill(en, asym, GetEventWeight());
2144  fhMassSplitEPi0NLocMaxN[0][matched]->Fill(e1+e2, mass, GetEventWeight());
2145  if(fFillNCellHisto) fhNCellPi0NLocMaxN[0][matched]->Fill(en, nc, GetEventWeight());
2146 
2147  if(!matched)
2148  {
2149  if(fFillHighMultHisto)
2150  {
2153  }
2154 
2155  if(en > fHistoECut)fhPi0EtaPhiNLocMaxN->Fill(eta, phi, GetEventWeight());
2156  fhPi0EPairDiffTimeNLMN->Fill(e1+e2, t12diff, GetEventWeight());
2157  }
2158  }
2159 
2160  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2161  {
2162  fhNLocMaxIdPi0 [mcindex][matched]->Fill(en, nMax, GetEventWeight());
2163  fhLM1NLocMaxIdPi0[mcindex][matched]->Fill(e1, nMax, GetEventWeight());
2164  fhLM2NLocMaxIdPi0[mcindex][matched]->Fill(e2, nMax, GetEventWeight());
2165 
2166  if (nMax==1)
2167  {
2168  fhM02Pi0NLocMax1 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2169  fhMassPi0NLocMax1[mcindex][matched]->Fill(en, mass, GetEventWeight());
2170  fhAsyPi0NLocMax1 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2171  fhMassSplitEPi0NLocMax1[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2172  if(fFillNCellHisto) fhNCellPi0NLocMax1[mcindex][matched]->Fill(en, nc, GetEventWeight());
2173  }
2174  else if(nMax==2)
2175  {
2176  fhM02Pi0NLocMax2 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2177  fhMassPi0NLocMax2[mcindex][matched]->Fill(en, mass, GetEventWeight());
2178  fhAsyPi0NLocMax2 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2179  fhMassSplitEPi0NLocMax2[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2180  if(fFillNCellHisto) fhNCellPi0NLocMax2[mcindex][matched]->Fill(en, nc, GetEventWeight());
2181  }
2182  else if(nMax >2)
2183  {
2184  fhM02Pi0NLocMaxN [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2185  fhMassPi0NLocMaxN[mcindex][matched]->Fill(en, mass, GetEventWeight());
2186  fhAsyPi0NLocMaxN [mcindex][matched]->Fill(en, asym, GetEventWeight());
2187  fhMassSplitEPi0NLocMaxN[mcindex][matched]->Fill(e1+e2, mass, GetEventWeight());
2188  if(fFillNCellHisto) fhNCellPi0NLocMaxN[mcindex][matched]->Fill(en, nc, GetEventWeight());
2189  }
2190  } // Work with MC truth
2191 }
2192 
2193 //______________________________________________________________________________________________________
2195 //______________________________________________________________________________________________________
2196 void AliAnaInsideClusterInvariantMass::FillIdEtaHistograms(Float_t en, Float_t e1, Float_t e2,
2197  Int_t nc, Int_t nMax, Float_t t12diff,
2198  Float_t mass, Float_t l0,
2199  Float_t eta, Float_t phi,
2200  Bool_t matched, Int_t mcindex)
2201 {
2202  Float_t asym = -10;
2203  if(e1+e2>0) asym = (e1-e2)/(e1+e2);
2204 
2205  if (nMax==1)
2206  {
2207  fhM02EtaNLocMax1 [0][matched]->Fill(en, l0 , GetEventWeight());
2208  fhMassEtaNLocMax1[0][matched]->Fill(en, mass, GetEventWeight());
2209  fhAsyEtaNLocMax1 [0][matched]->Fill(en, asym, GetEventWeight());
2210  if(fFillNCellHisto) fhNCellEtaNLocMax1[0][matched]->Fill(en, nc, GetEventWeight());
2211 
2212  if(!matched)
2213  {
2214  if(fFillHighMultHisto)
2215  {
2218  }
2219  if(en > fHistoECut)fhEtaEtaPhiNLocMax1->Fill(eta, phi, GetEventWeight());
2220  fhEtaEPairDiffTimeNLM1->Fill(e1+e2, t12diff, GetEventWeight());
2221  }
2222  }
2223  else if(nMax==2)
2224  {
2225  fhM02EtaNLocMax2 [0][matched]->Fill(en, l0 , GetEventWeight());
2226  fhMassEtaNLocMax2[0][matched]->Fill(en, mass, GetEventWeight());
2227  fhAsyEtaNLocMax2 [0][matched]->Fill(en, asym, GetEventWeight());
2228  if(fFillNCellHisto) fhNCellEtaNLocMax2[0][matched]->Fill(en, nc, GetEventWeight());
2229 
2230  if(!matched)
2231  {
2232  if(fFillHighMultHisto)
2233  {
2236  }
2237  if(en > fHistoECut)fhEtaEtaPhiNLocMax2->Fill(eta, phi, GetEventWeight());
2238  fhEtaEPairDiffTimeNLM2->Fill(e1+e2, t12diff, GetEventWeight());
2239  }
2240  }
2241  else if(nMax >2)
2242  {
2243  fhM02EtaNLocMaxN [0][matched]->Fill(en, l0 , GetEventWeight());
2244  fhMassEtaNLocMaxN[0][matched]->Fill(en, mass, GetEventWeight());
2245  fhAsyEtaNLocMaxN [0][matched]->Fill(en, asym, GetEventWeight());
2246  if(fFillNCellHisto) fhNCellEtaNLocMaxN[0][matched]->Fill(en, nc, GetEventWeight());
2247 
2248  if(!matched)
2249  {
2250  if(fFillHighMultHisto)
2251  {
2254  }
2255  if(en > fHistoECut)fhEtaEtaPhiNLocMaxN->Fill(eta, phi, GetEventWeight());
2256  fhEtaEPairDiffTimeNLMN->Fill(e1+e2, t12diff, GetEventWeight());
2257  }
2258  }
2259 
2260  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2261  {
2262  if (nMax==1)
2263  {
2264  fhM02EtaNLocMax1 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2265  fhMassEtaNLocMax1[mcindex][matched]->Fill(en, mass, GetEventWeight());
2266  fhAsyEtaNLocMax1 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2267  if(fFillNCellHisto) fhNCellEtaNLocMax1[mcindex][matched]->Fill(en, nc, GetEventWeight());
2268  }
2269  else if(nMax==2)
2270  {
2271  fhM02EtaNLocMax2 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2272  fhMassEtaNLocMax2[mcindex][matched]->Fill(en, mass, GetEventWeight());
2273  fhAsyEtaNLocMax2 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2274  if(fFillNCellHisto) fhNCellEtaNLocMax2[mcindex][matched]->Fill(en, nc, GetEventWeight());
2275 
2276  }
2277  else if(nMax >2)
2278  {
2279  fhM02EtaNLocMaxN [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2280  fhMassEtaNLocMaxN[mcindex][matched]->Fill(en, mass, GetEventWeight());
2281  fhAsyEtaNLocMaxN [mcindex][matched]->Fill(en, asym, GetEventWeight());
2282  if(fFillNCellHisto) fhNCellEtaNLocMaxN[mcindex][matched]->Fill(en, nc, GetEventWeight());
2283  }
2284  } // Work with MC truth
2285 }
2286 
2287 //__________________________________________________________________________________________________
2289 //__________________________________________________________________________________________________
2290 void AliAnaInsideClusterInvariantMass::FillIdConvHistograms(Float_t en, Int_t nMax, Float_t asym,
2291  Float_t mass, Float_t l0,
2292  Bool_t matched, Int_t mcindex)
2293 {
2294  if ( nMax == 1 )
2295  {
2296  fhM02ConNLocMax1 [0][matched]->Fill(en, l0 , GetEventWeight());
2297  fhMassConNLocMax1[0][matched]->Fill(en, mass, GetEventWeight());
2298  fhAsyConNLocMax1 [0][matched]->Fill(en, asym, GetEventWeight());
2299  }
2300  else if ( nMax == 2 )
2301  {
2302  fhM02ConNLocMax2 [0][matched]->Fill(en, l0 , GetEventWeight());
2303  fhMassConNLocMax2[0][matched]->Fill(en, mass, GetEventWeight());
2304  fhAsyConNLocMax2 [0][matched]->Fill(en, asym, GetEventWeight());
2305  }
2306  else if ( nMax > 2 )
2307  {
2308  fhM02ConNLocMaxN [0][matched]->Fill(en, l0 , GetEventWeight());
2309  fhMassConNLocMaxN[0][matched]->Fill(en, mass, GetEventWeight());
2310  fhAsyConNLocMaxN [0][matched]->Fill(en, asym, GetEventWeight());
2311  }
2312 
2313  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2314  {
2315  if ( nMax == 1 )
2316  {
2317  fhM02ConNLocMax1 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2318  fhMassConNLocMax1[mcindex][matched]->Fill(en, mass, GetEventWeight());
2319  fhAsyConNLocMax1 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2320  }
2321  else if ( nMax == 2 )
2322  {
2323  fhM02ConNLocMax2 [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2324  fhMassConNLocMax2[mcindex][matched]->Fill(en, mass, GetEventWeight());
2325  fhAsyConNLocMax2 [mcindex][matched]->Fill(en, asym, GetEventWeight());
2326  }
2327  else if ( nMax > 2 )
2328  {
2329  fhM02ConNLocMaxN [mcindex][matched]->Fill(en, l0 , GetEventWeight());
2330  fhMassConNLocMaxN[mcindex][matched]->Fill(en, mass, GetEventWeight());
2331  fhAsyConNLocMaxN [mcindex][matched]->Fill(en, asym, GetEventWeight());
2332  }
2333  } // Work with MC truth
2334 }
2335 
2336 //_______________________________________________________________________________________________________
2338 //_______________________________________________________________________________________________________
2339 void AliAnaInsideClusterInvariantMass::FillMCHistograms(Float_t en, Float_t e1 , Float_t e2,
2340  Int_t ebin, Int_t mcindex,Int_t noverlaps,
2341  Float_t l0, Float_t mass,
2342  Int_t nMax, Bool_t matched,
2343  Float_t splitFrac, Float_t asym,
2344  Float_t eprim, Float_t asymGen)
2345 {
2346  Float_t efrac = eprim/en;
2347  Float_t efracSplit = 0;
2348  if(e1+e2 > 0) efracSplit = eprim/(e1+e2);
2349  Float_t asymDiff = TMath::Abs(asym) - TMath::Abs(asymGen);
2350 
2351  //printf("e1 %2.2f, e2 %2.2f, eprim %2.2f, ereco %2.2f, esplit/ereco %2.2f, egen/ereco %2.2f, egen/esplit %2.2f\n",
2352  // e1,e2,eprim,en,splitFrac,efrac,efracSplit);
2353 
2354  if(ebin >= 0 && fFillEbinHisto)
2355  {
2356  if( !matched ) fhMCGenFracNLocMaxEbin [mcindex][ebin]->Fill(efrac, nMax, GetEventWeight());
2357  else fhMCGenFracNLocMaxEbinMatched[mcindex][ebin]->Fill(efrac, nMax, GetEventWeight());
2358  }
2359 
2360  if ( nMax == 1 )
2361  {
2362  fhMCGenFracNLocMax1 [mcindex][matched]->Fill(en , efrac , GetEventWeight());
2363  fhMCGenSplitEFracNLocMax1[mcindex][matched]->Fill(en , efracSplit, GetEventWeight());
2364  fhMCGenEvsSplitENLocMax1 [mcindex][matched]->Fill(eprim, e1+e2 , GetEventWeight());
2365  if(asym > 0 && !matched)
2366  {
2367  if (mcindex==kmcPi0) fhAsyMCGenRecoDiffMCPi0[0] ->Fill(en, asymDiff, GetEventWeight());
2368  else if(mcindex==kmcPi0Conv)fhAsyMCGenRecoDiffMCPi0Conv[0]->Fill(en, asymDiff, GetEventWeight());
2369  }
2370 
2371  if(noverlaps==0)
2372  {
2373  fhMCGenFracNLocMax1NoOverlap [mcindex][matched]->Fill(en, efrac , GetEventWeight());
2374  fhMCGenSplitEFracNLocMax1NoOverlap[mcindex][matched]->Fill(en, efracSplit, GetEventWeight());
2375  }
2376 
2377  if( en > fHistoECut )
2378  {
2379  fhMCGenEFracvsSplitEFracNLocMax1[mcindex][matched]->Fill(efrac, splitFrac, GetEventWeight());
2380 
2381  if(!matched && ebin >= 0 && fFillEbinHisto)
2382  {
2383  fhM02MCGenFracNLocMax1Ebin [mcindex][ebin]->Fill(efrac, l0 , GetEventWeight());
2384  fhMassMCGenFracNLocMax1Ebin[mcindex][ebin]->Fill(efrac, mass, GetEventWeight());
2385 
2386  if(mcindex==kmcPi0 || mcindex==kmcPi0Conv)
2387  {
2388  fhMCAsymM02NLocMax1MCPi0Ebin [ebin]->Fill(l0 , asymGen, GetEventWeight());
2389  fhAsyMCGenRecoNLocMax1EbinPi0[ebin]->Fill(asym, asymGen, GetEventWeight());
2390  }
2391  }
2392  }
2393  }
2394  else if( nMax == 2 )
2395  {
2396  fhMCGenFracNLocMax2 [mcindex][matched]->Fill(en , efrac , GetEventWeight());
2397  fhMCGenSplitEFracNLocMax2[mcindex][matched]->Fill(en , efracSplit, GetEventWeight());
2398  fhMCGenEvsSplitENLocMax2 [mcindex][matched]->Fill(eprim, e1+e2 , GetEventWeight());
2399 
2400  if(asym > 0 && !matched)
2401  {
2402  if (mcindex==kmcPi0) fhAsyMCGenRecoDiffMCPi0[1] ->Fill(en, asymDiff, GetEventWeight());
2403  else if(mcindex==kmcPi0Conv)fhAsyMCGenRecoDiffMCPi0Conv[1]->Fill(en, asymDiff, GetEventWeight());
2404  }
2405 
2406  if(noverlaps==0)
2407  {
2408  fhMCGenFracNLocMax2NoOverlap [mcindex][matched]->Fill(en, efrac , GetEventWeight());
2409  fhMCGenSplitEFracNLocMax2NoOverlap[mcindex][matched]->Fill(en, efracSplit, GetEventWeight());
2410  }
2411 
2412  if( en > fHistoECut )
2413  {
2414  fhMCGenEFracvsSplitEFracNLocMax2[mcindex][matched]->Fill(efrac, splitFrac, GetEventWeight());
2415 
2416  if(!matched && ebin >= 0 && fFillEbinHisto)
2417  {
2418  fhM02MCGenFracNLocMax2Ebin [mcindex][ebin]->Fill(efrac, l0 , GetEventWeight());
2419  fhMassMCGenFracNLocMax2Ebin[mcindex][ebin]->Fill(efrac, mass, GetEventWeight());
2420  if(mcindex==kmcPi0 || mcindex==kmcPi0Conv)
2421  {
2422  fhMCAsymM02NLocMax2MCPi0Ebin [ebin]->Fill(l0 , asymGen, GetEventWeight());
2423  fhAsyMCGenRecoNLocMax2EbinPi0[ebin]->Fill(asym, asymGen, GetEventWeight());
2424  }
2425  }
2426  }
2427  }
2428  else if( nMax > 2 )
2429  {
2430  fhMCGenFracNLocMaxN [mcindex][matched]->Fill(en , efrac , GetEventWeight());
2431  fhMCGenSplitEFracNLocMaxN[mcindex][matched]->Fill(en , efracSplit, GetEventWeight());
2432  fhMCGenEvsSplitENLocMaxN [mcindex][matched]->Fill(eprim, e1+e2 , GetEventWeight());
2433 
2434  if(asym > 0 && !matched)
2435  {
2436  if (mcindex==kmcPi0) fhAsyMCGenRecoDiffMCPi0[2] ->Fill(en, asymDiff, GetEventWeight());
2437  else if(mcindex==kmcPi0Conv)fhAsyMCGenRecoDiffMCPi0Conv[2]->Fill(en, asymDiff, GetEventWeight());
2438  }
2439 
2440  if(noverlaps==0)
2441  {
2442  fhMCGenFracNLocMaxNNoOverlap [mcindex][matched]->Fill(en, efrac , GetEventWeight());
2443  fhMCGenSplitEFracNLocMaxNNoOverlap[mcindex][matched]->Fill(en, efracSplit, GetEventWeight());
2444  }
2445 
2446  if( en > fHistoECut )
2447  {
2448  fhMCGenEFracvsSplitEFracNLocMaxN[mcindex][matched]->Fill(efrac, splitFrac, GetEventWeight());
2449 
2450  if(!matched && ebin >= 0 && fFillEbinHisto)
2451  {
2452  fhM02MCGenFracNLocMaxNEbin [mcindex][ebin]->Fill(efrac, l0 , GetEventWeight());
2453  fhMassMCGenFracNLocMaxNEbin[mcindex][ebin]->Fill(efrac, mass, GetEventWeight());
2454 
2455  if(mcindex==kmcPi0 || mcindex==kmcPi0Conv)
2456  {
2457  fhMCAsymM02NLocMaxNMCPi0Ebin [ebin]->Fill(l0 , asymGen, GetEventWeight());
2458  fhAsyMCGenRecoNLocMaxNEbinPi0[ebin]->Fill(asym, asymGen, GetEventWeight());
2459  }
2460  }
2461  }
2462  }
2463 }
2464 
2465 //__________________________________________________________________________________________________________
2467 //__________________________________________________________________________________________________________
2469  Int_t nc, Float_t mass, Float_t l0,
2470  Float_t asym, Float_t splitFrac,
2471  Int_t inlm, Int_t ebin, Bool_t matched,
2472  Int_t mcindex, Int_t noverlaps)
2473 {
2474  //printf("en %f,mass %f,l0 %f,inlm %d,ebin %d,matched %d,mcindex %d,noverlaps %d \n",en,mass,l0,inlm,ebin,matched,mcindex,noverlaps);
2475 
2476  //printf("AliAnaInsideClusterInvariantMass::FillMCOverlapHistograms - NLM bin=%d, mcIndex %d, n Overlaps %d\n",inlm,mcindex,noverlaps);
2477 
2478  if(!matched)
2479  {
2480  fhMCENOverlaps[inlm][mcindex]->Fill(en, noverlaps, GetEventWeight());
2481 
2482  if (noverlaps == 0)
2483  {
2484  fhMCEM02Overlap0 [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2485  fhMCEMassOverlap0 [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2486  fhMCEEpriOverlap0 [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2487  fhMCEAsymOverlap0 [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2488  if(fFillNCellHisto) fhMCENCellOverlap0[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2489  fhMCESplitEFracOverlap0[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2490  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02Overlap0[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2491  }
2492  else if(noverlaps == 1)
2493  {
2494  fhMCEM02Overlap1 [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2495  fhMCEMassOverlap1 [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2496  fhMCEEpriOverlap1 [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2497  fhMCEAsymOverlap1 [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2498  if(fFillNCellHisto) fhMCENCellOverlap1[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2499  fhMCESplitEFracOverlap1[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2500  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02Overlap1[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2501  }
2502  else if(noverlaps > 1)
2503  {
2504  fhMCEM02OverlapN [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2505  fhMCEMassOverlapN [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2506  fhMCEEpriOverlapN [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2507  fhMCEAsymOverlapN [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2508  if(fFillNCellHisto) fhMCENCellOverlapN[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2509  fhMCESplitEFracOverlapN[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2510  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02OverlapN[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2511  }
2512  else
2513  AliWarning(Form("n overlaps = %d!!", noverlaps));
2514  }
2515  else if(fFillTMHisto)
2516  {
2517  fhMCENOverlapsMatch[inlm][mcindex]->Fill(en, noverlaps, GetEventWeight());
2518 
2519  if (noverlaps == 0)
2520  {
2521  fhMCEM02Overlap0Match [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2522  fhMCEMassOverlap0Match [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2523  fhMCEEpriOverlap0Match [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2524  fhMCEAsymOverlap0Match [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2525  if(fFillNCellHisto) fhMCENCellOverlap0Match[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2526  fhMCESplitEFracOverlap0Match[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2527  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02Overlap0Match[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2528  }
2529  else if(noverlaps == 1)
2530  {
2531  fhMCEM02Overlap1Match [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2532  fhMCEMassOverlap1Match [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2533  fhMCEEpriOverlap1Match [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2534  fhMCEAsymOverlap1Match [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2535  if(fFillNCellHisto) fhMCENCellOverlap1Match[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2536  fhMCESplitEFracOverlap1Match[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2537  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02Overlap1Match[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2538  }
2539  else if(noverlaps > 1)
2540  {
2541  fhMCEM02OverlapNMatch [inlm][mcindex]->Fill(en, l0 , GetEventWeight());
2542  fhMCEMassOverlapNMatch [inlm][mcindex]->Fill(en, mass , GetEventWeight());
2543  fhMCEEpriOverlapNMatch [inlm][mcindex]->Fill(en, enprim, GetEventWeight());
2544  fhMCEAsymOverlapNMatch [inlm][mcindex]->Fill(en, TMath::Abs(asym), GetEventWeight());
2545  if(fFillNCellHisto) fhMCENCellOverlapNMatch[inlm][mcindex]->Fill(en, nc, GetEventWeight());
2546  fhMCESplitEFracOverlapN[inlm][mcindex]->Fill(en, splitFrac, GetEventWeight());
2547  if((mcindex==kmcPi0 || mcindex == kmcPi0Conv) && ebin >=0) fhMCPi0MassM02OverlapNMatch[inlm][ebin]->Fill(l0, mass, GetEventWeight());
2548  }
2549  else
2550  AliWarning(Form("n overlaps in matched = %d!!", noverlaps));
2551  }
2552 }
2553 
2554 
2555 //_____________________________________________________________________________________________________
2557 //_____________________________________________________________________________________________________
2558 void AliAnaInsideClusterInvariantMass::FillNCellHistograms(Int_t ncells, Float_t energy, Int_t nMax,
2559  Bool_t matched, Int_t mcindex,
2560  Float_t mass , Float_t l0)
2561 
2562 {
2563  if (nMax==1)
2564  {
2565  fhNCellNLocMax1[0][matched]->Fill(energy, ncells, GetEventWeight()) ;
2566  if(mcindex > 0 ) fhNCellNLocMax1[mcindex][matched]->Fill(energy, ncells, GetEventWeight()) ;
2567 
2568  if (mcindex==kmcPi0 && !matched)
2569  {
2570  if( energy > fHistoECut)
2571  {
2572  fhNCellMassEHighNLocMax1MCPi0->Fill(ncells, mass, GetEventWeight());
2573  fhNCellM02EHighNLocMax1MCPi0 ->Fill(ncells, l0 , GetEventWeight());
2574  }
2575  else
2576  {
2577  fhNCellMassELowNLocMax1MCPi0->Fill(ncells, mass, GetEventWeight());
2578  fhNCellM02ELowNLocMax1MCPi0 ->Fill(ncells, l0 , GetEventWeight());
2579  }
2580  }
2581  }
2582  else if( nMax == 2 )
2583  {
2584  fhNCellNLocMax2[0][matched]->Fill(energy, ncells, GetEventWeight()) ;
2585  if(mcindex > 0 ) fhNCellNLocMax2[mcindex][matched]->Fill(energy, ncells, GetEventWeight()) ;
2586 
2587 
2588  if (mcindex==kmcPi0 && !matched)
2589  {
2590  if( energy > fHistoECut)
2591  {
2592  fhNCellMassEHighNLocMax2MCPi0->Fill(ncells, mass, GetEventWeight());
2593  fhNCellM02EHighNLocMax2MCPi0 ->Fill(ncells, l0 , GetEventWeight());
2594  }
2595  else
2596  {
2597  fhNCellMassELowNLocMax2MCPi0->Fill(ncells, mass, GetEventWeight());
2598  fhNCellM02ELowNLocMax2MCPi0 ->Fill(ncells, l0 , GetEventWeight());
2599  }
2600  }
2601  }
2602  else if( nMax >= 3 )
2603  {
2604  fhNCellNLocMaxN[0][matched]->Fill(energy, ncells, GetEventWeight()) ;
2605  if(mcindex > 0 ) fhNCellNLocMaxN[mcindex][matched]->Fill(energy, ncells, GetEventWeight()) ;
2606 
2607  if (mcindex==kmcPi0 && !matched)
2608  {
2609  if( energy > fHistoECut)
2610  {
2611  fhNCellMassEHighNLocMaxNMCPi0->Fill(ncells, mass, GetEventWeight());
2612  fhNCellM02EHighNLocMaxNMCPi0 ->Fill(ncells, l0 , GetEventWeight());
2613  }
2614  else
2615  {
2616  fhNCellMassELowNLocMaxNMCPi0->Fill(ncells, mass, GetEventWeight());
2617  fhNCellM02ELowNLocMaxNMCPi0 ->Fill(ncells, l0 , GetEventWeight());
2618  }
2619  }
2620  }
2621 }
2622 
2623 //______________________________________________________________________________________________________
2625 //______________________________________________________________________________________________________
2626 void AliAnaInsideClusterInvariantMass::FillNLMDiffCutHistograms(AliVCluster *clus, AliVCaloCells* cells, Bool_t matched)
2627 {
2628  Float_t energy = clus->E();
2629  Float_t m02 = clus->GetM02();
2630 
2631  Float_t minEOrg = GetCaloUtils()->GetLocalMaximaCutE() ;
2632  Float_t minEDiffOrg = GetCaloUtils()->GetLocalMaximaCutEDiff();
2633 
2634  Int_t nlm = 0;
2635  Double_t mass = 0., angle = 0.;
2636  Int_t absId1 =-1; Int_t absId2 =-1;
2637  Float_t distbad1 =-1; Float_t distbad2 =-1;
2638  Bool_t fidcut1 = 0; Bool_t fidcut2 = 0;
2639  Int_t pidTag = -1;
2640 
2641  //printf("E %f, m02 %f; Org: minE %f, minDiffE %f\n",energy, m02, minEOrg,minEDiffOrg);
2642  for(Int_t iE = 0; iE < fNLMSettingN; iE++)
2643  {
2644  for(Int_t iDiff = 0; iDiff < fNLMSettingN; iDiff++)
2645  {
2648 
2649  //nlm = GetCaloUtils()->GetNumberOfLocalMaxima(clus, cells) ;
2650 
2651  //printf("\t Change: i %d minE %f, j %d minDiffE %f - NLM = %d\n",iE, fNLMMinE[iE], iDiff, fNLMMinDiff[iDiff],nlm);
2652 
2654  GetVertex(0), nlm, mass, angle,
2655  fSubClusterMom1,fSubClusterMom2,absId1,absId2,
2656  distbad1,distbad2,fidcut1,fidcut2);
2657  if (nlm <= 0)
2658  {
2659  AliWarning("No local maximum found! It did not pass CaloPID selection criteria");
2660  continue;
2661  }
2662 
2663  Int_t inlm = nlm-1;
2664  if(inlm>2) inlm = 2;
2665 
2666  fhNLocMaxDiffCut [iE][iDiff] [matched]->Fill(energy, nlm , GetEventWeight());
2667  fhM02NLocMaxDiffCut [iE][iDiff][inlm][matched]->Fill(energy, m02 , GetEventWeight());
2668  fhMassNLocMaxDiffCut[iE][iDiff][inlm][matched]->Fill(energy, mass, GetEventWeight());
2669 
2670  if(pidTag==AliCaloPID::kPi0)
2671  {
2672  fhNLocMaxDiffCutPi0 [iE][iDiff] [matched]->Fill(energy, nlm , GetEventWeight());
2673  fhM02NLocMaxDiffCutPi0 [iE][iDiff][inlm][matched]->Fill(energy, m02 , GetEventWeight());
2674  fhMassNLocMaxDiffCutPi0[iE][iDiff][inlm][matched]->Fill(energy, mass, GetEventWeight());
2675  }
2676  }
2677  }
2678 
2679  GetCaloUtils()->SetLocalMaximaCutE (minEOrg );
2680  GetCaloUtils()->SetLocalMaximaCutEDiff(minEDiffOrg);
2681 }
2682 
2683 
2684 //_____________________________________________________________________________________________
2686 //_____________________________________________________________________________________________
2687 void AliAnaInsideClusterInvariantMass::FillSSExtraHistograms(AliVCluster *cluster, Int_t nMax,
2688  Bool_t matched, Int_t mcindex,
2689  Float_t mass , Int_t ebin)
2690 {
2691  Float_t en = cluster->E();
2692 
2693  // Get more Shower Shape parameters
2694  Float_t ll0 = 0., ll1 = 0.;
2695  Float_t disp= 0., dispEta = 0., dispPhi = 0.;
2696  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2697 
2698  GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
2699  ll0, ll1, disp, dispEta, dispPhi, sEta, sPhi, sEtaPhi);
2700 
2701  Float_t dispAsy = -1;
2702  if(dispEta+dispPhi >0 ) dispAsy = (dispPhi-dispEta) / (dispPhi+dispEta);
2703 
2704  if (nMax==1)
2705  {
2706  if( en > fHistoECut )
2707  {
2708  fhMassDispEtaNLocMax1[0][matched]->Fill(dispEta, mass, GetEventWeight());
2709  fhMassDispPhiNLocMax1[0][matched]->Fill(dispPhi, mass, GetEventWeight());
2710  fhMassDispAsyNLocMax1[0][matched]->Fill(dispAsy, mass, GetEventWeight());
2711 
2712  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2713  {
2714  fhMassDispEtaNLocMax1[mcindex][matched]->Fill(dispEta, mass, GetEventWeight());
2715  fhMassDispPhiNLocMax1[mcindex][matched]->Fill(dispPhi, mass, GetEventWeight());
2716  fhMassDispAsyNLocMax1[mcindex][matched]->Fill(dispAsy, mass, GetEventWeight());
2717  }
2718  }
2719 
2720  if(!matched && ebin >= 0 && fFillEbinHisto)
2721  {
2722  fhMassDispEtaNLocMax1Ebin[ebin]->Fill(dispEta, mass, GetEventWeight());
2723  fhMassDispPhiNLocMax1Ebin[ebin]->Fill(dispPhi, mass, GetEventWeight());
2724  fhMassDispAsyNLocMax1Ebin[ebin]->Fill(dispAsy, mass, GetEventWeight());
2725  }
2726  }
2727  else if( nMax == 2 )
2728  {
2729  if( en > fHistoECut )
2730  {
2731  fhMassDispEtaNLocMax2[0][matched]->Fill(dispEta, mass, GetEventWeight());
2732  fhMassDispPhiNLocMax2[0][matched]->Fill(dispPhi, mass, GetEventWeight());
2733  fhMassDispAsyNLocMax2[0][matched]->Fill(dispAsy, mass, GetEventWeight());
2734 
2735  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2736  {
2737  fhMassDispEtaNLocMax2[mcindex][matched]->Fill(dispEta, mass, GetEventWeight());
2738  fhMassDispPhiNLocMax2[mcindex][matched]->Fill(dispPhi, mass, GetEventWeight());
2739  fhMassDispAsyNLocMax2[mcindex][matched]->Fill(dispAsy, mass, GetEventWeight());
2740  }
2741  }
2742 
2743  if(!matched && ebin >= 0 && fFillEbinHisto)
2744  {
2745  fhMassDispEtaNLocMax2Ebin[ebin]->Fill(dispEta, mass, GetEventWeight());
2746  fhMassDispPhiNLocMax2Ebin[ebin]->Fill(dispPhi, mass, GetEventWeight());
2747  fhMassDispAsyNLocMax2Ebin[ebin]->Fill(dispAsy, mass, GetEventWeight());
2748  }
2749  }
2750  else if( nMax >= 3 )
2751  {
2752  if( en > fHistoECut )
2753  {
2754  fhMassDispEtaNLocMaxN[0][matched]->Fill(dispEta, mass, GetEventWeight());
2755  fhMassDispPhiNLocMaxN[0][matched]->Fill(dispPhi, mass, GetEventWeight());
2756  fhMassDispAsyNLocMaxN[0][matched]->Fill(dispAsy, mass, GetEventWeight());
2757 
2758  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2759  {
2760  fhMassDispEtaNLocMaxN[mcindex][matched]->Fill(dispEta, mass, GetEventWeight());
2761  fhMassDispPhiNLocMaxN[mcindex][matched]->Fill(dispPhi, mass, GetEventWeight());
2762  fhMassDispAsyNLocMaxN[mcindex][matched]->Fill(dispAsy, mass, GetEventWeight());
2763  }
2764  }
2765 
2766  if(!matched && ebin >= 0 && fFillEbinHisto)
2767  {
2768  fhMassDispEtaNLocMaxNEbin[ebin]->Fill(dispEta, mass, GetEventWeight());
2769  fhMassDispPhiNLocMaxNEbin[ebin]->Fill(dispPhi, mass, GetEventWeight());
2770  fhMassDispAsyNLocMaxNEbin[ebin]->Fill(dispAsy, mass, GetEventWeight());
2771  }
2772  }
2773 }
2774 
2775 //__________________________________________________________________________________________
2777 //__________________________________________________________________________________________
2779  Int_t absId1, Int_t absId2)
2780 {
2781  AliVCaloCells* cells = 0;
2782  if(GetCalorimeter() == kEMCAL) cells = GetEMCALCells();
2783  else cells = GetPHOSCells();
2784 
2785  // First recalculate energy in case non linearity was applied
2786  Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, cells);// recalculate cluster energy, avoid non lin correction.
2787 
2788  Float_t simuTotWeight = 0;
2789  if(GetCaloUtils()->IsMCECellClusFracCorrectionOn())
2790  {
2791  simuTotWeight = GetCaloUtils()->RecalibrateClusterEnergyWeightCell(clus, cells,energy);
2792  simuTotWeight/= energy;
2793  }
2794 
2795  if(energy <=0 )
2796  {
2797  AliWarning(Form("Wrong calculated energy %f",energy));
2798  return;
2799  }
2800 
2801  // Get amplitude of main local maxima, recalibrate if needed
2802  Float_t amp1 = cells->GetCellAmplitude(absId1);
2804  Float_t amp2 = cells->GetCellAmplitude(absId2);
2806 
2807  if(amp1 < amp2) AliWarning(Form("Bad local maxima E ordering : id1 E %f, id2 E %f",amp1,amp2));
2808  if(amp1==0 || amp2==0) AliWarning(Form("Null E local maxima : id1 E %f, id2 E %f " ,amp1,amp2));
2809 
2810  if(GetCaloUtils()->IsMCECellClusFracCorrectionOn())
2811  {
2812  amp1*=GetCaloUtils()->GetMCECellClusFracCorrection(amp1,energy)/simuTotWeight;
2813  amp2*=GetCaloUtils()->GetMCECellClusFracCorrection(amp2,energy)/simuTotWeight;
2814  }
2815 
2816  if(amp1>0)fhPi0CellEMaxEMax2Frac [nlm]->Fill(energy, amp2/amp1, GetEventWeight());
2817  fhPi0CellEMaxClusterFrac [nlm]->Fill(energy, amp1/energy, GetEventWeight());
2818  fhPi0CellEMax2ClusterFrac[nlm]->Fill(energy, amp2/energy, GetEventWeight());
2819 
2820  // Get the ratio and log ratio to all cells in cluster
2821  for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
2822  {
2823  Int_t id = clus->GetCellsAbsId()[ipos];
2824 
2825  // Recalibrate cell energy if needed
2826  Float_t amp = cells->GetCellAmplitude(id);
2828  if(GetCaloUtils()->IsMCECellClusFracCorrectionOn())
2829  {
2830  //printf("eCell a) %f",amp);
2831  amp*=GetCaloUtils()->GetMCECellClusFracCorrection(amp,energy)/simuTotWeight;
2832  //printf(", b)%f\n",amp);
2833  }
2834 
2835  if(amp > 0)fhPi0CellE [nlm]->Fill(energy, amp, GetEventWeight());
2836  fhPi0CellEFrac [nlm]->Fill(energy, amp/energy, GetEventWeight());
2837  fhPi0CellLogEFrac[nlm]->Fill(energy, TMath::Log(amp/energy), GetEventWeight());
2838 
2839  if (id!=absId1 && id!=absId2)
2840  {
2841  if(amp1>0)fhPi0CellEMaxFrac [nlm]->Fill(energy, amp/amp1, GetEventWeight());
2842  if(amp2>0)fhPi0CellEMax2Frac[nlm]->Fill(energy, amp/amp2, GetEventWeight());
2843  }
2844  }
2845 
2846  // Recalculate shower shape for different W0
2847  if(GetCalorimeter()==kEMCAL)
2848  {
2849  Float_t l0org = clus->GetM02();
2850  Float_t l1org = clus->GetM20();
2851  Float_t dorg = clus->GetDispersion();
2852  Float_t w0org = GetCaloUtils()->GetEMCALRecoUtils()->GetW0();
2853 
2854  //printf("E cl %2.3f, E recal %2.3f, nlm %d, Org w0 %2.3f, org l0 %2.3f\n",clus->E(), energy,nlm, w0org,l0org);
2855 
2856  for(Int_t iw = 0; iw < fSSWeightN; iw++)
2857  {
2858  GetCaloUtils()->GetEMCALRecoUtils()->SetW0(fSSWeight[iw]);
2859  //GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
2860  //fhM02WeightPi0[nlm][iw]->Fill(energy, clus->GetM02(), GetEventWeight());
2861 
2862  Float_t l0 = 0., l1 = 0.;
2863  Float_t disp = 0., dEta = 0., dPhi = 0.;
2864  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2865 
2867  dEta, dPhi, sEta, sPhi, sEtaPhi,fSSECellCut[0]);
2868  //Make sure that for pp fSSECellCut[0]=0.05 and for PbPb fSSECellCut[0]=0.15
2869 
2870 
2871  fhM02WeightPi0[nlm][iw]->Fill(energy, l0, GetEventWeight());
2872 
2873  //printf("\t w0 %2.3f, l0 %2.3f\n",GetCaloUtils()->GetEMCALRecoUtils()->GetW0(),l0);
2874  } // w0 loop
2875 
2876  // Set the original values back
2877  clus->SetM02(l0org);
2878  clus->SetM20(l1org);
2879  clus->SetDispersion(dorg);
2880  GetCaloUtils()->GetEMCALRecoUtils()->SetW0(w0org);
2881 
2882  for(Int_t iec = 0; iec < fSSECellCutN; iec++)
2883  {
2884  Float_t l0 = 0., l1 = 0.;
2885  Float_t disp = 0., dEta = 0., dPhi = 0.;
2886  Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
2887 
2889  dEta, dPhi, sEta, sPhi, sEtaPhi,fSSECellCut[iec]);
2890 
2891  fhM02ECellCutPi0[nlm][iec]->Fill(energy, l0, GetEventWeight());
2892 
2893  //printf("\t min E cell %2.3f, l0 %2.3f\n",fSSECellCut[iec], l0);
2894  } // w0 loop
2895  }// EMCAL
2896 }
2897 
2898 //____________________________________________________________________________________________
2900 //____________________________________________________________________________________________
2902  Int_t nMax, Int_t mcindex)
2903 {
2904  Float_t dZ = cluster->GetTrackDz();
2905  Float_t dR = cluster->GetTrackDx();
2906  Float_t en = cluster->E();
2907 
2908  if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
2909  {
2910  dR = 2000., dZ = 2000.;
2911  GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
2912  }
2913 
2914  //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
2915 
2916  if(TMath::Abs(dR) < 999)
2917  {
2918  if ( nMax == 1 )
2919  {
2920  fhTrackMatchedDEtaNLocMax1[0]->Fill(en, dZ, GetEventWeight());
2921  fhTrackMatchedDPhiNLocMax1[0]->Fill(en, dR, GetEventWeight());
2922  }
2923  else if( nMax == 2 )
2924  {
2925  fhTrackMatchedDEtaNLocMax2[0]->Fill(en, dZ, GetEventWeight());
2926  fhTrackMatchedDPhiNLocMax2[0]->Fill(en, dR, GetEventWeight());
2927  }
2928  else if( nMax >= 3 )
2929  {
2930  fhTrackMatchedDEtaNLocMaxN[0]->Fill(en, dZ, GetEventWeight());
2931  fhTrackMatchedDPhiNLocMaxN[0]->Fill(en, dR, GetEventWeight());
2932  }
2933 
2934  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2935  {
2936  if ( nMax == 1 )
2937  {
2938  fhTrackMatchedDEtaNLocMax1[mcindex]->Fill(en, dZ, GetEventWeight());
2939  fhTrackMatchedDPhiNLocMax1[mcindex]->Fill(en, dR, GetEventWeight());
2940  }
2941  else if( nMax == 2 )
2942  {
2943  fhTrackMatchedDEtaNLocMax2[mcindex]->Fill(en, dZ, GetEventWeight());
2944  fhTrackMatchedDPhiNLocMax2[mcindex]->Fill(en, dR, GetEventWeight());
2945  }
2946  else if( nMax >= 3 )
2947  {
2948  fhTrackMatchedDEtaNLocMaxN[mcindex]->Fill(en, dZ, GetEventWeight());
2949  fhTrackMatchedDPhiNLocMaxN[mcindex]->Fill(en, dR, GetEventWeight());
2950  }
2951  }
2952 
2953  AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
2954 
2955  Bool_t positive = kFALSE;
2956  if(track) positive = (track->Charge()>0);
2957 
2958  if(track)
2959  {
2960  if(positive)
2961  {
2962  if ( nMax == 1 )
2963  {
2964  fhTrackMatchedDEtaNLocMax1Pos[0]->Fill(en, dZ, GetEventWeight());
2965  fhTrackMatchedDPhiNLocMax1Pos[0]->Fill(en, dR, GetEventWeight());
2966  }
2967  else if( nMax == 2 )
2968  {
2969  fhTrackMatchedDEtaNLocMax2Pos[0]->Fill(en, dZ, GetEventWeight());
2970  fhTrackMatchedDPhiNLocMax2Pos[0]->Fill(en, dR, GetEventWeight());
2971  }
2972  else if( nMax >= 3 )
2973  {
2974  fhTrackMatchedDEtaNLocMaxNPos[0]->Fill(en, dZ, GetEventWeight());
2975  fhTrackMatchedDPhiNLocMaxNPos[0]->Fill(en, dR, GetEventWeight());
2976  }
2977 
2978  if(IsDataMC() && mcindex > 0 && mcindex < 7)
2979  {
2980  if ( nMax == 1 )
2981  {
2982  fhTrackMatchedDEtaNLocMax1Pos[mcindex]->Fill(en, dZ, GetEventWeight());
2983  fhTrackMatchedDPhiNLocMax1Pos[mcindex]->Fill(en, dR, GetEventWeight());
2984  }
2985  else if( nMax == 2 )
2986  {
2987  fhTrackMatchedDEtaNLocMax2Pos[mcindex]->Fill(en, dZ, GetEventWeight());
2988  fhTrackMatchedDPhiNLocMax2Pos[mcindex]->Fill(en, dR, GetEventWeight());
2989  }
2990  else if( nMax >= 3 )
2991  {
2992  fhTrackMatchedDEtaNLocMaxNPos[mcindex]->Fill(en, dZ, GetEventWeight());
2993  fhTrackMatchedDPhiNLocMaxNPos[mcindex]->Fill(en, dR, GetEventWeight());
2994  }
2995  }
2996  }
2997  else
2998  {
2999  if ( nMax == 1 )
3000  {
3001  fhTrackMatchedDEtaNLocMax1Neg[0]->Fill(en, dZ, GetEventWeight());
3002  fhTrackMatchedDPhiNLocMax1Neg[0]->Fill(en, dR, GetEventWeight());
3003  }
3004  else if( nMax == 2 )
3005  {
3006  fhTrackMatchedDEtaNLocMax2Neg[0]->Fill(en, dZ, GetEventWeight());
3007  fhTrackMatchedDPhiNLocMax2Neg[0]->Fill(en, dR, GetEventWeight());
3008  }
3009  else if( nMax >= 3 )
3010  {
3011  fhTrackMatchedDEtaNLocMaxNNeg[0]->Fill(en, dZ, GetEventWeight());
3012  fhTrackMatchedDPhiNLocMaxNNeg[0]->Fill(en, dR, GetEventWeight());
3013  }
3014 
3015  if(IsDataMC() && mcindex > 0 && mcindex < 7)
3016  {
3017  if ( nMax == 1 )
3018  {
3019  fhTrackMatchedDEtaNLocMax1Neg[mcindex]->Fill(en, dZ, GetEventWeight());
3020  fhTrackMatchedDPhiNLocMax1Neg[mcindex]->Fill(en, dR, GetEventWeight());
3021  }
3022  else if( nMax == 2 )
3023  {
3024  fhTrackMatchedDEtaNLocMax2Neg[mcindex]->Fill(en, dZ, GetEventWeight());
3025  fhTrackMatchedDPhiNLocMax2Neg[mcindex]->Fill(en, dR, GetEventWeight());
3026  }
3027  else if( nMax >= 3 )
3028  {
3029  fhTrackMatchedDEtaNLocMaxNNeg[mcindex]->Fill(en, dZ, GetEventWeight());
3030  fhTrackMatchedDPhiNLocMaxNNeg[mcindex]->Fill(en, dR, GetEventWeight());
3031  }
3032  }
3033  }
3034  }// track exists
3035  }
3036 }
3037 
3038 //_______________________________________________________________
3040 //_______________________________________________________________
3042 {
3043  TString parList ; //this will be list of parameters used for this analysis.
3044  Int_t buffersize = 255;
3045  char onePar[buffersize] ;
3046 
3047  snprintf(onePar,buffersize,"--- AliAnaInsideClusterInvariantMass ---:") ;
3048  parList+=onePar ;
3049 
3050  snprintf(onePar,buffersize,"Calorimeter: %s;", GetCalorimeterString().Data()) ;
3051  parList+=onePar ;
3052  snprintf(onePar,buffersize,"fNLocMaxCutE =%2.2f;", GetCaloUtils()->GetLocalMaximaCutE()) ;
3053  parList+=onePar ;
3054  snprintf(onePar,buffersize,"fNLocMaxCutEDiff =%2.2f;",GetCaloUtils()->GetLocalMaximaCutEDiff()) ;
3055  parList+=onePar ;
3056  snprintf(onePar,buffersize,"fMinNCells =%d;", fMinNCells) ;
3057  parList+=onePar ;
3058  snprintf(onePar,buffersize,"fMinBadDist =%1.1f;", fMinBadDist) ;
3059  parList+=onePar ;
3060  if(fFillSSWeightHisto)
3061  {
3062  snprintf(onePar,buffersize," N w %d - N e cut %d;",fSSWeightN,fSSECellCutN);
3063  parList+=onePar ;
3064  }
3065 
3066  return new TObjString(parList) ;
3067 }
3068 
3069 //________________________________________________________________
3072 //________________________________________________________________
3074 {
3075  TList * outputContainer = new TList() ;
3076  outputContainer->SetName("InsideClusterHistos") ;
3077 
3078  Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
3080  Int_t mbins = GetHistogramRanges()->GetHistoMassBins(); Float_t mmax = GetHistogramRanges()->GetHistoMassMax(); Float_t mmin = GetHistogramRanges()->GetHistoMassMin();
3082  Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
3083  Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
3084 
3085  Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
3086  Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
3087  Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
3088  Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
3089  Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
3090  Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
3091 
3092  Bool_t m02On = GetCaloPID()->IsSplitShowerShapeCutOn();
3093  Bool_t asyOn = GetCaloPID()->IsSplitAsymmetryCutOn();
3094  Bool_t splitOn = kFALSE;
3095  if(GetCaloPID()->GetSplitEnergyFractionMinimum(0) > 0 ||
3096  GetCaloPID()->GetSplitEnergyFractionMinimum(1) > 0 ||
3097  GetCaloPID()->GetSplitEnergyFractionMinimum(2) > 0) splitOn = kTRUE;
3098 
3099  TString ptype[] ={"","#gamma","#gamma->e^{#pm}","#pi^{0}","#pi^{0} (#gamma->e^{#pm})","#eta", "hadron"};
3100  TString pname[] ={"","Photon","Conversion", "Pi0", "Pi0Conv", "Eta","Hadron"};
3101  TString snlm [] = {"1","2","N"};
3102 
3103  TString sEBin[] = {"8 < #it{E} < 12 GeV","12 < #it{E} < 16 GeV", "16 < #it{E} < 20 GeV", "#it{E} > 20 GeV" };
3104 
3105  Int_t n = 1;
3106 
3107  if(IsDataMC()) n = 7;
3108 
3109  Int_t nMaxBins = 10;
3110 
3111  TString sMatched[] = {"","Matched"};
3112 
3113  Int_t nMatched = 2;
3114  if(!fFillTMHisto) nMatched = 1;
3115 
3116 
3118  {
3119  for(Int_t imatch = 0; imatch < nMatched; imatch++)
3120  {
3121  for(Int_t iE = 0; iE < fNLMSettingN; iE++)
3122  {
3123  for(Int_t iDiff = 0; iDiff < fNLMSettingN; iDiff++)
3124  {
3125  fhNLocMaxDiffCut[iE][iDiff][imatch] = new TH2F(Form("hNLocMax_MinE%d_MinDiffE%d%s",iE, iDiff, sMatched[imatch].Data()),
3126  Form("NLM for #it{E}_{LM}>%1.2f, #Delta E=%1.2F %s", fNLMMinE[iE], fNLMMinDiff[iDiff],sMatched[imatch].Data()),
3127  nptbins,ptmin,ptmax, nMaxBins,0,nMaxBins);
3128  fhNLocMaxDiffCut[iE][iDiff][imatch]->SetYTitle("#it{NLM}");
3129  fhNLocMaxDiffCut[iE][iDiff][imatch]->SetXTitle("#it{E}_{cluster}");
3130  outputContainer->Add(fhNLocMaxDiffCut[iE][iDiff][imatch]) ;
3131 
3132  fhNLocMaxDiffCutPi0[iE][iDiff][imatch] = new TH2F(Form("hNLocMaxPi0_MinE%d_MinDiffE%d%s",iE, iDiff, sMatched[imatch].Data()),
3133  Form("#pi^{0} NLM for #it{E}_{LM}>%1.2f, #Delta E=%1.2F %s",
3134  fNLMMinE[iE], fNLMMinDiff[iDiff],sMatched[imatch].Data()),
3135  nptbins,ptmin,ptmax, nMaxBins,0,nMaxBins);
3136  fhNLocMaxDiffCutPi0[iE][iDiff][imatch]->SetYTitle("#it{NLM}");
3137  fhNLocMaxDiffCutPi0[iE][iDiff][imatch]->SetXTitle("#it{E}_{#pi^{0}}");
3138  outputContainer->Add(fhNLocMaxDiffCutPi0[iE][iDiff][imatch]) ;
3139 
3140  for(Int_t inlm = 0; inlm < 3; inlm++)
3141  {
3142 
3143  fhM02NLocMaxDiffCut[iE][iDiff][inlm][imatch] = new TH2F(Form("hNLocMaxM02_MinE%d_MinDiffE%d_NLM%s%s",
3144  iE, iDiff, snlm[inlm].Data(),sMatched[imatch].Data()),
3145  Form("#lambda^{2}_{0} for #it{E}_{LM}>%1.2f, #Delta E=%1.2F NLM %s %s",
3146  fNLMMinE[iE], fNLMMinDiff[iDiff],snlm[inlm].Data(), sMatched[imatch].Data()),
3147  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3148  fhM02NLocMaxDiffCut[iE][iDiff][inlm][imatch]->SetYTitle("#lambda^{2}_{0}");
3149  fhM02NLocMaxDiffCut[iE][iDiff][inlm][imatch]->SetXTitle("#it{E}_{cluster}");
3150  outputContainer->Add(fhM02NLocMaxDiffCut[iE][iDiff][inlm][imatch]) ;
3151 
3152  fhMassNLocMaxDiffCut[iE][iDiff][inlm][imatch] = new TH2F(Form("hNLocMaxMass_MinE%d_MinDiffE%d_NLM%s%s",
3153  iE, iDiff, snlm[inlm].Data(),sMatched[imatch].Data()),
3154  Form("#it{M}_{split} for #it{E}_{LM}>%1.2f, #Delta E=%1.2F NLM %s %s",
3155  fNLMMinE[iE], fNLMMinDiff[iDiff],snlm[inlm].Data(), sMatched[imatch].Data()),
3156  nptbins,ptmin,ptmax, mbins,mmin,mmax);
3157  fhMassNLocMaxDiffCut[iE][iDiff][inlm][imatch]->SetYTitle("#it{M}_{split}");
3158  fhMassNLocMaxDiffCut[iE][iDiff][inlm][imatch]->SetXTitle("#it{E}_{cluster}");
3159  outputContainer->Add(fhMassNLocMaxDiffCut[iE][iDiff][inlm][imatch]) ;
3160 
3161  fhM02NLocMaxDiffCutPi0[iE][iDiff][inlm][imatch] = new TH2F(Form("hNLocMaxPi0M02_MinE%d_MinDiffE%d_NLM%s%s",
3162  iE, iDiff, snlm[inlm].Data(),sMatched[imatch].Data()),
3163  Form("#pi^{0} #lambda^{2}_{0} for #it{E}_{LM}>%1.2f, #Delta E=%1.2F NLM %s %s",
3164  fNLMMinE[iE], fNLMMinDiff[iDiff],snlm[inlm].Data(), sMatched[imatch].Data()),
3165  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3166  fhM02NLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]->SetYTitle("#lambda^{2}_{0}");
3167  fhM02NLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]->SetXTitle("#it{E}_{cluster}");
3168  outputContainer->Add(fhM02NLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]) ;
3169 
3170  fhMassNLocMaxDiffCutPi0[iE][iDiff][inlm][imatch] = new TH2F(Form("hNLocMaxPi0Mass_MinE%d_MinDiffE%d_NLM%s%s",
3171  iE, iDiff, snlm[inlm].Data(),sMatched[imatch].Data()),
3172  Form("#pi^{0} #it{M}_{split} for #it{E}_{LM}>%1.2f, #Delta E=%1.2F NLM %s %s",
3173  fNLMMinE[iE], fNLMMinDiff[iDiff],snlm[inlm].Data(), sMatched[imatch].Data()),
3174  nptbins,ptmin,ptmax, mbins,mmin,mmax);
3175  fhMassNLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]->SetYTitle("#it{M}_{split}");
3176  fhMassNLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]->SetXTitle("#it{E}_{cluster}");
3177  outputContainer->Add(fhMassNLocMaxDiffCutPi0[iE][iDiff][inlm][imatch]) ;
3178 
3179  }
3180 
3181  }
3182  }
3183  }
3184  return outputContainer;
3185  }
3186 
3188  {
3189  for(Int_t inlm = 0; inlm < 3; inlm++)
3190  {
3191  fhMassBadDistClose[inlm] = new TH2F(Form("hMassBadDistCloseNLocMax%s",snlm[inlm].Data()),
3192  Form("Invariant mass of splitted cluster with #it{NLM}=%d vs E, 2nd LM close to bad channel",inlm),
3193  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3194  fhMassBadDistClose[inlm]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3195  fhMassBadDistClose[inlm]->SetXTitle("#it{E} (GeV)");
3196  outputContainer->Add(fhMassBadDistClose[inlm]) ;
3197 
3198  fhM02BadDistClose[inlm] = new TH2F(Form("hM02BadDistCloseNLocMax%s",snlm[inlm].Data()),
3199  Form("#lambda_{0}^{2} for cluster with #it{NLM}=%d vs E, 2nd LM close to bad channel",inlm),
3200  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3201  fhM02BadDistClose[inlm]->SetYTitle("#lambda_{0}^{2}");
3202  fhM02BadDistClose[inlm]->SetXTitle("#it{E} (GeV)");
3203  outputContainer->Add(fhM02BadDistClose[inlm]) ;
3204 
3205  fhMassOnBorder[inlm] = new TH2F(Form("hMassOnBorderNLocMax%s",snlm[inlm].Data()),
3206  Form("Invariant mass of splitted cluster with #it{NLM}=%d vs E, 2nd LM close to border",inlm),
3207  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3208  fhMassOnBorder[inlm]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3209  fhMassOnBorder[inlm]->SetXTitle("#it{E} (GeV)");
3210  outputContainer->Add(fhMassOnBorder[inlm]) ;
3211 
3212  fhM02OnBorder[inlm] = new TH2F(Form("hM02OnBorderNLocMax%s",snlm[inlm].Data()),
3213  Form("#lambda_{0}^{2} for cluster with #it{NLM}=%d vs E, 2nd LM close to border",inlm),
3214  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3215  fhM02OnBorder[inlm]->SetYTitle("#lambda_{0}^{2}");
3216  fhM02OnBorder[inlm]->SetXTitle("#it{E} (GeV)");
3217  outputContainer->Add(fhM02OnBorder[inlm]) ;
3218  }
3219  }
3220 
3221  for(Int_t i = 0; i < n; i++)
3222  {
3223  for(Int_t j = 0; j < nMatched; j++)
3224  {
3225 
3226  fhNLocMax[i][j] = new TH2F(Form("hNLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
3227  Form("Number of local maxima in cluster %s %s",ptype[i].Data(),sMatched[j].Data()),
3228  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3229  fhNLocMax[i][j] ->SetYTitle("#it{N} maxima");
3230  fhNLocMax[i][j] ->SetXTitle("#it{E} (GeV)");
3231  outputContainer->Add(fhNLocMax[i][j]) ;
3232 
3233  fhLM1NLocMax[i][j] = new TH2F(Form("hLM1NLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
3234  Form("Number of local maxima in cluster for split cluster 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3235  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3236  fhLM1NLocMax[i][j] ->SetYTitle("#it{N} maxima");
3237  fhLM1NLocMax[i][j] ->SetXTitle("#it{E} (GeV)");
3238  outputContainer->Add(fhLM1NLocMax[i][j]) ;
3239 
3240  fhLM2NLocMax[i][j] = new TH2F(Form("hLM2NLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
3241  Form("Number of local maxima in cluster for split cluster 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3242  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3243  fhLM2NLocMax[i][j] ->SetYTitle("#it{N} maxima");
3244  fhLM2NLocMax[i][j] ->SetXTitle("#it{E} (GeV)");
3245  outputContainer->Add(fhLM2NLocMax[i][j]) ;
3246 
3247  if(m02On)
3248  {
3249  fhNLocMaxM02Cut[i][j] = new TH2F(Form("hNLocMaxM02Cut%s%s",pname[i].Data(),sMatched[j].Data()),
3250  Form("Number of local maxima in cluster %s %s, M02 cut",ptype[i].Data(),sMatched[j].Data()),
3251  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3252  fhNLocMaxM02Cut[i][j]->SetYTitle("#it{N} maxima");
3253  fhNLocMaxM02Cut[i][j]->SetXTitle("#it{E} (GeV)");
3254  outputContainer->Add(fhNLocMaxM02Cut[i][j]) ;
3255 
3256  fhLM1NLocMaxM02Cut[i][j] = new TH2F(Form("hLM1NLocMaxM02Cut%s%s",pname[i].Data(),sMatched[j].Data()),
3257  Form("Number of local maxima in cluster for split cluster 1 %s %s, M02 cut",ptype[i].Data(),sMatched[j].Data()),
3258  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3259  fhLM1NLocMaxM02Cut[i][j] ->SetYTitle("#it{N} maxima");
3260  fhLM1NLocMaxM02Cut[i][j] ->SetXTitle("#it{E} (GeV)");
3261  outputContainer->Add(fhLM1NLocMaxM02Cut[i][j]) ;
3262 
3263  fhLM2NLocMaxM02Cut[i][j] = new TH2F(Form("hLM2NLocMaxM02Cut%s%s",pname[i].Data(),sMatched[j].Data()),
3264  Form("Number of local maxima in cluster for split cluster 2 %s %s, M02 cut",ptype[i].Data(),sMatched[j].Data()),
3265  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3266  fhLM2NLocMaxM02Cut[i][j] ->SetYTitle("#it{N} maxima");
3267  fhLM2NLocMaxM02Cut[i][j] ->SetXTitle("#it{E} (GeV)");
3268  outputContainer->Add(fhLM2NLocMaxM02Cut[i][j]) ;
3269  }
3270 
3271  fhNLocMaxIdPi0[i][j] = new TH2F(Form("hNLocMaxIdPi0%s%s",pname[i].Data(),sMatched[j].Data()),
3272  Form("Number of local maxima in pi0 ID cluster %s %s",ptype[i].Data(),sMatched[j].Data()),
3273  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3274  fhNLocMaxIdPi0[i][j] ->SetYTitle("#it{N} maxima");
3275  fhNLocMaxIdPi0[i][j] ->SetXTitle("#it{E} (GeV)");
3276  outputContainer->Add(fhNLocMaxIdPi0[i][j]) ;
3277 
3278 
3279  fhLM1NLocMaxIdPi0[i][j] = new TH2F(Form("hLM1NLocMaxIdPi0%s%s",pname[i].Data(),sMatched[j].Data()),
3280  Form("Number of local maxima in cluster for split cluster 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3281  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3282  fhLM1NLocMaxIdPi0[i][j] ->SetYTitle("#it{N} maxima");
3283  fhLM1NLocMaxIdPi0[i][j] ->SetXTitle("#it{E} (GeV)");
3284  outputContainer->Add(fhLM1NLocMaxIdPi0[i][j]) ;
3285 
3286  fhLM2NLocMaxIdPi0[i][j] = new TH2F(Form("hLM2NLocMaxIdPi0%s%s",pname[i].Data(),sMatched[j].Data()),
3287  Form("Number of local maxima in cluster for split cluster 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3288  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3289  fhLM2NLocMaxIdPi0[i][j] ->SetYTitle("#it{N} maxima");
3290  fhLM2NLocMaxIdPi0[i][j] ->SetXTitle("#it{E} (GeV)");
3291  outputContainer->Add(fhLM2NLocMaxIdPi0[i][j]) ;
3292 
3293 
3294  fhSplitClusterENLocMax[i][j] = new TH2F(Form("hSplitEClusterNLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
3295  Form("Number of local maxima vs E of split clusters %s %s",ptype[i].Data(),sMatched[j].Data()),
3296  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3297  fhSplitClusterENLocMax[i][j] ->SetYTitle("#it{N} maxima");
3298  fhSplitClusterENLocMax[i][j] ->SetXTitle("#it{E} (GeV)");
3299  outputContainer->Add(fhSplitClusterENLocMax[i][j]) ;
3300 
3301 
3302  fhSplitClusterEPi0NLocMax[i][j] = new TH2F(Form("hSplitEClusterPi0NLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
3303  Form("Number of local maxima vs E of split clusters, id as pi0, %s %s",ptype[i].Data(),sMatched[j].Data()),
3304  nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins);
3305  fhSplitClusterEPi0NLocMax[i][j] ->SetYTitle("#it{N} maxima");
3306  fhSplitClusterEPi0NLocMax[i][j] ->SetXTitle("#it{E} (GeV)");
3307  outputContainer->Add(fhSplitClusterEPi0NLocMax[i][j]) ;
3308 
3309  if(fFillNCellHisto)
3310  {
3311  fhNCellNLocMax1[i][j] = new TH2F(Form("hNCellNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3312  Form("n cells vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3313  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
3314  fhNCellNLocMax1[i][j] ->SetYTitle("#it{N} cells");
3315  fhNCellNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3316  outputContainer->Add(fhNCellNLocMax1[i][j]) ;
3317 
3318  fhNCellNLocMax2[i][j] = new TH2F(Form("hNCellNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3319  Form("n cells vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3320  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
3321  fhNCellNLocMax2[i][j] ->SetYTitle("#it{N} cells");
3322  fhNCellNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3323  outputContainer->Add(fhNCellNLocMax2[i][j]) ;
3324 
3325 
3326  fhNCellNLocMaxN[i][j] = new TH2F(Form("hNCellNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3327  Form("n cells vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3328  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
3329  fhNCellNLocMaxN[i][j] ->SetYTitle("#it{N} cells");
3330  fhNCellNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3331  outputContainer->Add(fhNCellNLocMaxN[i][j]) ;
3332  }
3333 
3334  fhMassNLocMax1[i][j] = new TH2F(Form("hMassNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3335  Form("Invariant mass of splitted cluster with #it{NLM}=1 vs E, %s %s",ptype[i].Data(),sMatched[j].Data()),
3336  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3337  fhMassNLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3338  fhMassNLocMax1[i][j]->SetXTitle("#it{E} (GeV)");
3339  outputContainer->Add(fhMassNLocMax1[i][j]) ;
3340 
3341  fhMassNLocMax2[i][j] = new TH2F(Form("hMassNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3342  Form("Invariant mass of splitted cluster with #it{NLM}=2 vs E, %s %s",ptype[i].Data(),sMatched[j].Data()),
3343  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3344  fhMassNLocMax2[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3345  fhMassNLocMax2[i][j]->SetXTitle("#it{E} (GeV)");
3346  outputContainer->Add(fhMassNLocMax2[i][j]) ;
3347 
3348  fhMassNLocMaxN[i][j] = new TH2F(Form("hMassNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3349  Form("Invariant mass of splitted cluster with NLM>2 vs E, %s %s",ptype[i].Data(),sMatched[j].Data()),
3350  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3351  fhMassNLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3352  fhMassNLocMaxN[i][j]->SetXTitle("#it{E} (GeV)");
3353  outputContainer->Add(fhMassNLocMaxN[i][j]) ;
3354 
3355  fhMassSplitENLocMax1[i][j] = new TH2F(Form("hMassSplitENLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3356  Form("Invariant mass of splitted cluster with #it{NLM}=1 vs #it{E}_{1}+#it{E}_{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3357  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3358  fhMassSplitENLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3359  fhMassSplitENLocMax1[i][j]->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3360  outputContainer->Add(fhMassSplitENLocMax1[i][j]) ;
3361 
3362  fhMassSplitENLocMax2[i][j] = new TH2F(Form("hMassSplitENLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3363  Form("Invariant mass of splitted cluster with #it{NLM}=2 vs #it{E}_{1}+#it{E}_{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3364  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3365  fhMassSplitENLocMax2[i][j]->SetYTitle("#it{E} _{M} (GeV/#it{c}^{2})");
3366  fhMassSplitENLocMax2[i][j]->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3367  outputContainer->Add(fhMassSplitENLocMax2[i][j]) ;
3368 
3369  fhMassSplitENLocMaxN[i][j] = new TH2F(Form("hMassSplitENLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3370  Form("Invariant mass of splitted cluster with NLM>2 vs #it{E}_{1}+#it{E}_{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3371  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3372  fhMassSplitENLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3373  fhMassSplitENLocMaxN[i][j]->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3374  outputContainer->Add(fhMassSplitENLocMaxN[i][j]) ;
3375 
3376  fhM02NLocMax1[i][j] = new TH2F(Form("hM02NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3377  Form("#lambda_{0}^{2} vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3378  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3379  fhM02NLocMax1[i][j] ->SetYTitle("#lambda_{0}^{2}");
3380  fhM02NLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3381  outputContainer->Add(fhM02NLocMax1[i][j]) ;
3382 
3383  fhM02NLocMax2[i][j] = new TH2F(Form("hM02NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3384  Form("#lambda_{0}^{2} vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3385  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3386  fhM02NLocMax2[i][j] ->SetYTitle("#lambda_{0}^{2}");
3387  fhM02NLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3388  outputContainer->Add(fhM02NLocMax2[i][j]) ;
3389 
3390  fhM02NLocMaxN[i][j] = new TH2F(Form("hM02NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3391  Form("#lambda_{0}^{2} vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3392  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3393  fhM02NLocMaxN[i][j] ->SetYTitle("#lambda_{0}^{2}");
3394  fhM02NLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3395  outputContainer->Add(fhM02NLocMaxN[i][j]) ;
3396 
3397  fhAsymNLocMax1[i][j] = new TH2F(Form("hAsymNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3398  Form("Asymmetry of #it{NLM}=1 vs cluster Energy, %s %s",ptype[i].Data(),sMatched[j].Data()),
3399  nptbins,ptmin,ptmax,200,-1,1);
3400  fhAsymNLocMax1[i][j]->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3401  fhAsymNLocMax1[i][j]->SetXTitle("#it{E} (GeV)");
3402  outputContainer->Add(fhAsymNLocMax1[i][j]) ;
3403 
3404  fhAsymNLocMax2[i][j] = new TH2F(Form("hAsymNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3405  Form("Asymmetry of #it{NLM}=2 vs cluster Energy, %s %s",ptype[i].Data(),sMatched[j].Data()),
3406  nptbins,ptmin,ptmax,200,-1,1);
3407  fhAsymNLocMax2[i][j]->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3408  fhAsymNLocMax2[i][j]->SetXTitle("#it{E} (GeV)");
3409  outputContainer->Add(fhAsymNLocMax2[i][j]) ;
3410 
3411  fhAsymNLocMaxN[i][j] = new TH2F(Form("hAsymNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3412  Form("Asymmetry of NLM>2 vs cluster Energy, %s %s",ptype[i].Data(),sMatched[j].Data()),
3413  nptbins,ptmin,ptmax,200,-1,1);
3414  fhAsymNLocMaxN[i][j]->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3415  fhAsymNLocMaxN[i][j]->SetXTitle("#it{E} (GeV)");
3416  outputContainer->Add(fhAsymNLocMaxN[i][j]) ;
3417 
3418  fhSplitEFractionNLocMax1[i][j] = new TH2F(Form("hSplitEFractionNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3419  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3420  nptbins,ptmin,ptmax,120,0,1.2);
3421  fhSplitEFractionNLocMax1[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3422  fhSplitEFractionNLocMax1[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3423  outputContainer->Add(fhSplitEFractionNLocMax1[i][j]) ;
3424 
3425  fhSplitEFractionNLocMax2[i][j] = new TH2F(Form("hSplitEFractionNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3426  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3427  nptbins,ptmin,ptmax,120,0,1.2);
3428  fhSplitEFractionNLocMax2[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3429  fhSplitEFractionNLocMax2[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3430  outputContainer->Add(fhSplitEFractionNLocMax2[i][j]) ;
3431 
3432  fhSplitEFractionNLocMaxN[i][j] = new TH2F(Form("hSplitEFractionNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3433  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3434  nptbins,ptmin,ptmax,120,0,1.2);
3435  fhSplitEFractionNLocMaxN[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3436  fhSplitEFractionNLocMaxN[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3437  outputContainer->Add(fhSplitEFractionNLocMaxN[i][j]) ;
3438 
3439  if(i==0 && j==0 )
3440  {
3441  if(m02On)
3442  {
3443  fhMassM02CutNLocMax1 = new TH2F("hMassM02CutNLocMax1","Invariant mass of splitted cluster with #it{NLM}=1 vs E, M02 cut, no TM",
3444  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3445  fhMassM02CutNLocMax1->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3446  fhMassM02CutNLocMax1->SetXTitle("#it{E} (GeV)");
3447  outputContainer->Add(fhMassM02CutNLocMax1) ;
3448 
3449  fhMassM02CutNLocMax2 = new TH2F("hMassM02CutNLocMax2","Invariant mass of splitted cluster with #it{NLM}=2 vs E, M02 cut, no TM",
3450  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3451  fhMassM02CutNLocMax2->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3452  fhMassM02CutNLocMax2->SetXTitle("#it{E} (GeV)");
3453  outputContainer->Add(fhMassM02CutNLocMax2) ;
3454 
3455  fhMassM02CutNLocMaxN = new TH2F("hMassM02CutNLocMaxN","Invariant mass of splitted cluster with NLM>2 vs E, M02 cut, no TM",
3456  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3457  fhMassM02CutNLocMaxN->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3458  fhMassM02CutNLocMaxN->SetXTitle("#it{E} (GeV)");
3459  outputContainer->Add(fhMassM02CutNLocMaxN) ;
3460 
3461  fhAsymM02CutNLocMax1 = new TH2F("hAsymM02CutNLocMax1","Asymmetry of #it{NLM}=1 vs cluster Energy, M02Cut, no TM", nptbins,ptmin,ptmax,200,-1,1);
3462  fhAsymM02CutNLocMax1->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3463  fhAsymM02CutNLocMax1->SetXTitle("#it{E} (GeV)");
3464  outputContainer->Add(fhAsymM02CutNLocMax1) ;
3465 
3466  fhAsymM02CutNLocMax2 = new TH2F("hAsymM02CutNLocMax2","Asymmetry of #it{NLM}=2 vs cluster Energy, M02Cut, no TM", nptbins,ptmin,ptmax,200,-1,1);
3467  fhAsymM02CutNLocMax2->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3468  fhAsymM02CutNLocMax2->SetXTitle("#it{E} (GeV)");
3469  outputContainer->Add(fhAsymM02CutNLocMax2) ;
3470 
3471  fhAsymM02CutNLocMaxN = new TH2F("hAsymM02CutNLocMaxN","Asymmetry of NLM>2 vs cluster Energy, M02Cut, no TM", nptbins,ptmin,ptmax,200,-1,1);
3472  fhAsymM02CutNLocMaxN->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3473  fhAsymM02CutNLocMaxN->SetXTitle("#it{E} (GeV)");
3474  outputContainer->Add(fhAsymM02CutNLocMaxN) ;
3475 
3476  if(splitOn)
3477  {
3478  fhMassSplitECutNLocMax1 = new TH2F("hMassSplitECutNLocMax1","Invariant mass of splitted cluster with #it{NLM}=1 vs E, (#it{E}_{1}+#it{E}_{2})/E cut, M02 cut, no TM",
3479  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3480  fhMassSplitECutNLocMax1->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3481  fhMassSplitECutNLocMax1->SetXTitle("#it{E} (GeV)");
3482  outputContainer->Add(fhMassSplitECutNLocMax1) ;
3483 
3484  fhMassSplitECutNLocMax2 = new TH2F("hMassSplitECutNLocMax2","Invariant mass of splitted cluster with #it{NLM}=2 vs E, (#it{E}_{1}+#it{E}_{2})/E cut, M02 cut, no TM",
3485  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3486  fhMassSplitECutNLocMax2->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3487  fhMassSplitECutNLocMax2->SetXTitle("#it{E} (GeV)");
3488  outputContainer->Add(fhMassSplitECutNLocMax2) ;
3489 
3490  fhMassSplitECutNLocMaxN = new TH2F("hMassSplitECutNLocMaxN","Invariant mass of splitted cluster with NLM>2 vs E, (#it{E}_{1}+#it{E}_{2})/E cut, M02 cut, no TM",
3491  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3492  fhMassSplitECutNLocMaxN->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3493  fhMassSplitECutNLocMaxN->SetXTitle("#it{E} (GeV)");
3494  outputContainer->Add(fhMassSplitECutNLocMaxN) ;
3495  }
3496  }//m02on
3497 
3498  if(asyOn)
3499  {
3500  fhMassAsyCutNLocMax1 = new TH2F("hMassAsyCutNLocMax1","Invariant mass of splitted cluster with #it{NLM}=1 vs E, Asy cut, no TM",
3501  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3502  fhMassAsyCutNLocMax1->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3503  fhMassAsyCutNLocMax1->SetXTitle("#it{E} (GeV)");
3504  outputContainer->Add(fhMassAsyCutNLocMax1) ;
3505 
3506  fhMassAsyCutNLocMax2 = new TH2F("hMassAsyCutNLocMax2","Invariant mass of splitted cluster with #it{NLM}=2 vs E, Asy cut, no TM",
3507  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3508  fhMassAsyCutNLocMax2->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3509  fhMassAsyCutNLocMax2->SetXTitle("#it{E} (GeV)");
3510  outputContainer->Add(fhMassAsyCutNLocMax2) ;
3511 
3512  fhMassAsyCutNLocMaxN = new TH2F("hMassAsyCutNLocMaxN","Invariant mass of splitted cluster with NLM>2 vs E, Asy cut, no TM",
3513  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3514  fhMassAsyCutNLocMaxN->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3515  fhMassAsyCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3516  outputContainer->Add(fhMassAsyCutNLocMaxN) ;
3517 
3518  fhM02AsyCutNLocMax1 = new TH2F("hM02AsyCutNLocMax1","#lambda_{0}^{2} of #it{NLM}=1 vs cluster Energy, AsyCut, no TM",
3519  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3520  fhM02AsyCutNLocMax1->SetYTitle("#lambda_{0}^{2}");
3521  fhM02AsyCutNLocMax1->SetXTitle("#it{E} (GeV)");
3522  outputContainer->Add(fhM02AsyCutNLocMax1) ;
3523 
3524  fhM02AsyCutNLocMax2 = new TH2F("hM02AsyCutNLocMax2","#lambda_{0}^{2} of #it{NLM}=2 vs cluster Energy, AsyCut, no TM",
3525  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3526  fhM02AsyCutNLocMax2->SetYTitle("#lambda_{0}^{2}");
3527  fhM02AsyCutNLocMax2->SetXTitle("#it{E} (GeV)");
3528  outputContainer->Add(fhM02AsyCutNLocMax2) ;
3529 
3530  fhM02AsyCutNLocMaxN = new TH2F("hM02AsyCutNLocMaxN","#lambda_{0}^{2} of NLM>2 vs cluster Energy, AsyCut, no TM",
3531  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3532  fhM02AsyCutNLocMaxN->SetYTitle("#lambda_{0}^{2}");
3533  fhM02AsyCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3534  outputContainer->Add(fhM02AsyCutNLocMaxN) ;
3535  }
3536 
3537  if(GetCaloPID()->GetSubClusterEnergyMinimum(0) > 0.1)
3538  {
3539  fhMassEnCutNLocMax1 = new TH2F("hMassEnCutNLocMax1",Form("Invariant mass of splitted cluster with #it{NLM}=1 vs E, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(0)),
3540  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3541  fhMassEnCutNLocMax1->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3542  fhMassEnCutNLocMax1->SetXTitle("#it{E} (GeV)");
3543  outputContainer->Add(fhMassEnCutNLocMax1) ;
3544 
3545  fhMassEnCutNLocMax2 = new TH2F("hMassEnCutNLocMax2",Form("Invariant mass of splitted cluster with #it{NLM}=2 vs E, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(1)),
3546  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3547  fhMassEnCutNLocMax2->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3548  fhMassEnCutNLocMax2->SetXTitle("#it{E} (GeV)");
3549  outputContainer->Add(fhMassEnCutNLocMax2) ;
3550 
3551  fhMassEnCutNLocMaxN = new TH2F("hMassEnCutNLocMaxN",Form("Invariant mass of splitted cluster with NLM>2 vs E, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(2)),
3552  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3553  fhMassEnCutNLocMaxN->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3554  fhMassEnCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3555  outputContainer->Add(fhMassEnCutNLocMaxN) ;
3556 
3557  fhM02EnCutNLocMax1 = new TH2F("hM02EnCutNLocMax1",Form("#lambda_{0}^{2} of #it{NLM}=1 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(0)),
3558  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3559  fhM02EnCutNLocMax1->SetYTitle("#lambda_{0}^{2}");
3560  fhM02EnCutNLocMax1->SetXTitle("#it{E} (GeV)");
3561  outputContainer->Add(fhM02EnCutNLocMax1) ;
3562 
3563  fhM02EnCutNLocMax2 = new TH2F("hM02EnCutNLocMax2",Form("#lambda_{0}^{2} of #it{NLM}=2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(1)),
3564  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3565  fhM02EnCutNLocMax2->SetYTitle("#lambda_{0}^{2}");
3566  fhM02EnCutNLocMax2->SetXTitle("#it{E} (GeV)");
3567  outputContainer->Add(fhM02EnCutNLocMax2) ;
3568 
3569  fhM02EnCutNLocMaxN = new TH2F("hM02EnCutNLocMaxN",Form("#lambda_{0}^{2} of NLM>2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(2)),
3570  nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3571  fhM02EnCutNLocMaxN->SetYTitle("#lambda_{0}^{2}");
3572  fhM02EnCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3573  outputContainer->Add(fhM02EnCutNLocMaxN) ;
3574 
3575  fhAsymEnCutNLocMax1 = new TH2F("hAsymEnCutNLocMax1",Form("Asymmetry of #it{NLM}=1 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(0))
3576  , nptbins,ptmin,ptmax,200,-1,1);
3577  fhAsymEnCutNLocMax1->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3578  fhAsymEnCutNLocMax1->SetXTitle("#it{E} (GeV)");
3579  outputContainer->Add(fhAsymEnCutNLocMax1) ;
3580 
3581  fhAsymEnCutNLocMax2 = new TH2F("hAsymEnCutNLocMax2",Form("Asymmetry of #it{NLM}=2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(1))
3582  , nptbins,ptmin,ptmax,200,-1,1);
3583  fhAsymEnCutNLocMax2->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3584  fhAsymEnCutNLocMax2->SetXTitle("#it{E} (GeV)");
3585  outputContainer->Add(fhAsymEnCutNLocMax2) ;
3586 
3587  fhAsymEnCutNLocMaxN = new TH2F("hAsymEnCutNLocMaxN",Form("Asymmetry of NLM>2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(2))
3588  , nptbins,ptmin,ptmax,200,-1,1);
3589  fhAsymEnCutNLocMaxN->SetYTitle("(#it{E}_{1}-#it{E}_{2})/(#it{E}_{1}+#it{E}_{2})");
3590  fhAsymEnCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3591  outputContainer->Add(fhAsymEnCutNLocMaxN) ;
3592 
3593  fhSplitEFracEnCutNLocMax1 = new TH2F("hSplitEFracEnCutNLocMax1",Form("SplitEFracmetry of #it{NLM}=1 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(0))
3594  , nptbins,ptmin,ptmax,120,0,1.2);
3595  fhSplitEFracEnCutNLocMax1->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3596  fhSplitEFracEnCutNLocMax1->SetXTitle("#it{E} (GeV)");
3597  outputContainer->Add(fhSplitEFracEnCutNLocMax1) ;
3598 
3599  fhSplitEFracEnCutNLocMax2 = new TH2F("hSplitEFracEnCutNLocMax2",Form("SplitEFracmetry of #it{NLM}=2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(1))
3600  , nptbins,ptmin,ptmax,120,0,1.2);
3601  fhSplitEFracEnCutNLocMax2->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3602  fhSplitEFracEnCutNLocMax2->SetXTitle("#it{E} (GeV)");
3603  outputContainer->Add(fhSplitEFracEnCutNLocMax2) ;
3604 
3605  fhSplitEFracEnCutNLocMaxN = new TH2F("hSplitEFracEnCutNLocMaxN",Form("SplitEFracmetry of NLM>2 vs cluster Energy, E > %1.1f GeV, no TM",GetCaloPID()->GetSubClusterEnergyMinimum(2))
3606  , nptbins,ptmin,ptmax,120,0,1.2);
3607  fhSplitEFracEnCutNLocMaxN->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3608  fhSplitEFracEnCutNLocMaxN->SetXTitle("#it{E} (GeV)");
3609  outputContainer->Add(fhSplitEFracEnCutNLocMaxN) ;
3610  }
3611  } // no MC
3612 
3613  if(asyOn || m02On )
3614  {
3615  fhMassAfterCutsNLocMax1[i][j] = new TH2F(Form("hMassAfterCutsNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3616  Form("Mass vs E, %s %s, for NLM = 1, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3617  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3618  fhMassAfterCutsNLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3619  fhMassAfterCutsNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3620  outputContainer->Add(fhMassAfterCutsNLocMax1[i][j]) ;
3621 
3622  fhMassAfterCutsNLocMax2[i][j] = new TH2F(Form("hMassAfterCutsNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3623  Form("Mass vs E, %s %s, for NLM = 2, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3624  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3625  fhMassAfterCutsNLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3626  fhMassAfterCutsNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3627  outputContainer->Add(fhMassAfterCutsNLocMax2[i][j]) ;
3628 
3629  fhMassAfterCutsNLocMaxN[i][j] = new TH2F(Form("hMassAfterCutsNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3630  Form("Mass vs E, %s %s, for NLM > 2, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3631  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3632  fhMassAfterCutsNLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3633  fhMassAfterCutsNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3634  outputContainer->Add(fhMassAfterCutsNLocMaxN[i][j]) ;
3635 
3636  fhMassSplitEAfterCutsNLocMax1[i][j] = new TH2F(Form("hMassSplitEAfterCutsNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3637  Form("Mass vs #it{E}_{1}+#it{E}_{2}, %s %s, for NLM = 1, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3638  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3639  fhMassSplitEAfterCutsNLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3640  fhMassSplitEAfterCutsNLocMax1[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3641  outputContainer->Add(fhMassSplitEAfterCutsNLocMax1[i][j]) ;
3642 
3643  fhMassSplitEAfterCutsNLocMax2[i][j] = new TH2F(Form("hMassSplitEAfterCutsNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3644  Form("Mass vs #it{E}_{1}+#it{E}_{2}, %s %s, for NLM = 2, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3645  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3646  fhMassSplitEAfterCutsNLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3647  fhMassSplitEAfterCutsNLocMax2[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3648  outputContainer->Add(fhMassSplitEAfterCutsNLocMax2[i][j]) ;
3649 
3650  fhMassSplitEAfterCutsNLocMaxN[i][j] = new TH2F(Form("hMassSplitEAfterCutsNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3651  Form("Mass vs #it{E}_{1}+#it{E}_{2}, %s %s, for NLM > 2, M02 and asy cut",ptype[i].Data(),sMatched[j].Data()),
3652  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3653  fhMassSplitEAfterCutsNLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3654  fhMassSplitEAfterCutsNLocMaxN[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3655  outputContainer->Add(fhMassSplitEAfterCutsNLocMaxN[i][j]) ;
3656 
3657 
3658  fhSplitEFractionAfterCutsNLocMax1[i][j] = new TH2F(Form("hSplitEFractionAfterCutsNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3659  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max = 1, M02 and Asy cut on, %s %s",ptype[i].Data(),sMatched[j].Data()),
3660  nptbins,ptmin,ptmax,120,0,1.2);
3661  fhSplitEFractionAfterCutsNLocMax1[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3662  fhSplitEFractionAfterCutsNLocMax1[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3663  outputContainer->Add(fhSplitEFractionAfterCutsNLocMax1[i][j]) ;
3664 
3665  fhSplitEFractionAfterCutsNLocMax2[i][j] = new TH2F(Form("hSplitEFractionAfterCutsNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3666  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max = 2, M02 and Asy cut on, %s %s",ptype[i].Data(),sMatched[j].Data()),
3667  nptbins,ptmin,ptmax,120,0,1.2);
3668  fhSplitEFractionAfterCutsNLocMax2[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3669  fhSplitEFractionAfterCutsNLocMax2[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3670  outputContainer->Add(fhSplitEFractionAfterCutsNLocMax2[i][j]) ;
3671 
3672  fhSplitEFractionAfterCutsNLocMaxN[i][j] = new TH2F(Form("hSplitEFractionAfterCutsNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3673  Form("(#it{E}_{1}+#it{E}_{2})/#it{E}_{cluster} vs #it{E}_{cluster} for N max > 2, M02 and Asy cut on, %s %s",ptype[i].Data(),sMatched[j].Data()),
3674  nptbins,ptmin,ptmax,120,0,1.2);
3675  fhSplitEFractionAfterCutsNLocMaxN[i][j] ->SetXTitle("#it{E}_{cluster} (GeV)");
3676  fhSplitEFractionAfterCutsNLocMaxN[i][j] ->SetYTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
3677  outputContainer->Add(fhSplitEFractionAfterCutsNLocMaxN[i][j]) ;
3678  }
3679 
3680  fhMassM02NLocMax1[i][j] = new TH2F(Form("hMassM02NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3681  Form("Invariant mass of splitted cluster with #it{NLM}=1, #lambda_{0}^{2}, E > 12 GeV,%s %s",ptype[i].Data(),sMatched[j].Data()),
3682  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3683  fhMassM02NLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3684  fhMassM02NLocMax1[i][j]->SetXTitle("#lambda_{0}^{2}");
3685  outputContainer->Add(fhMassM02NLocMax1[i][j]) ;
3686 
3687  fhMassM02NLocMax2[i][j] = new TH2F(Form("hMassM02NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3688  Form("Invariant mass of splitted cluster with #it{NLM}=2, #lambda_{0}^{2}, E > 12 GeV, %s %s",ptype[i].Data(),sMatched[j].Data()),
3689  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3690  fhMassM02NLocMax2[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3691  fhMassM02NLocMax2[i][j]->SetXTitle("#lambda_{0}^{2}");
3692  outputContainer->Add(fhMassM02NLocMax2[i][j]) ;
3693 
3694  fhMassM02NLocMaxN[i][j] = new TH2F(Form("hMassM02NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3695  Form("Invariant mass of splitted cluster with NLM>2, vs #lambda_{0}^{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3696  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3697  fhMassM02NLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3698  fhMassM02NLocMaxN[i][j]->SetXTitle("#lambda_{0}^{2}");
3699  outputContainer->Add(fhMassM02NLocMaxN[i][j]) ;
3700 
3701  if(fFillSSExtraHisto)
3702  {
3703  fhMassDispEtaNLocMax1[i][j] = new TH2F(Form("hMassDispEtaNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3704  Form("Invariant mass of splitted cluster with #it{NLM}=1, #sigma_{#eta #eta}^{2}, E > 12 GeV,%s %s",ptype[i].Data(),sMatched[j].Data()),
3705  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3706  fhMassDispEtaNLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3707  fhMassDispEtaNLocMax1[i][j]->SetXTitle("#sigma_{#eta #eta}^{2}");
3708  outputContainer->Add(fhMassDispEtaNLocMax1[i][j]) ;
3709 
3710  fhMassDispEtaNLocMax2[i][j] = new TH2F(Form("hMassDispEtaNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3711  Form("Invariant mass of splitted cluster with #it{NLM}=2 #sigma_{#eta #eta}^{2}, E > 12 GeV, %s %s",ptype[i].Data(),sMatched[j].Data()),
3712  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3713  fhMassDispEtaNLocMax2[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3714  fhMassDispEtaNLocMax2[i][j]->SetXTitle("#sigma_{#eta #eta}^{2}");
3715  outputContainer->Add(fhMassDispEtaNLocMax2[i][j]) ;
3716 
3717  fhMassDispEtaNLocMaxN[i][j] = new TH2F(Form("hMassDispEtaNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3718  Form("Invariant mass of splitted cluster with NLM>2, #sigma_{#eta #eta}^{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3719  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3720  fhMassDispEtaNLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3721  fhMassDispEtaNLocMaxN[i][j]->SetXTitle("#sigma_{#eta #eta}^{2}");
3722  outputContainer->Add(fhMassDispEtaNLocMaxN[i][j]) ;
3723 
3724  fhMassDispPhiNLocMax1[i][j] = new TH2F(Form("hMassDispPhiNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3725  Form("Invariant mass of 2 highest energy cells #sigma_{#phi #phi}^{2}, E > 12 GeV,%s %s",ptype[i].Data(),sMatched[j].Data()),
3726  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3727  fhMassDispPhiNLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3728  fhMassDispPhiNLocMax1[i][j]->SetXTitle("#sigma_{#phi #phi}^{2}");
3729  outputContainer->Add(fhMassDispPhiNLocMax1[i][j]) ;
3730 
3731  fhMassDispPhiNLocMax2[i][j] = new TH2F(Form("hMassDispPhiNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3732  Form("Invariant mass of 2 local maxima cells #sigma_{#phi #phi}^{2}, E > 12 GeV, %s %s",ptype[i].Data(),sMatched[j].Data()),
3733  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3734  fhMassDispPhiNLocMax2[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3735  fhMassDispPhiNLocMax2[i][j]->SetXTitle("#sigma_{#phi #phi}^{2}");
3736  outputContainer->Add(fhMassDispPhiNLocMax2[i][j]) ;
3737 
3738  fhMassDispPhiNLocMaxN[i][j] = new TH2F(Form("hMassDispPhiNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3739  Form("Invariant mass of N>2 local maxima cells vs #sigma_{#phi #phi}^{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
3740  ssbins,ssmin,ssmax,mbins,mmin,mmax);
3741  fhMassDispPhiNLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3742  fhMassDispPhiNLocMaxN[i][j]->SetXTitle("#sigma_{#phi #phi}^{2}");
3743  outputContainer->Add(fhMassDispPhiNLocMaxN[i][j]) ;
3744 
3745  fhMassDispAsyNLocMax1[i][j] = new TH2F(Form("hMassDispAsyNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3746  Form("Invariant mass of 2 highest energy cells A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), E > 12 GeV,%s %s",ptype[i].Data(),sMatched[j].Data()),
3747  200,-1,1,mbins,mmin,mmax);
3748  fhMassDispAsyNLocMax1[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3749  fhMassDispAsyNLocMax1[i][j]->SetXTitle("A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
3750  outputContainer->Add(fhMassDispAsyNLocMax1[i][j]) ;
3751 
3752  fhMassDispAsyNLocMax2[i][j] = new TH2F(Form("hMassDispAsyNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3753  Form("Invariant mass of 2 local maxima cells A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), E > 12 GeV, %s %s",ptype[i].Data(),sMatched[j].Data()),
3754  200,-1,1,mbins,mmin,mmax);
3755  fhMassDispAsyNLocMax2[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3756  fhMassDispAsyNLocMax2[i][j]->SetXTitle("A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
3757  outputContainer->Add(fhMassDispAsyNLocMax2[i][j]) ;
3758 
3759  fhMassDispAsyNLocMaxN[i][j] = new TH2F(Form("hMassDispAsyNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3760  Form("Invariant mass of N>2 local maxima cells vsA = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), %s %s",ptype[i].Data(),sMatched[j].Data()),
3761  200,-1,1,mbins,mmin,mmax);
3762  fhMassDispAsyNLocMaxN[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3763  fhMassDispAsyNLocMaxN[i][j]->SetXTitle("#it{A} = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
3764  outputContainer->Add(fhMassDispAsyNLocMaxN[i][j]) ;
3765  }
3766 
3767  if(i > 0 && fFillMCHisto) // skip first entry in array, general case not filled
3768  {
3769  fhMCGenFracNLocMax1[i][j] = new TH2F(Form("hMCGenFracNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3770  Form("#lambda_{0}^{2} vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3771  nptbins,ptmin,ptmax,200,0,2);
3772  fhMCGenFracNLocMax1[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3773  fhMCGenFracNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3774  outputContainer->Add(fhMCGenFracNLocMax1[i][j]) ;
3775 
3776  fhMCGenFracNLocMax2[i][j] = new TH2F(Form("hMCGenFracNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3777  Form("#lambda_{0}^{2} vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3778  nptbins,ptmin,ptmax,200,0,2);
3779  fhMCGenFracNLocMax2[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3780  fhMCGenFracNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3781  outputContainer->Add(fhMCGenFracNLocMax2[i][j]) ;
3782 
3783  fhMCGenFracNLocMaxN[i][j] = new TH2F(Form("hMCGenFracNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3784  Form("#lambda_{0}^{2} vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3785  nptbins,ptmin,ptmax,200,0,2);
3786  fhMCGenFracNLocMaxN[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3787  fhMCGenFracNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3788  outputContainer->Add(fhMCGenFracNLocMaxN[i][j]) ;
3789 
3790  fhMCGenFracNLocMax1NoOverlap[i][j] = new TH2F(Form("hMCGenFracNoOverlapNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3791  Form("#lambda_{0}^{2} vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3792  nptbins,ptmin,ptmax,200,0,2);
3793  fhMCGenFracNLocMax1NoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3794  fhMCGenFracNLocMax1NoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3795  outputContainer->Add(fhMCGenFracNLocMax1NoOverlap[i][j]) ;
3796 
3797  fhMCGenFracNLocMax2NoOverlap[i][j] = new TH2F(Form("hMCGenFracNoOverlapNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3798  Form("#lambda_{0}^{2} vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3799  nptbins,ptmin,ptmax,200,0,2);
3800  fhMCGenFracNLocMax2NoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3801  fhMCGenFracNLocMax2NoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3802  outputContainer->Add(fhMCGenFracNLocMax2NoOverlap[i][j]) ;
3803 
3804  fhMCGenFracNLocMaxNNoOverlap[i][j] = new TH2F(Form("hMCGenFracNoOverlapNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3805  Form("#lambda_{0}^{2} vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3806  nptbins,ptmin,ptmax,200,0,2);
3807  fhMCGenFracNLocMaxNNoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
3808  fhMCGenFracNLocMaxNNoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3809  outputContainer->Add(fhMCGenFracNLocMaxNNoOverlap[i][j]) ;
3810 
3811 
3812  fhMCGenSplitEFracNLocMax1[i][j] = new TH2F(Form("hMCGenSplitEFracNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3813  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3814  nptbins,ptmin,ptmax,200,0,2);
3815  fhMCGenSplitEFracNLocMax1[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3816  fhMCGenSplitEFracNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3817  outputContainer->Add(fhMCGenSplitEFracNLocMax1[i][j]) ;
3818 
3819  fhMCGenSplitEFracNLocMax2[i][j] = new TH2F(Form("hMCGenSplitEFracNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3820  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3821  nptbins,ptmin,ptmax,200,0,2);
3822  fhMCGenSplitEFracNLocMax2[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3823  fhMCGenSplitEFracNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3824  outputContainer->Add(fhMCGenSplitEFracNLocMax2[i][j]) ;
3825 
3826  fhMCGenSplitEFracNLocMaxN[i][j] = new TH2F(Form("hMCGenSplitEFracNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3827  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3828  nptbins,ptmin,ptmax,200,0,2);
3829  fhMCGenSplitEFracNLocMaxN[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3830  fhMCGenSplitEFracNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3831  outputContainer->Add(fhMCGenSplitEFracNLocMaxN[i][j]) ;
3832 
3833  fhMCGenSplitEFracNLocMax1NoOverlap[i][j] = new TH2F(Form("hMCGenSplitEFracNoOverlapNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3834  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3835  nptbins,ptmin,ptmax,200,0,2);
3836  fhMCGenSplitEFracNLocMax1NoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3837  fhMCGenSplitEFracNLocMax1NoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3838  outputContainer->Add(fhMCGenSplitEFracNLocMax1NoOverlap[i][j]) ;
3839 
3840  fhMCGenSplitEFracNLocMax2NoOverlap[i][j] = new TH2F(Form("hMCGenSplitEFracNoOverlapNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3841  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3842  nptbins,ptmin,ptmax,200,0,2);
3843  fhMCGenSplitEFracNLocMax2NoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3844  fhMCGenSplitEFracNLocMax2NoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3845  outputContainer->Add(fhMCGenSplitEFracNLocMax2NoOverlap[i][j]) ;
3846 
3847  fhMCGenSplitEFracNLocMaxNNoOverlap[i][j] = new TH2F(Form("hMCGenSplitEFracNoOverlapNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3848  Form("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3849  nptbins,ptmin,ptmax,200,0,2);
3850  fhMCGenSplitEFracNLocMaxNNoOverlap[i][j] ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
3851  fhMCGenSplitEFracNLocMaxNNoOverlap[i][j] ->SetXTitle("#it{E} (GeV)");
3852  outputContainer->Add(fhMCGenSplitEFracNLocMaxNNoOverlap[i][j]) ;
3853 
3854  fhMCGenEFracvsSplitEFracNLocMax1[i][j] = new TH2F(Form("hMCGenEFracvsSplitEFracNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3855  Form("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco} vs #it{E}_{gen} / #it{E}_{reco} for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3856  200,0,2,200,0,2);
3857  fhMCGenEFracvsSplitEFracNLocMax1[i][j] ->SetYTitle("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco}");
3858  fhMCGenEFracvsSplitEFracNLocMax1[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
3859  outputContainer->Add(fhMCGenEFracvsSplitEFracNLocMax1[i][j]) ;
3860 
3861  fhMCGenEFracvsSplitEFracNLocMax2[i][j] = new TH2F(Form("hMCGenEFracvsSplitEFracNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3862  Form("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco} vs #it{E}_{gen} / #it{E}_{reco} for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3863  200,0,2,200,0,2);
3864  fhMCGenEFracvsSplitEFracNLocMax2[i][j] ->SetYTitle("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco}");
3865  fhMCGenEFracvsSplitEFracNLocMax2[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
3866  outputContainer->Add(fhMCGenEFracvsSplitEFracNLocMax2[i][j]) ;
3867 
3868 
3869  fhMCGenEFracvsSplitEFracNLocMaxN[i][j] = new TH2F(Form("hMCGenEFracvsSplitEFracNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3870  Form("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco} vs #it{E}_{gen} / #it{E}_{reco} for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3871  200,0,2,200,0,2);
3872  fhMCGenEFracvsSplitEFracNLocMaxN[i][j] ->SetYTitle("(#it{E}_{1 split}+#it{E}_{2 split})/#it{E}_{reco}");
3873  fhMCGenEFracvsSplitEFracNLocMaxN[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
3874  outputContainer->Add(fhMCGenEFracvsSplitEFracNLocMaxN[i][j]) ;
3875 
3876 
3877  fhMCGenEvsSplitENLocMax1[i][j] = new TH2F(Form("hMCGenEvsSplitENLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3878  Form("#it{E}_{1 split}+#it{E}_{2 split} vs #it{E}_{gen} for N max = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
3879  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3880  fhMCGenEvsSplitENLocMax1[i][j] ->SetYTitle("#it{E}_{1 split}+#it{E}_{2 split} (GeV)");
3881  fhMCGenEvsSplitENLocMax1[i][j] ->SetXTitle("#it{E}_{gen} (GeV)");
3882  outputContainer->Add(fhMCGenEvsSplitENLocMax1[i][j]) ;
3883 
3884  fhMCGenEvsSplitENLocMax2[i][j] = new TH2F(Form("hMCGenEvsSplitENLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3885  Form("#it{E}_{1 split}+#it{E}_{2 split} vs #it{E}_{gen} for N max = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3886  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3887  fhMCGenEvsSplitENLocMax2[i][j] ->SetYTitle("#it{E}_{1 split}+#it{E}_{2 split} (GeV)");
3888  fhMCGenEvsSplitENLocMax2[i][j] ->SetXTitle("#it{E}_{gen} (GeV)");
3889  outputContainer->Add(fhMCGenEvsSplitENLocMax2[i][j]) ;
3890 
3891 
3892  fhMCGenEvsSplitENLocMaxN[i][j] = new TH2F(Form("hMCGenEvsSplitENLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3893  Form("#it{E}_{1 split}+#it{E}_{2 split} vs #it{E}_{gen} for N max > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
3894  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3895  fhMCGenEvsSplitENLocMaxN[i][j] ->SetYTitle("#it{E}_{1 split}+#it{E}_{2 split} (GeV)");
3896  fhMCGenEvsSplitENLocMaxN[i][j] ->SetXTitle("#it{E}_{gen} (GeV)");
3897  outputContainer->Add(fhMCGenEvsSplitENLocMaxN[i][j]) ;
3898  }
3899 
3900  // Histograms after cluster identification
3901 
3902 
3903  // Pi0 //
3904 
3905  fhM02Pi0NLocMax1[i][j] = new TH2F(Form("hM02Pi0NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3906  Form("#lambda_{0}^{2} vs #it{E}, %s, for NLM = 1",ptype[i].Data()),
3907  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3908  fhM02Pi0NLocMax1[i][j] ->SetYTitle("#lambda_{0}^{2}");
3909  fhM02Pi0NLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3910  outputContainer->Add(fhM02Pi0NLocMax1[i][j]) ;
3911 
3912  fhM02Pi0NLocMax2[i][j] = new TH2F(Form("hM02Pi0NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3913  Form("#lambda_{0}^{2} vs #it{E}, %s, for NLM = 2",ptype[i].Data()),
3914  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3915  fhM02Pi0NLocMax2[i][j] ->SetYTitle("#lambda_{0}^{2}");
3916  fhM02Pi0NLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3917  outputContainer->Add(fhM02Pi0NLocMax2[i][j]) ;
3918 
3919  fhM02Pi0NLocMaxN[i][j] = new TH2F(Form("hM02Pi0NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3920  Form("#lambda_{0}^{2} vs #it{E}, %s, for NLM > 2",ptype[i].Data()),
3921  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3922  fhM02Pi0NLocMaxN[i][j] ->SetYTitle("#lambda_{0}^{2}");
3923  fhM02Pi0NLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3924  outputContainer->Add(fhM02Pi0NLocMaxN[i][j]) ;
3925 
3926  fhMassPi0NLocMax1[i][j] = new TH2F(Form("hMassPi0NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3927  Form("Mass vs #it{E}, %s, for NLM = 1",ptype[i].Data()),
3928  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3929  fhMassPi0NLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3930  fhMassPi0NLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3931  outputContainer->Add(fhMassPi0NLocMax1[i][j]) ;
3932 
3933  fhMassPi0NLocMax2[i][j] = new TH2F(Form("hMassPi0NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3934  Form("Mass vs #it{E} , %s, for NLM = 2",ptype[i].Data()),
3935  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3936  fhMassPi0NLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3937  fhMassPi0NLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3938  outputContainer->Add(fhMassPi0NLocMax2[i][j]) ;
3939 
3940  fhMassPi0NLocMaxN[i][j] = new TH2F(Form("hMassPi0NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3941  Form("Mass vs #it{E}, %s, for NLM > 2",ptype[i].Data()),
3942  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3943  fhMassPi0NLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3944  fhMassPi0NLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3945  outputContainer->Add(fhMassPi0NLocMaxN[i][j]) ;
3946 
3947  fhMassSplitEPi0NLocMax1[i][j] = new TH2F(Form("hMassSplitEPi0NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3948  Form("Mass vs #it{E}_{1}+#it{E}_{2}, %s, for NLM = 1",ptype[i].Data()),
3949  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3950  fhMassSplitEPi0NLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3951  fhMassSplitEPi0NLocMax1[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3952  outputContainer->Add(fhMassSplitEPi0NLocMax1[i][j]) ;
3953 
3954  fhMassSplitEPi0NLocMax2[i][j] = new TH2F(Form("hMassSplitEPi0NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3955  Form("Mass vs #it{E}_{1}+#it{E}_{2} , %s, for NLM = 2",ptype[i].Data()),
3956  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3957  fhMassSplitEPi0NLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3958  fhMassSplitEPi0NLocMax2[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3959  outputContainer->Add(fhMassSplitEPi0NLocMax2[i][j]) ;
3960 
3961  fhMassSplitEPi0NLocMaxN[i][j] = new TH2F(Form("hMassSplitEPi0NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3962  Form("Mass vs #it{E}_{1}+#it{E}_{2}, %s, for NLM > 2",ptype[i].Data()),
3963  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3964  fhMassSplitEPi0NLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
3965  fhMassSplitEPi0NLocMaxN[i][j] ->SetXTitle("#it{E}_{1}+#it{E}_{2} (GeV)");
3966  outputContainer->Add(fhMassSplitEPi0NLocMaxN[i][j]) ;
3967 
3968  fhAsyPi0NLocMax1[i][j] = new TH2F(Form("hAsyPi0NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3969  Form("Asymmetry vs E, %s, for NLM = 1",ptype[i].Data()),
3970  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3971  fhAsyPi0NLocMax1[i][j] ->SetYTitle("#it{A}");
3972  fhAsyPi0NLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3973  outputContainer->Add(fhAsyPi0NLocMax1[i][j]) ;
3974 
3975  fhAsyPi0NLocMax2[i][j] = new TH2F(Form("hAsyPi0NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3976  Form("Asymmetry vs E, %s, for NLM = 2",ptype[i].Data()),
3977  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3978  fhAsyPi0NLocMax2[i][j] ->SetYTitle("#it{A}");
3979  fhAsyPi0NLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
3980  outputContainer->Add(fhAsyPi0NLocMax2[i][j]) ;
3981 
3982  fhAsyPi0NLocMaxN[i][j] = new TH2F(Form("hAsyPi0NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
3983  Form("Asymmetry vs E, %s, for NLM > 2",ptype[i].Data()),
3984  nptbins,ptmin,ptmax,mbins,mmin,mmax);
3985  fhAsyPi0NLocMaxN[i][j] ->SetYTitle("#it{A}");
3986  fhAsyPi0NLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
3987  outputContainer->Add(fhAsyPi0NLocMaxN[i][j]) ;
3988 
3989  if(fFillNCellHisto)
3990  {
3991  fhNCellPi0NLocMax1[i][j] = new TH2F(Form("hNCellPi0NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
3992  Form("n cells vs E, %s, for NLM = 1",ptype[i].Data()),
3993  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
3994  fhNCellPi0NLocMax1[i][j] ->SetYTitle("#it{N} cells");
3995  fhNCellPi0NLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
3996  outputContainer->Add(fhNCellPi0NLocMax1[i][j]) ;
3997 
3998  fhNCellPi0NLocMax2[i][j] = new TH2F(Form("hNCellPi0NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
3999  Form("n cells vs E, %s, for NLM = 2",ptype[i].Data()),
4000  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
4001  fhNCellPi0NLocMax2[i][j] ->SetYTitle("#it{N} cells");
4002  fhNCellPi0NLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4003  outputContainer->Add(fhNCellPi0NLocMax2[i][j]) ;
4004 
4005  fhNCellPi0NLocMaxN[i][j] = new TH2F(Form("hNCellPi0NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4006  Form("n cells vs E, %s, for NLM > 2",ptype[i].Data()),
4007  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
4008  fhNCellPi0NLocMaxN[i][j] ->SetYTitle("#it{N} cells");
4009  fhNCellPi0NLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4010  outputContainer->Add(fhNCellPi0NLocMaxN[i][j]) ;
4011  }
4012 
4013  // Eta
4014 
4015  if(fFillIdEtaHisto)
4016  {
4017  fhM02EtaNLocMax1[i][j] = new TH2F(Form("hM02EtaNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4018  Form("#lambda_{0}^{2} vs E, %s, for NLM = 1",ptype[i].Data()),
4019  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4020  fhM02EtaNLocMax1[i][j] ->SetYTitle("#lambda_{0}^{2}");
4021  fhM02EtaNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4022  outputContainer->Add(fhM02EtaNLocMax1[i][j]) ;
4023 
4024 
4025  fhM02EtaNLocMax2[i][j] = new TH2F(Form("hM02EtaNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4026  Form("#lambda_{0}^{2} vs E, %s, for NLM = 2",ptype[i].Data()),
4027  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4028  fhM02EtaNLocMax2[i][j] ->SetYTitle("#lambda_{0}^{2}");
4029  fhM02EtaNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4030  outputContainer->Add(fhM02EtaNLocMax2[i][j]) ;
4031 
4032  fhM02EtaNLocMaxN[i][j] = new TH2F(Form("hM02EtaNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4033  Form("#lambda_{0}^{2} vs E, %s, for NLM > 2",ptype[i].Data()),
4034  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4035  fhM02EtaNLocMaxN[i][j] ->SetYTitle("#lambda_{0}^{2}");
4036  fhM02EtaNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4037  outputContainer->Add(fhM02EtaNLocMaxN[i][j]) ;
4038 
4039  fhMassEtaNLocMax1[i][j] = new TH2F(Form("hMassEtaNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4040  Form("Mass vs E, %s, for NLM = 1",ptype[i].Data()),
4041  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4042  fhMassEtaNLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4043  fhMassEtaNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4044  outputContainer->Add(fhMassEtaNLocMax1[i][j]) ;
4045 
4046  fhMassEtaNLocMax2[i][j] = new TH2F(Form("hMassEtaNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4047  Form("Mass vs E, %s, for NLM = 2",ptype[i].Data()),
4048  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4049  fhMassEtaNLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4050  fhMassEtaNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4051  outputContainer->Add(fhMassEtaNLocMax2[i][j]) ;
4052 
4053  fhMassEtaNLocMaxN[i][j] = new TH2F(Form("hMassEtaNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4054  Form("Mass vs E, %s, for NLM > 2",ptype[i].Data()),
4055  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4056  fhMassEtaNLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4057  fhMassEtaNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4058  outputContainer->Add(fhMassEtaNLocMaxN[i][j]) ;
4059 
4060  fhAsyEtaNLocMax1[i][j] = new TH2F(Form("hAsyEtaNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4061  Form("Asymmetry vs E, %s, for NLM = 1",ptype[i].Data()),
4062  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4063  fhAsyEtaNLocMax1[i][j] ->SetYTitle("#it{A}");
4064  fhAsyEtaNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4065  outputContainer->Add(fhAsyEtaNLocMax1[i][j]) ;
4066 
4067  fhAsyEtaNLocMax2[i][j] = new TH2F(Form("hAsyEtaNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4068  Form("Asymmetry vs E, %s, for NLM = 2",ptype[i].Data()),
4069  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4070  fhAsyEtaNLocMax2[i][j] ->SetYTitle("#it{A}");
4071  fhAsyEtaNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4072  outputContainer->Add(fhAsyEtaNLocMax2[i][j]) ;
4073 
4074  fhAsyEtaNLocMaxN[i][j] = new TH2F(Form("hAsyEtaNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4075  Form("Asymmetry vs E, %s, for NLM > 2",ptype[i].Data()),
4076  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4077  fhAsyEtaNLocMaxN[i][j] ->SetYTitle("#it{A}");
4078  fhAsyEtaNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4079  outputContainer->Add(fhAsyEtaNLocMaxN[i][j]) ;
4080 
4081  if(fFillNCellHisto)
4082  {
4083  fhNCellEtaNLocMax1[i][j] = new TH2F(Form("hNCellEtaNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4084  Form("n cells vs E, %s, for NLM = 1",ptype[i].Data()),
4085  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
4086  fhNCellEtaNLocMax1[i][j] ->SetYTitle("#it{N} cells");
4087  fhNCellEtaNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4088  outputContainer->Add(fhNCellEtaNLocMax1[i][j]) ;
4089 
4090  fhNCellEtaNLocMax2[i][j] = new TH2F(Form("hNCellEtaNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4091  Form("n cells vs E, %s, for NLM = 2",ptype[i].Data()),
4092  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
4093  fhNCellEtaNLocMax2[i][j] ->SetYTitle("#it{N} cells");
4094  fhNCellEtaNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4095  outputContainer->Add(fhNCellEtaNLocMax2[i][j]) ;
4096 
4097  fhNCellEtaNLocMaxN[i][j] = new TH2F(Form("hNCellEtaNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4098  Form("n cells vs E, %s, for NLM > 2",ptype[i].Data()),
4099  nptbins,ptmin,ptmax,ncbins,ncmin,ncmax);
4100  fhNCellEtaNLocMaxN[i][j] ->SetYTitle("#it{N} cells");
4101  fhNCellEtaNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4102  outputContainer->Add(fhNCellEtaNLocMaxN[i][j]) ;
4103  }
4104  }
4105 
4106  if(fFillIdConvHisto)
4107  {
4108  fhM02ConNLocMax1[i][j] = new TH2F(Form("hM02ConNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4109  Form("#lambda_{0}^{2} vs E, %s, for NLM = 1",ptype[i].Data()),
4110  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4111  fhM02ConNLocMax1[i][j] ->SetYTitle("#lambda_{0}^{2}");
4112  fhM02ConNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4113  outputContainer->Add(fhM02ConNLocMax1[i][j]) ;
4114 
4115  fhM02ConNLocMax2[i][j] = new TH2F(Form("hM02ConNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4116  Form("#lambda_{0}^{2} vs E, %s, for NLM = 2",ptype[i].Data()),
4117  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4118  fhM02ConNLocMax2[i][j] ->SetYTitle("#lambda_{0}^{2}");
4119  fhM02ConNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4120  outputContainer->Add(fhM02ConNLocMax2[i][j]) ;
4121 
4122  fhM02ConNLocMaxN[i][j] = new TH2F(Form("hM02ConNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4123  Form("#lambda_{0}^{2} vs E, %s, for NLM > 2",ptype[i].Data()),
4124  nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
4125  fhM02ConNLocMaxN[i][j] ->SetYTitle("#lambda_{0}^{2}");
4126  fhM02ConNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4127  outputContainer->Add(fhM02ConNLocMaxN[i][j]) ;
4128 
4129 
4130  fhMassConNLocMax1[i][j] = new TH2F(Form("hMassConNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4131  Form("Mass vs E, %s, for NLM = 1",ptype[i].Data()),
4132  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4133  fhMassConNLocMax1[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4134  fhMassConNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4135  outputContainer->Add(fhMassConNLocMax1[i][j]) ;
4136 
4137  fhMassConNLocMax2[i][j] = new TH2F(Form("hMassConNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4138  Form("Mass vs E, %s, for NLM = 2",ptype[i].Data()),
4139  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4140  fhMassConNLocMax2[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4141  fhMassConNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4142  outputContainer->Add(fhMassConNLocMax2[i][j]) ;
4143 
4144  fhMassConNLocMaxN[i][j] = new TH2F(Form("hMassConNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4145  Form("Mass vs E, %s, for NLM > 2",ptype[i].Data()),
4146  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4147  fhMassConNLocMaxN[i][j] ->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4148  fhMassConNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4149  outputContainer->Add(fhMassConNLocMaxN[i][j]) ;
4150 
4151  fhAsyConNLocMax1[i][j] = new TH2F(Form("hAsyConNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
4152  Form("Asymmetry vs E, %s, for NLM = 1",ptype[i].Data()),
4153  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4154  fhAsyConNLocMax1[i][j] ->SetYTitle("#it{A}");
4155  fhAsyConNLocMax1[i][j] ->SetXTitle("#it{E} (GeV)");
4156  outputContainer->Add(fhAsyConNLocMax1[i][j]) ;
4157 
4158  fhAsyConNLocMax2[i][j] = new TH2F(Form("hAsyConNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
4159  Form("Asymmetry vs E, %s, for NLM = 2",ptype[i].Data()),
4160  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4161  fhAsyConNLocMax2[i][j] ->SetYTitle("#it{A}");
4162  fhAsyConNLocMax2[i][j] ->SetXTitle("#it{E} (GeV)");
4163  outputContainer->Add(fhAsyConNLocMax2[i][j]) ;
4164 
4165  fhAsyConNLocMaxN[i][j] = new TH2F(Form("hAsyConNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
4166  Form("Asymmetry vs E, %s, for NLM > 2",ptype[i].Data()),
4167  nptbins,ptmin,ptmax,mbins,mmin,mmax);
4168  fhAsyConNLocMaxN[i][j] ->SetYTitle("#it{A}");
4169  fhAsyConNLocMaxN[i][j] ->SetXTitle("#it{E} (GeV)");
4170  outputContainer->Add(fhAsyConNLocMaxN[i][j]) ;
4171  }
4172  } // matched, not matched
4173 
4174  if(fFillEbinHisto)
4175  {
4176  for(Int_t j = 0; j < 4; j++)
4177  {
4178  fhMassSplitEFractionNLocMax1Ebin[i][j] = new TH2F(Form("hMassSplitEFractionNLocMax1%sEbin%d",pname[i].Data(),j),
4179  Form("Invariant mass of 2 highest energy cells vs (#it{E}_{1}+#it{E}_{2})/Ecluster, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4180  120,0,1.2,mbins,mmin,mmax);
4181  fhMassSplitEFractionNLocMax1Ebin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4182  fhMassSplitEFractionNLocMax1Ebin[i][j]->SetXTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
4183  outputContainer->Add(fhMassSplitEFractionNLocMax1Ebin[i][j]) ;
4184 
4185  fhMassSplitEFractionNLocMax2Ebin[i][j] = new TH2F(Form("hMassSplitEFractionNLocMax2%sEbin%d",pname[i].Data(),j),
4186  Form("Invariant mass of 2 local maxima cells vs (#it{E}_{1}+#it{E}_{2})/Ecluster, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4187  120,0,1.2,mbins,mmin,mmax);
4188  fhMassSplitEFractionNLocMax2Ebin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4189  fhMassSplitEFractionNLocMax2Ebin[i][j]->SetXTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
4190  outputContainer->Add(fhMassSplitEFractionNLocMax2Ebin[i][j]) ;
4191 
4192  fhMassSplitEFractionNLocMaxNEbin[i][j] = new TH2F(Form("hMassSplitEFractionNLocMaxN%sEbin%d",pname[i].Data(),j),
4193  Form("Invariant mass of N>2 local maxima cells vs (#it{E}_{1}+#it{E}_{2})/Ecluster, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4194  120,0,1.2,mbins,mmin,mmax);
4195  fhMassSplitEFractionNLocMaxNEbin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4196  fhMassSplitEFractionNLocMaxNEbin[i][j]->SetXTitle("(#it{E}_{split1}+#it{E}_{split2})/#it{E}_{cluster}");
4197  outputContainer->Add(fhMassSplitEFractionNLocMaxNEbin[i][j]) ;
4198 
4199  if(i>0 && fFillMCHisto) // skip first entry in array, general case not filled
4200  {
4201  fhMCGenFracNLocMaxEbin[i][j] = new TH2F(Form("hMCGenFracNLocMax%sEbin%d",pname[i].Data(),j),
4202  Form("NLM vs E, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4203  200,0,2,nMaxBins,0,nMaxBins);
4204  fhMCGenFracNLocMaxEbin[i][j]->SetYTitle("#it{NLM}");
4205  fhMCGenFracNLocMaxEbin[i][j]->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4206  outputContainer->Add(fhMCGenFracNLocMaxEbin[i][j]) ;
4207 
4208  fhMCGenFracNLocMaxEbinMatched[i][j] = new TH2F(Form("hMCGenFracNLocMax%sEbin%dMatched",pname[i].Data(),j),
4209  Form("NLM vs E, %s, %s, matched to a track",ptype[i].Data(),sEBin[j].Data()),
4210  200,0,2,nMaxBins,0,nMaxBins);
4211  fhMCGenFracNLocMaxEbinMatched[i][j]->SetYTitle("#it{NLM}");
4212  fhMCGenFracNLocMaxEbinMatched[i][j]->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4213  outputContainer->Add(fhMCGenFracNLocMaxEbinMatched[i][j]) ;
4214 
4215  fhMassMCGenFracNLocMax1Ebin[i][j] = new TH2F(Form("hMassMCGenFracNLocMax1%sEbin%d",pname[i].Data(),j),
4216  Form("Invariant mass of 2 highest energy cells vs E, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4217  200,0,2,mbins,mmin,mmax);
4218  fhMassMCGenFracNLocMax1Ebin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4219  fhMassMCGenFracNLocMax1Ebin[i][j]->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4220  outputContainer->Add(fhMassMCGenFracNLocMax1Ebin[i][j]) ;
4221 
4222  fhMassMCGenFracNLocMax2Ebin[i][j] = new TH2F(Form("hMassMCGenFracNLocMax2%sEbin%d",pname[i].Data(),j),
4223  Form("Invariant mass of 2 local maxima cells vs E, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4224  200,0,2,mbins,mmin,mmax);
4225  fhMassMCGenFracNLocMax2Ebin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4226  fhMassMCGenFracNLocMax2Ebin[i][j]->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4227  outputContainer->Add(fhMassMCGenFracNLocMax2Ebin[i][j]) ;
4228 
4229  fhMassMCGenFracNLocMaxNEbin[i][j] = new TH2F(Form("hMassMCGenFracNLocMaxN%sEbin%d",pname[i].Data(),j),
4230  Form("Invariant mass of N>2 local maxima cells vs E, %s, %s",ptype[i].Data(),sEBin[j].Data()),
4231  200,0,2,mbins,mmin,mmax);
4232  fhMassMCGenFracNLocMaxNEbin[i][j]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4233  fhMassMCGenFracNLocMaxNEbin[i][j]->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4234  outputContainer->Add(fhMassMCGenFracNLocMaxNEbin[i][j]) ;
4235 
4236  fhM02MCGenFracNLocMax1Ebin[i][j] = new TH2F(Form("hM02MCGenFracNLocMax1%sEbin%d",pname[i].Data(),j),
4237  Form("#lambda_{0}^{2} vs E for N max = 1 %s, %s",ptype[i].Data(),sEBin[j].Data()),
4238  200,0,2,ssbins,ssmin,ssmax);
4239  fhM02MCGenFracNLocMax1Ebin[i][j] ->SetYTitle("#lambda_{0}^{2}");
4240  fhM02MCGenFracNLocMax1Ebin[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4241  outputContainer->Add(fhM02MCGenFracNLocMax1Ebin[i][j]) ;
4242 
4243  fhM02MCGenFracNLocMax2Ebin[i][j] = new TH2F(Form("hM02MCGenFracNLocMax2%sEbin%d",pname[i].Data(),j),
4244  Form("#lambda_{0}^{2} vs E for N max = 2 %s, %s",ptype[i].Data(),sEBin[j].Data()),
4245  200,0,2,ssbins,ssmin,ssmax);
4246  fhM02MCGenFracNLocMax2Ebin[i][j] ->SetYTitle("#lambda_{0}^{2}");
4247  fhM02MCGenFracNLocMax2Ebin[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4248  outputContainer->Add(fhM02MCGenFracNLocMax2Ebin[i][j]) ;
4249 
4250  fhM02MCGenFracNLocMaxNEbin[i][j] = new TH2F(Form("hM02MCGenFracNLocMaxN%sEbin%d",pname[i].Data(),j),
4251  Form("#lambda_{0}^{2} vs E for N max > 2 %s, %s",ptype[i].Data(),sEBin[j].Data()),
4252  200,0,2,ssbins,ssmin,ssmax);
4253  fhM02MCGenFracNLocMaxNEbin[i][j] ->SetYTitle("#lambda_{0}^{2}");
4254  fhM02MCGenFracNLocMaxNEbin[i][j] ->SetXTitle("#it{E}_{gen} / #it{E}_{reco}");
4255  outputContainer->Add(fhM02MCGenFracNLocMaxNEbin[i][j]) ;
4256  }
4257  }
4258  }
4259  } // MC particle list
4260 
4261  if(fFillHighMultHisto)
4262  {
4263  // E vs centrality
4264 
4265  fhCentralityPi0NLocMax1 = new TH2F("hCentralityPi0NLocMax1",
4266  "E vs Centrality, selected pi0 cluster with #it{NLM}=1",
4267  nptbins,ptmin,ptmax,100,0,100);
4268  fhCentralityPi0NLocMax1->SetYTitle("#it{Centrality}");
4269  fhCentralityPi0NLocMax1->SetXTitle("#it{E} (GeV)");
4270  outputContainer->Add(fhCentralityPi0NLocMax1) ;
4271 
4272  fhCentralityPi0NLocMax2 = new TH2F("hCentralityPi0NLocMax2",
4273  "E vs Centrality, selected pi0 cluster with #it{NLM}=2",
4274  nptbins,ptmin,ptmax,100,0,100);
4275  fhCentralityPi0NLocMax2->SetYTitle("#it{Centrality}");
4276  fhCentralityPi0NLocMax2->SetXTitle("#it{E} (GeV)");
4277  outputContainer->Add(fhCentralityPi0NLocMax2) ;
4278 
4279  fhCentralityPi0NLocMaxN = new TH2F("hCentralityPi0NLocMaxN",
4280  "E vs Centrality, selected pi0 cluster with NLM>1",
4281  nptbins,ptmin,ptmax,100,0,100);
4282  fhCentralityPi0NLocMaxN->SetYTitle("#it{Centrality}");
4283  fhCentralityPi0NLocMaxN->SetXTitle("#it{E} (GeV)");
4284  outputContainer->Add(fhCentralityPi0NLocMaxN) ;
4285 
4286  if(fFillIdEtaHisto)
4287  {
4288  fhCentralityEtaNLocMax1 = new TH2F("hCentralityEtaNLocMax1",
4289  "E vs Centrality, selected pi0 cluster with #it{NLM}=1",
4290  nptbins,ptmin,ptmax,100,0,100);
4291  fhCentralityEtaNLocMax1->SetYTitle("#it{Centrality}");
4292  fhCentralityEtaNLocMax1->SetXTitle("#it{E} (GeV)");
4293  outputContainer->Add(fhCentralityEtaNLocMax1) ;
4294 
4295  fhCentralityEtaNLocMax2 = new TH2F("hCentralityEtaNLocMax2",
4296  "E vs Centrality, selected pi0 cluster with #it{NLM}=2",
4297  nptbins,ptmin,ptmax,100,0,100);
4298  fhCentralityEtaNLocMax2->SetYTitle("#it{Centrality}");
4299  fhCentralityEtaNLocMax2->SetXTitle("#it{E} (GeV)");
4300  outputContainer->Add(fhCentralityEtaNLocMax2) ;
4301 
4302  fhCentralityEtaNLocMaxN = new TH2F("hCentralityEtaNLocMaxN",
4303  "E vs Centrality, selected pi0 cluster with NLM>1",
4304  nptbins,ptmin,ptmax,100,0,100);
4305  fhCentralityEtaNLocMaxN->SetYTitle("#it{Centrality}");
4306  fhCentralityEtaNLocMaxN->SetXTitle("#it{E} (GeV)");
4307  outputContainer->Add(fhCentralityEtaNLocMaxN) ;
4308  }
4309 
4310  // E vs Event plane angle
4311 
4312  fhEventPlanePi0NLocMax1 = new TH2F("hEventPlanePi0NLocMax1","E vs Event Plane Angle, selected pi0 cluster with #it{NLM}=1",
4313  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4314  fhEventPlanePi0NLocMax1->SetYTitle("#it{Event Plane Angle} (rad)");
4315  fhEventPlanePi0NLocMax1->SetXTitle("#it{E} (GeV)");
4316  outputContainer->Add(fhEventPlanePi0NLocMax1) ;
4317 
4318  fhEventPlanePi0NLocMax2 = new TH2F("hEventPlanePi0NLocMax2","E vs Event Plane Angle, selected pi0 cluster with #it{NLM}=2",
4319  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4320  fhEventPlanePi0NLocMax2->SetYTitle("#it{Event Plane Angle} (rad)");
4321  fhEventPlanePi0NLocMax2->SetXTitle("#it{E} (GeV)");
4322  outputContainer->Add(fhEventPlanePi0NLocMax2) ;
4323 
4324  fhEventPlanePi0NLocMaxN = new TH2F("hEventPlanePi0NLocMaxN","E vs Event Plane Angle, selected pi0 cluster with NLM>1",
4325  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4326  fhEventPlanePi0NLocMaxN->SetYTitle("#it{Event Plane Angle} (rad)");
4327  fhEventPlanePi0NLocMaxN->SetXTitle("#it{E} (GeV)");
4328  outputContainer->Add(fhEventPlanePi0NLocMaxN) ;
4329 
4330  if(fFillIdEtaHisto)
4331  {
4332  fhEventPlaneEtaNLocMax1 = new TH2F("hEventPlaneEtaNLocMax1","E vs Event Plane Angle, selected pi0 cluster with #it{NLM}=1",
4333  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4334  fhEventPlaneEtaNLocMax1->SetYTitle("#it{Event Plane Angle} (rad)");
4335  fhEventPlaneEtaNLocMax1->SetXTitle("#it{E} (GeV)");
4336  outputContainer->Add(fhEventPlaneEtaNLocMax1) ;
4337 
4338  fhEventPlaneEtaNLocMax2 = new TH2F("hEventPlaneEtaNLocMax2","E vs Event Plane Angle, selected pi0 cluster with #it{NLM}=2",
4339  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4340  fhEventPlaneEtaNLocMax2->SetYTitle("#it{Event Plane Angle} (rad)");
4341  fhEventPlaneEtaNLocMax2->SetXTitle("#it{E} (GeV)");
4342  outputContainer->Add(fhEventPlaneEtaNLocMax2) ;
4343 
4344  fhEventPlaneEtaNLocMaxN = new TH2F("hEventPlaneEtaNLocMaxN","E vs Event Plane Angle, selected pi0 cluster with NLM>1",
4345  nptbins,ptmin,ptmax,100,0,TMath::Pi());
4346  fhEventPlaneEtaNLocMaxN->SetYTitle("#it{Event Plane Angle} (rad)");
4347  fhEventPlaneEtaNLocMaxN->SetXTitle("#it{E} (GeV)");
4348  outputContainer->Add(fhEventPlaneEtaNLocMaxN) ;
4349  }
4350  }
4351 
4352  if(fFillEbinHisto)
4353  {
4354  for(Int_t i = 0; i < 4; i++)
4355  {
4356  fhMassM02NLocMax1Ebin[i] = new TH2F(Form("hMassM02NLocMax1Ebin%d",i),
4357  Form("Invariant mass of split clusters vs #lambda_{0}^{2}, #it{NLM}=1, %s",sEBin[i].Data()),
4358  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4359  fhMassM02NLocMax1Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4360  fhMassM02NLocMax1Ebin[i]->SetXTitle("#lambda_{0}^{2}");
4361  outputContainer->Add(fhMassM02NLocMax1Ebin[i]) ;
4362 
4363  fhMassM02NLocMax2Ebin[i] = new TH2F(Form("hMassM02NLocMax2Ebin%d",i),
4364  Form("Invariant mass of split clusters vs #lambda_{0}^{2}, #it{NLM}=2, %s",sEBin[i].Data()),
4365  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4366  fhMassM02NLocMax2Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4367  fhMassM02NLocMax2Ebin[i]->SetXTitle("#lambda_{0}^{2}");
4368  outputContainer->Add(fhMassM02NLocMax2Ebin[i]) ;
4369 
4370  fhMassM02NLocMaxNEbin[i] = new TH2F(Form("hMassM02NLocMaxNEbin%d",i),
4371  Form("Invariant mass of split clusters vs vs #lambda_{0}^{2}, NLM>2, %s",sEBin[i].Data()),
4372  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4373  fhMassM02NLocMaxNEbin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4374  fhMassM02NLocMaxNEbin[i]->SetXTitle("#lambda_{0}^{2}");
4375  outputContainer->Add(fhMassM02NLocMaxNEbin[i]) ;
4376 
4377 
4378  fhMassAsyNLocMax1Ebin[i] = new TH2F(Form("hMassAsyNLocMax1Ebin%d",i),
4379  Form("Invariant mass of split clusters vs split asymmetry, #it{NLM}=1, %s",sEBin[i].Data()),
4380  200,-1,1,mbins,mmin,mmax);
4381  fhMassAsyNLocMax1Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4382  fhMassAsyNLocMax1Ebin[i]->SetXTitle("asymmetry");
4383  outputContainer->Add(fhMassAsyNLocMax1Ebin[i]) ;
4384 
4385  fhMassAsyNLocMax2Ebin[i] = new TH2F(Form("hMassAsyNLocMax2Ebin%d",i),
4386  Form("Invariant mass of split clusters vs split asymmetry, #it{NLM}=2, %s",sEBin[i].Data()),
4387  200,-1,1,mbins,mmin,mmax);
4388  fhMassAsyNLocMax2Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4389  fhMassAsyNLocMax2Ebin[i]->SetXTitle("asymmetry");
4390  outputContainer->Add(fhMassAsyNLocMax2Ebin[i]) ;
4391 
4392  fhMassAsyNLocMaxNEbin[i] = new TH2F(Form("hMassAsyNLocMaxNEbin%d",i),
4393  Form("Invariant mass of split clusters vs split asymmetry, NLM>2, %s",sEBin[i].Data()),
4394  200,-1,1,mbins,mmin,mmax);
4395  fhMassAsyNLocMaxNEbin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4396  fhMassAsyNLocMaxNEbin[i]->SetXTitle("asymmetry");
4397  outputContainer->Add(fhMassAsyNLocMaxNEbin[i]) ;
4398 
4399  if(IsDataMC() && fFillMCHisto)
4400  {
4401  fhMCAsymM02NLocMax1MCPi0Ebin[i] = new TH2F(Form("hMCAsymM02NLocMax1MCPi0Ebin%d",i),
4402  Form("Asymmetry of MC #pi^{0} vs #lambda_{0}^{2}, #it{NLM}=1, %s",sEBin[i].Data()),
4403  ssbins,ssmin,ssmax,100,0,1);
4404  fhMCAsymM02NLocMax1MCPi0Ebin[i]->SetYTitle("Decay asymmetry");
4405  fhMCAsymM02NLocMax1MCPi0Ebin[i]->SetXTitle("#lambda_{0}^{2}");
4406  outputContainer->Add(fhMCAsymM02NLocMax1MCPi0Ebin[i]) ;
4407 
4408  fhMCAsymM02NLocMax2MCPi0Ebin[i] = new TH2F(Form("hMCAsymM02NLocMax2MCPi0Ebin%d",i),
4409  Form("Asymmetry of MC #pi^{0} vs #lambda_{0}^{2}, #it{NLM}=2, %s",sEBin[i].Data()),
4410  ssbins,ssmin,ssmax,100,0,1);
4411  fhMCAsymM02NLocMax2MCPi0Ebin[i]->SetYTitle("Decay asymmetry");
4412  fhMCAsymM02NLocMax2MCPi0Ebin[i]->SetXTitle("#lambda_{0}^{2}");
4413  outputContainer->Add(fhMCAsymM02NLocMax2MCPi0Ebin[i]) ;
4414 
4415  fhMCAsymM02NLocMaxNMCPi0Ebin[i] = new TH2F(Form("hMCAsymM02NLocMaxNMCPi0Ebin%d",i),
4416  Form("Asymmetry of MC #pi^{0} vs #lambda_{0}^{2}, NLM>2, %s",sEBin[i].Data()),
4417  ssbins,ssmin,ssmax,100,0,1);
4418  fhMCAsymM02NLocMaxNMCPi0Ebin[i]->SetYTitle("Decay asymmetry");
4419  fhMCAsymM02NLocMaxNMCPi0Ebin[i]->SetXTitle("#lambda_{0}^{2}");
4420  outputContainer->Add(fhMCAsymM02NLocMaxNMCPi0Ebin[i]) ;
4421 
4422 
4423  fhAsyMCGenRecoNLocMax1EbinPi0[i] = new TH2F(Form("hAsyMCGenRecoNLocMax1Ebin%dPi0",i),
4424  Form("Generated vs reconstructed asymmetry of split clusters from pi0, #it{NLM}=1, %s",sEBin[i].Data()),
4425  200,-1,1,200,-1,1);
4426  fhAsyMCGenRecoNLocMax1EbinPi0[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4427  fhAsyMCGenRecoNLocMax1EbinPi0[i]->SetXTitle("#it{A}");
4428  outputContainer->Add(fhAsyMCGenRecoNLocMax1EbinPi0[i]) ;
4429 
4430  fhAsyMCGenRecoNLocMax2EbinPi0[i] = new TH2F(Form("hAsyMCGenRecoNLocMax2Ebin%dPi0",i),
4431  Form("Generated vs reconstructed asymmetry of split clusters from pi0, #it{NLM}=2, %s",sEBin[i].Data()),
4432  200,-1,1,200,-1,1);
4433  fhAsyMCGenRecoNLocMax2EbinPi0[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4434  fhAsyMCGenRecoNLocMax2EbinPi0[i]->SetXTitle("#it{A}");
4435  outputContainer->Add(fhAsyMCGenRecoNLocMax2EbinPi0[i]) ;
4436 
4437  fhAsyMCGenRecoNLocMaxNEbinPi0[i] = new TH2F(Form("hAsyMCGenRecoNLocMaxNEbin%dPi0",i),
4438  Form("Generated vs reconstructed asymmetry of split clusters from pi0, NLM>2, %s",sEBin[i].Data()),
4439  200,-1,1,200,-1,1);
4440  fhAsyMCGenRecoNLocMaxNEbinPi0[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4441  fhAsyMCGenRecoNLocMaxNEbinPi0[i]->SetXTitle("#it{A}");
4442  outputContainer->Add(fhAsyMCGenRecoNLocMaxNEbinPi0[i]) ;
4443  }
4444 
4445  if(fFillSSExtraHisto)
4446  {
4447  fhMassDispEtaNLocMax1Ebin[i] = new TH2F(Form("hMassDispEtaNLocMax1Ebin%d",i),
4448  Form("Invariant mass of 2 highest energy cells #sigma_{#eta #eta}^{2}, %s",sEBin[i].Data()),
4449  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4450  fhMassDispEtaNLocMax1Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4451  fhMassDispEtaNLocMax1Ebin[i]->SetXTitle("#sigma_{#eta #eta}^{2}");
4452  outputContainer->Add(fhMassDispEtaNLocMax1Ebin[i]) ;
4453 
4454  fhMassDispEtaNLocMax2Ebin[i] = new TH2F(Form("hMassDispEtaNLocMax2Ebin%d",i),
4455  Form("Invariant mass of 2 local maxima cells #sigma_{#eta #eta}^{2}, %s",sEBin[i].Data()),
4456  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4457  fhMassDispEtaNLocMax2Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4458  fhMassDispEtaNLocMax2Ebin[i]->SetXTitle("#sigma_{#eta #eta}^{2}");
4459  outputContainer->Add(fhMassDispEtaNLocMax2Ebin[i]) ;
4460 
4461  fhMassDispEtaNLocMaxNEbin[i] = new TH2F(Form("hMassDispEtaNLocMaxNEbin%d",i),
4462  Form("Invariant mass of N>2 local maxima cells vs #sigma_{#eta #eta}^{2}, %s",sEBin[i].Data()),
4463  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4464  fhMassDispEtaNLocMaxNEbin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4465  fhMassDispEtaNLocMaxNEbin[i]->SetXTitle("#sigma_{#eta #eta}^{2}");
4466  outputContainer->Add(fhMassDispEtaNLocMaxNEbin[i]) ;
4467 
4468  fhMassDispPhiNLocMax1Ebin[i] = new TH2F(Form("hMassDispPhiNLocMax1Ebin%d",i),
4469  Form("Invariant mass of 2 highest energy cells #sigma_{#phi #phi}^{2}, %s",sEBin[i].Data()),
4470  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4471  fhMassDispPhiNLocMax1Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4472  fhMassDispPhiNLocMax1Ebin[i]->SetXTitle("#sigma_{#phi #phi}^{2}");
4473  outputContainer->Add(fhMassDispPhiNLocMax1Ebin[i]) ;
4474 
4475  fhMassDispPhiNLocMax2Ebin[i] = new TH2F(Form("hMassDispPhiNLocMax2Ebin%d",i),
4476  Form("Invariant mass of 2 local maxima cells #sigma_{#phi #phi}^{2}, %s",sEBin[i].Data()),
4477  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4478  fhMassDispPhiNLocMax2Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4479  fhMassDispPhiNLocMax2Ebin[i]->SetXTitle("#sigma_{#phi #phi}^{2}");
4480  outputContainer->Add(fhMassDispPhiNLocMax2Ebin[i]) ;
4481 
4482  fhMassDispPhiNLocMaxNEbin[i] = new TH2F(Form("hMassDispPhiNLocMaxNEbin%d",i),
4483  Form("Invariant mass of N>2 local maxima cells vs #sigma_{#phi #phi}^{2}, %s",sEBin[i].Data()),
4484  ssbins,ssmin,ssmax,mbins,mmin,mmax);
4485  fhMassDispPhiNLocMaxNEbin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4486  fhMassDispPhiNLocMaxNEbin[i]->SetXTitle("#sigma_{#phi #phi}^{2}");
4487  outputContainer->Add(fhMassDispPhiNLocMaxNEbin[i]) ;
4488 
4489  fhMassDispAsyNLocMax1Ebin[i] = new TH2F(Form("hMassDispAsyNLocMax1Ebin%d",i),
4490  Form("Invariant mass of 2 highest energy cells A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), %s",sEBin[i].Data()),
4491  200,-1,1,mbins,mmin,mmax);
4492  fhMassDispAsyNLocMax1Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4493  fhMassDispAsyNLocMax1Ebin[i]->SetXTitle("#it{A} = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
4494  outputContainer->Add(fhMassDispAsyNLocMax1Ebin[i]) ;
4495 
4496  fhMassDispAsyNLocMax2Ebin[i] = new TH2F(Form("hMassDispAsyNLocMax2Ebin%d",i),
4497  Form("Invariant mass of 2 local maxima cells A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), %s",sEBin[i].Data()),
4498  200,-1,1,mbins,mmin,mmax);
4499  fhMassDispAsyNLocMax2Ebin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4500  fhMassDispAsyNLocMax2Ebin[i]->SetXTitle("#it{A} = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
4501  outputContainer->Add(fhMassDispAsyNLocMax2Ebin[i]) ;
4502 
4503  fhMassDispAsyNLocMaxNEbin[i] = new TH2F(Form("hMassDispAsyNLocMaxNEbin%d",i),
4504  Form("Invariant mass of N>2 local maxima cells vs A = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2}), %s",sEBin[i].Data()),
4505  200,-1,1,mbins,mmin,mmax);
4506  fhMassDispAsyNLocMaxNEbin[i]->SetYTitle("#it{M} (GeV/#it{c}^{2})");
4507  fhMassDispAsyNLocMaxNEbin[i]->SetXTitle("#it{A} = (#sigma_{#phi #phi}^{2} - #sigma_{#eta #eta}^{2}) / (#sigma_{#phi #phi}^{2} + #sigma_{#eta #eta}^{2})");
4508  outputContainer->Add(fhMassDispAsyNLocMaxNEbin[i]) ;
4509  }
4510  }
4511  }
4512 
4513  if(IsDataMC() && fFillMCHisto && (asyOn || m02On))
4514  {
4515  fhMCGenSplitEFracAfterCutsNLocMax1MCPi0 = new TH2F("hMCGenSplitEFracAfterCutsNLocMax1MCPi0",
4516  "#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 1 MC Pi0, after M02 and Asym cut",
4517  nptbins,ptmin,ptmax,200,0,2);
4518  fhMCGenSplitEFracAfterCutsNLocMax1MCPi0 ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
4519  fhMCGenSplitEFracAfterCutsNLocMax1MCPi0 ->SetXTitle("#it{E} (GeV)");
4520  outputContainer->Add(fhMCGenSplitEFracAfterCutsNLocMax1MCPi0) ;
4521 
4522  fhMCGenSplitEFracAfterCutsNLocMax2MCPi0 = new TH2F("hMCGenSplitEFracAfterCutsNLocMax2MCPi0",
4523  "#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max = 2 MC Pi0, after M02 and Asym cut",
4524  nptbins,ptmin,ptmax,200,0,2);
4525  fhMCGenSplitEFracAfterCutsNLocMax2MCPi0 ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
4526  fhMCGenSplitEFracAfterCutsNLocMax2MCPi0 ->SetXTitle("#it{E} (GeV)");
4527  outputContainer->Add(fhMCGenSplitEFracAfterCutsNLocMax2MCPi0) ;
4528 
4529 
4530  fhMCGenSplitEFracAfterCutsNLocMaxNMCPi0 = new TH2F("hMCGenSplitEFracAfterCutsNLocMaxNMCPi0",
4531  "#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split}) vs E for N max > 2 MC Pi0, after M02 and Asym cut",
4532  nptbins,ptmin,ptmax,200,0,2);
4533  fhMCGenSplitEFracAfterCutsNLocMaxNMCPi0 ->SetYTitle("#it{E}_{gen} / (#it{E}_{1 split}+#it{E}_{2 split})");
4534  fhMCGenSplitEFracAfterCutsNLocMaxNMCPi0 ->SetXTitle("#it{E} (GeV)");
4535  outputContainer->Add(fhMCGenSplitEFracAfterCutsNLocMaxNMCPi0) ;
4536 
4537  fhMCGenFracAfterCutsNLocMax1MCPi0 = new TH2F("hMCGenFracAfterCutsNLocMax1MCPi0",
4538  "#it{E}_{gen} / #it{E}_{reco} vs #it{E}_{reco} for N max = 1 MC Pi0, after M02 and Asym cut",
4539  nptbins,ptmin,ptmax,200,0,2);
4540  fhMCGenFracAfterCutsNLocMax1MCPi0 ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
4541  fhMCGenFracAfterCutsNLocMax1MCPi0 ->SetXTitle("#it{E} (GeV)");
4542  outputContainer->Add(fhMCGenFracAfterCutsNLocMax1MCPi0) ;
4543 
4544  fhMCGenFracAfterCutsNLocMax2MCPi0 = new TH2F("hMCGenFracAfterCutsNLocMax2MCPi0",
4545  " #it{E}_{gen} / #it{E}_{reco} vs #it{E}_{reco} for N max = 2 MC Pi0, after M02 and Asym cut",
4546  nptbins,ptmin,ptmax,200,0,2);
4547  fhMCGenFracAfterCutsNLocMax2MCPi0 ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
4548  fhMCGenFracAfterCutsNLocMax2MCPi0 ->SetXTitle("#it{E} (GeV)");
4549  outputContainer->Add(fhMCGenFracAfterCutsNLocMax2MCPi0) ;
4550 
4551 
4552  fhMCGenFracAfterCutsNLocMaxNMCPi0 = new TH2F("hMCGenFracAfterCutsNLocMaxNMCPi0",
4553  " #it{E}_{gen} / #it{E}_{reco} vs #it{E}_{reco} for N max > 2 MC Pi0, after M02 and Asym cut",
4554  nptbins,ptmin,ptmax,200,0,2);
4555  fhMCGenFracAfterCutsNLocMaxNMCPi0 ->SetYTitle("#it{E}_{gen} / #it{E}_{reco}");
4556  fhMCGenFracAfterCutsNLocMaxNMCPi0 ->SetXTitle("#it{E} (GeV)");
4557  outputContainer->Add(fhMCGenFracAfterCutsNLocMaxNMCPi0) ;
4558  }
4559 
4561  {
4562  for(Int_t i = 0; i < n; i++)
4563  {
4564  fhTrackMatchedDEtaNLocMax1[i] = new TH2F
4565  (Form("hTrackMatchedDEtaNLocMax1%s",pname[i].Data()),
4566  Form("d#eta of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
4567  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4568  fhTrackMatchedDEtaNLocMax1[i]->SetYTitle("d#eta");
4569  fhTrackMatchedDEtaNLocMax1[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4570 
4571  fhTrackMatchedDPhiNLocMax1[i] = new TH2F
4572  (Form("hTrackMatchedDPhiNLocMax1%s",pname[i].Data()),
4573  Form("d#phi of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
4574  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4575  fhTrackMatchedDPhiNLocMax1[i]->SetYTitle("d#phi (rad)");
4576  fhTrackMatchedDPhiNLocMax1[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4577 
4578  outputContainer->Add(fhTrackMatchedDEtaNLocMax1[i]) ;
4579  outputContainer->Add(fhTrackMatchedDPhiNLocMax1[i]) ;
4580 
4581  fhTrackMatchedDEtaNLocMax2[i] = new TH2F
4582  (Form("hTrackMatchedDEtaNLocMax2%s",pname[i].Data()),
4583  Form("d#eta of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
4584  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4585  fhTrackMatchedDEtaNLocMax2[i]->SetYTitle("d#eta");
4586  fhTrackMatchedDEtaNLocMax2[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4587 
4588  fhTrackMatchedDPhiNLocMax2[i] = new TH2F
4589  (Form("hTrackMatchedDPhiNLocMax2%s",pname[i].Data()),
4590  Form("d#phi of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
4591  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4592  fhTrackMatchedDPhiNLocMax2[i]->SetYTitle("d#phi (rad)");
4593  fhTrackMatchedDPhiNLocMax2[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4594 
4595  outputContainer->Add(fhTrackMatchedDEtaNLocMax2[i]) ;
4596  outputContainer->Add(fhTrackMatchedDPhiNLocMax2[i]) ;
4597 
4598  fhTrackMatchedDEtaNLocMaxN[i] = new TH2F
4599  (Form("hTrackMatchedDEtaNLocMaxN%s",pname[i].Data()),
4600  Form("d#eta of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
4601  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4602  fhTrackMatchedDEtaNLocMaxN[i]->SetYTitle("d#eta");
4603  fhTrackMatchedDEtaNLocMaxN[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4604 
4605  fhTrackMatchedDPhiNLocMaxN[i] = new TH2F
4606  (Form("hTrackMatchedDPhiNLocMaxN%s",pname[i].Data()),
4607  Form("d#phi of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
4608  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4609  fhTrackMatchedDPhiNLocMaxN[i]->SetYTitle("d#phi (rad)");
4610  fhTrackMatchedDPhiNLocMaxN[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4611 
4612  outputContainer->Add(fhTrackMatchedDEtaNLocMaxN[i]) ;
4613  outputContainer->Add(fhTrackMatchedDPhiNLocMaxN[i]) ;
4614 
4615  fhTrackMatchedDEtaNLocMax1Pos[i] = new TH2F
4616  (Form("hTrackMatchedDEtaNLocMax1Pos%s",pname[i].Data()),
4617  Form("d#eta of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
4618  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4619  fhTrackMatchedDEtaNLocMax1Pos[i]->SetYTitle("d#eta");
4620  fhTrackMatchedDEtaNLocMax1Pos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4621 
4622  fhTrackMatchedDPhiNLocMax1Pos[i] = new TH2F
4623  (Form("hTrackMatchedDPhiNLocMax1Pos%s",pname[i].Data()),
4624  Form("d#phi of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
4625  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4626  fhTrackMatchedDPhiNLocMax1Pos[i]->SetYTitle("d#phi (rad)");
4627  fhTrackMatchedDPhiNLocMax1Pos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4628 
4629  outputContainer->Add(fhTrackMatchedDEtaNLocMax1Pos[i]) ;
4630  outputContainer->Add(fhTrackMatchedDPhiNLocMax1Pos[i]) ;
4631 
4632  fhTrackMatchedDEtaNLocMax2Pos[i] = new TH2F
4633  (Form("hTrackMatchedDEtaNLocMax2Pos%s",pname[i].Data()),
4634  Form("d#eta of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
4635  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4636  fhTrackMatchedDEtaNLocMax2Pos[i]->SetYTitle("d#eta");
4637  fhTrackMatchedDEtaNLocMax2Pos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4638 
4639  fhTrackMatchedDPhiNLocMax2Pos[i] = new TH2F
4640  (Form("hTrackMatchedDPhiNLocMax2Pos%s",pname[i].Data()),
4641  Form("d#phi of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
4642  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4643  fhTrackMatchedDPhiNLocMax2Pos[i]->SetYTitle("d#phi (rad)");
4644  fhTrackMatchedDPhiNLocMax2Pos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4645 
4646  outputContainer->Add(fhTrackMatchedDEtaNLocMax2Pos[i]) ;
4647  outputContainer->Add(fhTrackMatchedDPhiNLocMax2Pos[i]) ;
4648 
4649  fhTrackMatchedDEtaNLocMaxNPos[i] = new TH2F
4650  (Form("hTrackMatchedDEtaNLocMaxNPos%s",pname[i].Data()),
4651  Form("d#eta of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
4652  nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
4653  fhTrackMatchedDEtaNLocMaxNPos[i]->SetYTitle("d#eta");
4654  fhTrackMatchedDEtaNLocMaxNPos[i]->SetXTitle("#it{E}_{cluster} (GeV)");
4655 
4656  fhTrackMatchedDPhiNLocMaxNPos[i] = new TH2F
4657  (Form("hTrackMatchedDPhiNLocMaxNPos%s",pname[i].Data()),
4658  Form("d#phi of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
4659  nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
4660  fhTrackMatchedDPhiNLocMaxNPos[i]->SetYTitle("d#phi (rad)");
4661