]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/CaloTrackCorrelations/AliAnaInsideClusterInvariantMass.cxx
14bbb8af5495debeca32d4ff846d47e67ea49219
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaInsideClusterInvariantMass.cxx
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 //_________________________________________________________________________
17 //
18 // Split clusters with some criteria and calculate invariant mass
19 // to identify them as pi0 or conversion
20 //
21 //
22 //-- Author: Gustavo Conesa (LPSC-Grenoble)  
23 //_________________________________________________________________________
24
25 //////////////////////////////////////////////////////////////////////////////
26   
27   
28 // --- ROOT system --- 
29 #include <TList.h>
30 #include <TClonesArray.h>
31 #include <TObjString.h>
32 #include <TH2F.h>
33
34 // --- Analysis system --- 
35 #include "AliAnaInsideClusterInvariantMass.h" 
36 #include "AliCaloTrackReader.h"
37 #include "AliMCAnalysisUtils.h"
38 #include "AliStack.h"
39 #include "AliFiducialCut.h"
40 #include "TParticle.h"
41 #include "AliVCluster.h"
42 #include "AliAODEvent.h"
43 #include "AliAODMCParticle.h"
44 #include "AliEMCALGeoParams.h"
45
46 // --- Detectors --- 
47 //#include "AliPHOSGeoUtils.h"
48 #include "AliEMCALGeometry.h"
49
50 ClassImp(AliAnaInsideClusterInvariantMass)
51   
52 //__________________________________________________________________
53 AliAnaInsideClusterInvariantMass::AliAnaInsideClusterInvariantMass() : 
54   AliAnaCaloTrackCorrBaseClass(),  
55   fCalorimeter(""), 
56   fM02MaxCut(0),    fM02MinCut(0),       
57   fMinNCells(0),    fMinBadDist(0)
58 {
59   //default ctor
60   
61   // Init array of histograms
62   for(Int_t i = 0; i < 7; i++)
63   {
64     for(Int_t j = 0; j < 2; j++)
65     {
66       
67       fhMassNLocMax1[i][j]  = 0;
68       fhMassNLocMax2[i][j]  = 0;
69       fhMassNLocMaxN[i][j]  = 0;
70       fhNLocMax[i][j]       = 0;
71       fhNLocMaxM02Cut[i][j] = 0;
72       fhM02NLocMax1[i][j]   = 0;
73       fhM02NLocMax2[i][j]   = 0;
74       fhM02NLocMaxN[i][j]   = 0;
75       fhNCellNLocMax1[i][j] = 0;
76       fhNCellNLocMax2[i][j] = 0;
77       fhNCellNLocMaxN[i][j] = 0;
78       fhM02Pi0LocMax1[i][j] = 0;
79       fhM02EtaLocMax1[i][j] = 0;
80       fhM02ConLocMax1[i][j] = 0;
81       fhM02Pi0LocMax2[i][j] = 0;
82       fhM02EtaLocMax2[i][j] = 0;
83       fhM02ConLocMax2[i][j] = 0;
84       fhM02Pi0LocMaxN[i][j] = 0;
85       fhM02EtaLocMaxN[i][j] = 0;
86       fhM02ConLocMaxN[i][j] = 0;
87       
88       fhMassM02NLocMax1[i][j]= 0;
89       fhMassM02NLocMax2[i][j]= 0;
90       fhMassM02NLocMaxN[i][j]= 0;      
91       
92     }
93     
94     fhTrackMatchedDEtaLocMax1[i] = 0; 
95     fhTrackMatchedDPhiLocMax1[i] = 0;
96     fhTrackMatchedDEtaLocMax2[i] = 0;
97     fhTrackMatchedDPhiLocMax2[i] = 0; 
98     fhTrackMatchedDEtaLocMaxN[i] = 0; 
99     fhTrackMatchedDPhiLocMaxN[i] = 0; 
100     
101   }
102    
103   for(Int_t i = 0; i < 2; i++)
104   {
105     fhAnglePairLocMax1    [i] = 0;
106     fhAnglePairLocMax2    [i] = 0;
107     fhAnglePairLocMaxN    [i] = 0;
108     fhAnglePairMassLocMax1[i] = 0;
109     fhAnglePairMassLocMax2[i] = 0;
110     fhAnglePairMassLocMaxN[i] = 0;
111   }
112   
113   for(Int_t i = 0; i < 4; i++)
114   {
115     fhMassM02NLocMax1Ebin[i] = 0 ;
116     fhMassM02NLocMax2Ebin[i] = 0 ;
117     fhMassM02NLocMaxNEbin[i] = 0 ;
118   }
119   
120   InitParameters();
121   
122 }
123
124 //_______________________________________________________________
125 TObjString *  AliAnaInsideClusterInvariantMass::GetAnalysisCuts()
126 {       
127         //Save parameters used for analysis
128   TString parList ; //this will be list of parameters used for this analysis.
129   const Int_t buffersize = 255;
130   char onePar[buffersize] ;
131   
132   snprintf(onePar,buffersize,"--- AliAnaInsideClusterInvariantMass ---\n") ;
133   parList+=onePar ;     
134   
135   snprintf(onePar,buffersize,"Calorimeter: %s\n",        fCalorimeter.Data()) ;
136   parList+=onePar ;
137   snprintf(onePar,buffersize,"fLocMaxCutE =%2.2f \n",    GetCaloUtils()->GetLocalMaximaCutE()) ;
138   parList+=onePar ;
139   snprintf(onePar,buffersize,"fLocMaxCutEDiff =%2.2f \n",GetCaloUtils()->GetLocalMaximaCutEDiff()) ;
140   parList+=onePar ;
141   snprintf(onePar,buffersize,"%2.2f< M02 < %2.2f \n",    fM02MinCut, fM02MaxCut) ;
142   parList+=onePar ;
143   snprintf(onePar,buffersize,"fMinNCells =%d \n",        fMinNCells) ;
144   parList+=onePar ;    
145   snprintf(onePar,buffersize,"fMinBadDist =%1.1f \n",    fMinBadDist) ;
146   parList+=onePar ;  
147
148   return new TObjString(parList) ;
149   
150 }
151
152 //________________________________________________________________
153 TList * AliAnaInsideClusterInvariantMass::GetCreateOutputObjects()
154 {  
155   // Create histograms to be saved in output file and 
156   // store them in outputContainer
157   TList * outputContainer = new TList() ; 
158   outputContainer->SetName("InsideClusterHistos") ; 
159   
160   Int_t nptbins  = GetHistogramRanges()->GetHistoPtBins();           Float_t ptmax  = GetHistogramRanges()->GetHistoPtMax();           Float_t ptmin  = GetHistogramRanges()->GetHistoPtMin();
161   Int_t ssbins   = GetHistogramRanges()->GetHistoShowerShapeBins();  Float_t ssmax  = GetHistogramRanges()->GetHistoShowerShapeMax();  Float_t ssmin  = GetHistogramRanges()->GetHistoShowerShapeMin();
162   Int_t mbins    = GetHistogramRanges()->GetHistoMassBins();         Float_t mmax   = GetHistogramRanges()->GetHistoMassMax();         Float_t mmin   = GetHistogramRanges()->GetHistoMassMin();
163   Int_t ncbins   = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t   ncmax  = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t   ncmin  = GetHistogramRanges()->GetHistoNClusterCellMin(); 
164
165   Int_t   nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();          
166   Float_t resetamax   = GetHistogramRanges()->GetHistoTrackResidualEtaMax();          
167   Float_t resetamin   = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
168   Int_t   nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();          
169   Float_t resphimax   = GetHistogramRanges()->GetHistoTrackResidualPhiMax();          
170   Float_t resphimin   = GetHistogramRanges()->GetHistoTrackResidualPhiMin();  
171   
172   TString ptype[] ={"","#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"}; 
173   TString pname[] ={"","Photon","Conversion",     "Pi0",    "Eta", "Electron","Hadron"};
174   
175   Int_t n = 1;
176   
177   if(IsDataMC()) n = 7;
178   
179   Int_t nMaxBins = 10;
180   
181   TString sMatched[] = {"","Matched"};
182   
183   for(Int_t i = 0; i < n; i++)
184   {  
185     
186     for(Int_t j = 0; j < 2; j++)
187     {  
188       
189       fhMassNLocMax1[i][j]  = new TH2F(Form("hMassNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
190                                        Form("Invariant mass of 2 highest energy cells vs E, %s %s",ptype[i].Data(),sMatched[j].Data()),
191                                        nptbins,ptmin,ptmax,mbins,mmin,mmax); 
192       fhMassNLocMax1[i][j]->SetYTitle("M (GeV/c^{2})");
193       fhMassNLocMax1[i][j]->SetXTitle("E (GeV)");
194       outputContainer->Add(fhMassNLocMax1[i][j]) ;   
195       
196       fhMassNLocMax2[i][j]  = new TH2F(Form("hMassNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
197                                        Form("Invariant mass of 2 local maxima cells vs E,%s %s",ptype[i].Data(),sMatched[j].Data()),
198                                        nptbins,ptmin,ptmax,mbins,mmin,mmax); 
199       fhMassNLocMax2[i][j]->SetYTitle("M (GeV/c^{2})");
200       fhMassNLocMax2[i][j]->SetXTitle("E (GeV)");
201       outputContainer->Add(fhMassNLocMax2[i][j]) ;   
202       
203       fhMassNLocMaxN[i][j]  = new TH2F(Form("hMassNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
204                                        Form("Invariant mass of N>2 local maxima cells vs E, %s %s",ptype[i].Data(),sMatched[j].Data()),
205                                        nptbins,ptmin,ptmax,mbins,mmin,mmax); 
206       fhMassNLocMaxN[i][j]->SetYTitle("M (GeV/c^{2})");
207       fhMassNLocMaxN[i][j]->SetXTitle("E (GeV)");
208       outputContainer->Add(fhMassNLocMaxN[i][j]) ;   
209       
210       fhMassM02NLocMax1[i][j]  = new TH2F(Form("hMassM02NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
211                                           Form("Invariant mass of 2 highest energy cells #lambda_{0}^{2}, E > 7 GeV,%s %s",ptype[i].Data(),sMatched[j].Data()),
212                                           ssbins,ssmin,ssmax,mbins,mmin,mmax); 
213       fhMassM02NLocMax1[i][j]->SetYTitle("M (GeV/c^{2})");
214       fhMassM02NLocMax1[i][j]->SetXTitle("#lambda_{0}^{2}");
215       outputContainer->Add(fhMassM02NLocMax1[i][j]) ;   
216       
217       fhMassM02NLocMax2[i][j]  = new TH2F(Form("hMassM02NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
218                                           Form("Invariant mass of 2 local maxima cells #lambda_{0}^{2}, E > 7 GeV, %s %s",ptype[i].Data(),sMatched[j].Data()),
219                                           ssbins,ssmin,ssmax,mbins,mmin,mmax); 
220       fhMassM02NLocMax2[i][j]->SetYTitle("M (GeV/c^{2})");
221       fhMassM02NLocMax2[i][j]->SetXTitle("#lambda_{0}^{2}");
222       outputContainer->Add(fhMassM02NLocMax2[i][j]) ;   
223       
224       fhMassM02NLocMaxN[i][j]  = new TH2F(Form("hMassM02NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
225                                           Form("Invariant mass of N>2 local maxima cells vs #lambda_{0}^{2}, %s %s",ptype[i].Data(),sMatched[j].Data()),
226                                           ssbins,ssmin,ssmax,mbins,mmin,mmax); 
227       fhMassM02NLocMaxN[i][j]->SetYTitle("M (GeV/c^{2})");
228       fhMassM02NLocMaxN[i][j]->SetXTitle("#lambda_{0}^{2}");
229       outputContainer->Add(fhMassM02NLocMaxN[i][j]) ;   
230       
231       
232       fhNLocMax[i][j]     = new TH2F(Form("hNLocMax%s%s",pname[i].Data(),sMatched[j].Data()),
233                                      Form("Number of local maxima in cluster %s %s",ptype[i].Data(),sMatched[j].Data()),
234                                      nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins); 
235       fhNLocMax[i][j]   ->SetYTitle("N maxima");
236       fhNLocMax[i][j]   ->SetXTitle("E (GeV)");
237       outputContainer->Add(fhNLocMax[i][j]) ; 
238             
239       fhNLocMaxM02Cut[i][j] = new TH2F(Form("hNLocMaxM02Cut%s%s",pname[i].Data(),sMatched[j].Data()),
240                                        Form("Number of local maxima in cluster %s for %2.2f < M02 < %2.2f",ptype[i].Data(),fM02MinCut,fM02MaxCut),
241                                        nptbins,ptmin,ptmax,nMaxBins,0,nMaxBins); 
242       fhNLocMaxM02Cut[i][j]->SetYTitle("N maxima");
243       fhNLocMaxM02Cut[i][j]->SetXTitle("E (GeV)");
244       outputContainer->Add(fhNLocMaxM02Cut[i][j]) ; 
245       
246       
247       fhM02NLocMax1[i][j]     = new TH2F(Form("hM02NLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
248                                          Form("#lambda_{0}^{2} vs E for N max  = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
249                                          nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
250       fhM02NLocMax1[i][j]   ->SetYTitle("#lambda_{0}^{2}");
251       fhM02NLocMax1[i][j]   ->SetXTitle("E (GeV)");
252       outputContainer->Add(fhM02NLocMax1[i][j]) ; 
253       
254       fhM02NLocMax2[i][j]     = new TH2F(Form("hM02NLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
255                                          Form("#lambda_{0}^{2} vs E for N max  = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
256                                          nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
257       fhM02NLocMax2[i][j]   ->SetYTitle("#lambda_{0}^{2}");
258       fhM02NLocMax2[i][j]   ->SetXTitle("E (GeV)");
259       outputContainer->Add(fhM02NLocMax2[i][j]) ; 
260       
261       
262       fhM02NLocMaxN[i][j]    = new TH2F(Form("hM02NLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
263                                         Form("#lambda_{0}^{2} vs E for N max  > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
264                                         nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
265       fhM02NLocMaxN[i][j]   ->SetYTitle("#lambda_{0}^{2}");
266       fhM02NLocMaxN[i][j]   ->SetXTitle("E (GeV)");
267       outputContainer->Add(fhM02NLocMaxN[i][j]) ; 
268       
269       
270       fhNCellNLocMax1[i][j]  = new TH2F(Form("hNCellNLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
271                                         Form("#lambda_{0}^{2} vs E for N max  = 1 %s %s",ptype[i].Data(),sMatched[j].Data()),
272                                         nptbins,ptmin,ptmax,ncbins,ncmin,ncmax); 
273       fhNCellNLocMax1[i][j] ->SetYTitle("N cells");
274       fhNCellNLocMax1[i][j] ->SetXTitle("E (GeV)");
275       outputContainer->Add(fhNCellNLocMax1[i][j]) ; 
276       
277       fhNCellNLocMax2[i][j]     = new TH2F(Form("hNCellNLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
278                                            Form("#lambda_{0}^{2} vs E for N max  = 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
279                                            nptbins,ptmin,ptmax,ncbins,ncmin,ncmax); 
280       fhNCellNLocMax2[i][j]   ->SetYTitle("N cells");
281       fhNCellNLocMax2[i][j]   ->SetXTitle("E (GeV)");
282       outputContainer->Add(fhNCellNLocMax2[i][j]) ; 
283       
284       
285       fhNCellNLocMaxN[i][j]     = new TH2F(Form("hNCellNLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
286                                            Form("#lambda_{0}^{2} vs E for N max  > 2 %s %s",ptype[i].Data(),sMatched[j].Data()),
287                                            nptbins,ptmin,ptmax,ncbins,ncmin,ncmax); 
288       fhNCellNLocMaxN[i][j]   ->SetYTitle("N cells");
289       fhNCellNLocMaxN[i][j]   ->SetXTitle("E (GeV)");
290       outputContainer->Add(fhNCellNLocMaxN[i][j]) ;
291       
292       
293       fhM02Pi0LocMax1[i][j]     = new TH2F(Form("hM02Pi0LocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
294                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2} %s, for N Local max = 1",
295                                                 GetCaloPID()->GetPi0MinMass(),GetCaloPID()->GetPi0MaxMass(),ptype[i].Data()),
296                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
297       fhM02Pi0LocMax1[i][j]   ->SetYTitle("#lambda_{0}^{2}");
298       fhM02Pi0LocMax1[i][j]   ->SetXTitle("E (GeV)");
299       outputContainer->Add(fhM02Pi0LocMax1[i][j]) ; 
300       
301       fhM02EtaLocMax1[i][j]     = new TH2F(Form("hM02EtaLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
302                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2}, %s, for N Local max = 1",
303                                                 GetCaloPID()->GetEtaMinMass(),GetCaloPID()->GetEtaMaxMass(),ptype[i].Data()),
304                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
305       fhM02EtaLocMax1[i][j]   ->SetYTitle("#lambda_{0}^{2}");
306       fhM02EtaLocMax1[i][j]   ->SetXTitle("E (GeV)");
307       outputContainer->Add(fhM02EtaLocMax1[i][j]) ; 
308       
309       fhM02ConLocMax1[i][j]    = new TH2F(Form("hM02ConLocMax1%s%s",pname[i].Data(),sMatched[j].Data()),
310                                           Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2}, %s, for N Local max = 1",
311                                                GetCaloPID()->GetPhotonMinMass(),GetCaloPID()->GetPhotonMaxMass(),ptype[i].Data()),
312                                           nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
313       fhM02ConLocMax1[i][j]   ->SetYTitle("#lambda_{0}^{2}");
314       fhM02ConLocMax1[i][j]   ->SetXTitle("E (GeV)");
315       outputContainer->Add(fhM02ConLocMax1[i][j]) ; 
316       
317       fhM02Pi0LocMax2[i][j]     = new TH2F(Form("hM02Pi0LocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
318                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2} %s, for N Local max = 2",
319                                                 GetCaloPID()->GetPi0MinMass(),GetCaloPID()->GetPi0MaxMass(),ptype[i].Data()),
320                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
321       fhM02Pi0LocMax2[i][j]   ->SetYTitle("#lambda_{0}^{2}");
322       fhM02Pi0LocMax2[i][j]   ->SetXTitle("E (GeV)");
323       outputContainer->Add(fhM02Pi0LocMax2[i][j]) ; 
324       
325       fhM02EtaLocMax2[i][j]     = new TH2F(Form("hM02EtaLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
326                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2}, %s, for N Local max = 2",
327                                                GetCaloPID()->GetEtaMinMass(),GetCaloPID()->GetEtaMaxMass(),ptype[i].Data()),
328                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
329       fhM02EtaLocMax2[i][j]   ->SetYTitle("#lambda_{0}^{2}");
330       fhM02EtaLocMax2[i][j]   ->SetXTitle("E (GeV)");
331       outputContainer->Add(fhM02EtaLocMax2[i][j]) ; 
332       
333       fhM02ConLocMax2[i][j]    = new TH2F(Form("hM02ConLocMax2%s%s",pname[i].Data(),sMatched[j].Data()),
334                                           Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2}, %s, for N Local max = 2",
335                                                GetCaloPID()->GetPhotonMinMass(),GetCaloPID()->GetPhotonMaxMass(),ptype[i].Data()),
336                                           nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
337       fhM02ConLocMax2[i][j]   ->SetYTitle("#lambda_{0}^{2}");
338       fhM02ConLocMax2[i][j]   ->SetXTitle("E (GeV)");
339       outputContainer->Add(fhM02ConLocMax2[i][j]) ; 
340       
341       fhM02Pi0LocMaxN[i][j]     = new TH2F(Form("hM02Pi0LocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
342                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2} %s, for N Local max > 2",
343                                                 GetCaloPID()->GetPi0MinMass(),GetCaloPID()->GetPi0MaxMass(),ptype[i].Data()),
344                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
345       fhM02Pi0LocMaxN[i][j]   ->SetYTitle("#lambda_{0}^{2}");
346       fhM02Pi0LocMaxN[i][j]   ->SetXTitle("E (GeV)");
347       outputContainer->Add(fhM02Pi0LocMaxN[i][j]) ; 
348       
349       fhM02EtaLocMaxN[i][j]     = new TH2F(Form("hM02EtaLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
350                                            Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f] MeV/c^{2}, %s, for N Local max > 2", 
351                                                 GetCaloPID()->GetEtaMinMass(),GetCaloPID()->GetEtaMaxMass(),ptype[i].Data()),
352                                            nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
353       fhM02EtaLocMaxN[i][j]   ->SetYTitle("#lambda_{0}^{2}");
354       fhM02EtaLocMaxN[i][j]   ->SetXTitle("E (GeV)");
355       outputContainer->Add(fhM02EtaLocMaxN[i][j]) ; 
356       
357       fhM02ConLocMaxN[i][j]    = new TH2F(Form("hM02ConLocMaxN%s%s",pname[i].Data(),sMatched[j].Data()),
358                                           Form("#lambda_{0}^{2} vs E for mass range [%2.2f-%2.2f], %s, for N Local max > 2",
359                                                GetCaloPID()->GetPhotonMinMass(),GetCaloPID()->GetPhotonMaxMass(),ptype[i].Data()),
360                                           nptbins,ptmin,ptmax,ssbins,ssmin,ssmax); 
361       fhM02ConLocMaxN[i][j]   ->SetYTitle("#lambda_{0}^{2}");
362       fhM02ConLocMaxN[i][j]   ->SetXTitle("E (GeV)");
363       outputContainer->Add(fhM02ConLocMaxN[i][j]) ; 
364       
365     } // matched, not matched
366     
367     
368   } // MC particle list
369  
370   for(Int_t i = 0; i < 4; i++)
371   {  
372     fhMassM02NLocMax1Ebin[i]  = new TH2F(Form("hMassM02NLocMax1Ebin%d",i),
373                                         Form("Invariant mass of 2 highest energy cells #lambda_{0}^{2}, E bin %d",i),
374                                         ssbins,ssmin,ssmax,mbins,mmin,mmax); 
375     fhMassM02NLocMax1Ebin[i]->SetYTitle("M (GeV/c^{2})");
376     fhMassM02NLocMax1Ebin[i]->SetXTitle("#lambda_{0}^{2}");
377     outputContainer->Add(fhMassM02NLocMax1Ebin[i]) ;   
378     
379     fhMassM02NLocMax2Ebin[i]  = new TH2F(Form("hMassM02NLocMax2Ebin%d",i),
380                                         Form("Invariant mass of 2 local maxima cells #lambda_{0}^{2}, E bin %d",i),
381                                         ssbins,ssmin,ssmax,mbins,mmin,mmax); 
382     fhMassM02NLocMax2Ebin[i]->SetYTitle("M (GeV/c^{2})");
383     fhMassM02NLocMax2Ebin[i]->SetXTitle("#lambda_{0}^{2}");
384     outputContainer->Add(fhMassM02NLocMax2Ebin[i]) ;   
385     
386     fhMassM02NLocMaxNEbin[i]  = new TH2F(Form("hMassM02NLocMaxNEbin%d",i),
387                                         Form("Invariant mass of N>2 local maxima cells vs #lambda_{0}^{2}, E bin %d",i),
388                                         ssbins,ssmin,ssmax,mbins,mmin,mmax); 
389     fhMassM02NLocMaxNEbin[i]->SetYTitle("M (GeV/c^{2})");
390     fhMassM02NLocMaxNEbin[i]->SetXTitle("#lambda_{0}^{2}");
391     outputContainer->Add(fhMassM02NLocMaxNEbin[i]) ;   
392   }  
393   
394   for(Int_t i = 0; i < n; i++)
395   {  
396     fhTrackMatchedDEtaLocMax1[i]  = new TH2F
397     (Form("hTrackMatchedDEtaLocMax1%s",pname[i].Data()),
398      Form("d#eta of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
399      nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
400     fhTrackMatchedDEtaLocMax1[i]->SetYTitle("d#eta");
401     fhTrackMatchedDEtaLocMax1[i]->SetXTitle("E_{cluster} (GeV)");
402     
403     fhTrackMatchedDPhiLocMax1[i]  = new TH2F
404     (Form("hTrackMatchedDPhiLocMax1%s",pname[i].Data()),
405      Form("d#phi of cluster-track vs cluster energy, 1 Local Maxima, %s",ptype[i].Data()),
406      nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
407     fhTrackMatchedDPhiLocMax1[i]->SetYTitle("d#phi (rad)");
408     fhTrackMatchedDPhiLocMax1[i]->SetXTitle("E_{cluster} (GeV)");
409     
410     outputContainer->Add(fhTrackMatchedDEtaLocMax1[i]) ; 
411     outputContainer->Add(fhTrackMatchedDPhiLocMax1[i]) ;
412
413     fhTrackMatchedDEtaLocMax2[i]  = new TH2F
414     (Form("hTrackMatchedDEtaLocMax2%s",pname[i].Data()),
415      Form("d#eta of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
416      nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
417     fhTrackMatchedDEtaLocMax2[i]->SetYTitle("d#eta");
418     fhTrackMatchedDEtaLocMax2[i]->SetXTitle("E_{cluster} (GeV)");
419     
420     fhTrackMatchedDPhiLocMax2[i]  = new TH2F
421     (Form("hTrackMatchedDPhiLocMax2%s",pname[i].Data()),
422      Form("d#phi of cluster-track vs cluster energy, 2 Local Maxima, %s",ptype[i].Data()),
423      nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
424     fhTrackMatchedDPhiLocMax2[i]->SetYTitle("d#phi (rad)");
425     fhTrackMatchedDPhiLocMax2[i]->SetXTitle("E_{cluster} (GeV)");
426     
427     outputContainer->Add(fhTrackMatchedDEtaLocMax2[i]) ; 
428     outputContainer->Add(fhTrackMatchedDPhiLocMax2[i]) ;
429
430     fhTrackMatchedDEtaLocMaxN[i]  = new TH2F
431     (Form("hTrackMatchedDEtaLocMaxN%s",pname[i].Data()),
432      Form("d#eta of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
433      nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax); 
434     fhTrackMatchedDEtaLocMaxN[i]->SetYTitle("d#eta");
435     fhTrackMatchedDEtaLocMaxN[i]->SetXTitle("E_{cluster} (GeV)");
436     
437     fhTrackMatchedDPhiLocMaxN[i]  = new TH2F
438     (Form("hTrackMatchedDPhiLocMaxN%s",pname[i].Data()),
439      Form("d#phi of cluster-track vs cluster energy, N>2 Local Maxima, %s",ptype[i].Data()),
440      nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax); 
441     fhTrackMatchedDPhiLocMaxN[i]->SetYTitle("d#phi (rad)");
442     fhTrackMatchedDPhiLocMaxN[i]->SetXTitle("E_{cluster} (GeV)");
443     
444     outputContainer->Add(fhTrackMatchedDEtaLocMaxN[i]) ; 
445     outputContainer->Add(fhTrackMatchedDPhiLocMaxN[i]) ;    
446     
447   }
448   
449   for(Int_t j = 0; j < 2; j++)
450   {  
451     
452     fhAnglePairLocMax1[j]  = new TH2F(Form("hAnglePairLocMax1%s",sMatched[j].Data()),
453                                       Form("Opening angle of 2 highest energy cells vs pair Energy, %s",sMatched[j].Data()),
454                                       nptbins,ptmin,ptmax,200,0,0.2); 
455     fhAnglePairLocMax1[j]->SetYTitle("#alpha (rad)");
456     fhAnglePairLocMax1[j]->SetXTitle("E (GeV)");
457     outputContainer->Add(fhAnglePairLocMax1[j]) ;   
458     
459     fhAnglePairLocMax2[j]  = new TH2F(Form("hAnglePairLocMax2%s",sMatched[j].Data()),
460                                       Form("Opening angle of 2 local maxima cells vs Energy, %s",sMatched[j].Data()),
461                                       nptbins,ptmin,ptmax,200,0,0.2); 
462     fhAnglePairLocMax2[j]->SetYTitle("#alpha (rad)");
463     fhAnglePairLocMax2[j]->SetXTitle("E (GeV)");
464     outputContainer->Add(fhAnglePairLocMax2[j]) ;   
465     
466     fhAnglePairLocMaxN[j]  = new TH2F(Form("hAnglePairLocMaxN%s",sMatched[j].Data()),
467                                       Form("Opening angle of N>2 local maxima cells vs Energy, %s",sMatched[j].Data()),
468                                       nptbins,ptmin,ptmax,200,0,0.2); 
469     fhAnglePairLocMaxN[j]->SetYTitle("#alpha (rad)");
470     fhAnglePairLocMaxN[j]->SetXTitle("E (GeV)");
471     outputContainer->Add(fhAnglePairLocMaxN[j]) ;   
472     
473     fhAnglePairMassLocMax1[j]  = new TH2F(Form("hAnglePairMassLocMax1%s",sMatched[j].Data()),
474                                           Form("Opening angle of 2 highest energy cells vs Mass for E > 7 GeV, %s",sMatched[j].Data()),
475                                           mbins,mmin,mmax,200,0,0.2); 
476     fhAnglePairMassLocMax1[j]->SetXTitle("M (GeV/c^{2})");
477     fhAnglePairMassLocMax1[j]->SetYTitle("#alpha (rad)");
478     outputContainer->Add(fhAnglePairMassLocMax1[j]) ;   
479     
480     fhAnglePairMassLocMax2[j]  = new TH2F(Form("hAnglePairMassLocMax2%s",sMatched[j].Data()),
481                                           Form("Opening angle of 2 local maxima cells vs Mass for E > 7 GeV, %s",sMatched[j].Data()),
482                                           mbins,mmin,mmax,200,0,0.2); 
483     fhAnglePairMassLocMax2[j]->SetXTitle("M (GeV/c^{2})");
484     fhAnglePairMassLocMax2[j]->SetYTitle("#alpha (rad)");
485     outputContainer->Add(fhAnglePairMassLocMax2[j]) ;   
486     
487     fhAnglePairMassLocMaxN[j]  = new TH2F(Form("hAnglePairMassLocMaxN%s",sMatched[j].Data()),
488                                           Form("Opening angle of N>2 local maxima cells vs Mass for E > 7 GeV, %s",sMatched[j].Data()),
489                                           mbins,mmin,mmax,200,0,0.2); 
490     fhAnglePairMassLocMaxN[j]->SetXTitle("M (GeV/c^{2})");
491     fhAnglePairMassLocMaxN[j]->SetYTitle("#alpha (rad)");
492     outputContainer->Add(fhAnglePairMassLocMaxN[j]) ;  
493     
494   }
495   
496   return outputContainer ;
497   
498 }
499
500 //___________________________________________
501 void AliAnaInsideClusterInvariantMass::Init()
502
503   //Init
504   //Do some checks
505   if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
506   {
507     printf("AliAnaInsideClusterInvariantMass::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
508     abort();
509   }
510   else  if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
511   {
512     printf("AliAnaInsideClusterInvariantMass::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
513     abort();
514   }
515   
516   if( GetReader()->GetDataType() == AliCaloTrackReader::kMC )
517   {
518     printf("AliAnaInsideClusterInvariantMass::Init() - !!STOP: You want to use pure MC data!!\n");
519     abort();
520     
521   }
522   
523 }
524
525 //_____________________________________________________
526 void AliAnaInsideClusterInvariantMass::InitParameters()
527 {
528   //Initialize the parameters of the analysis.  
529   AddToHistogramsName("AnaPi0InsideClusterInvariantMass_");
530   
531   fCalorimeter = "EMCAL" ;
532
533   fM02MinCut   = 0.26 ;
534   fM02MaxCut   = 10 ;
535   
536   fMinNCells   = 4 ;
537   fMinBadDist  = 2 ;
538     
539 }
540
541
542 //__________________________________________________________________
543 void  AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms() 
544 {
545   //Search for pi0 in fCalorimeter with shower shape analysis 
546   
547   TObjArray * pl       = 0x0; 
548   AliVCaloCells* cells = 0x0;
549
550   //Select the Calorimeter of the photon
551   if(fCalorimeter == "PHOS")
552   {
553     pl    = GetPHOSClusters();
554     cells = GetPHOSCells();
555   }
556   else if (fCalorimeter == "EMCAL")
557   {
558     pl    = GetEMCALClusters();
559     cells = GetEMCALCells();
560   }
561   
562   if(!pl || !cells) 
563   {
564     Info("MakeAnalysisFillHistograms","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
565     return;
566   }  
567   
568         if(fCalorimeter == "PHOS") return; // Not implemented for PHOS yet
569
570   for(Int_t icluster = 0; icluster < pl->GetEntriesFast(); icluster++)
571   {
572     AliVCluster * cluster = (AliVCluster*) (pl->At(icluster));  
573
574     // Study clusters with large shape parameter
575     Float_t en = cluster->E();
576     Float_t l0 = cluster->GetM02();
577     Int_t   nc = cluster->GetNCells();
578     Float_t bd = cluster->GetDistanceToBadChannel() ; 
579
580     //If too small or big E or low number of cells, or close to a bad channel skip it
581     if( en < GetMinEnergy() || en > GetMaxEnergy() || nc < fMinNCells || bd < fMinBadDist) continue ; 
582     
583     //printf("en %2.2f, GetMinEnergy() %2.2f, GetMaxEnergy() %2.2f, nc %d, fMinNCells %d,  bd %2.2f, fMinBadDist %2.2f\n",
584     //       en,GetMinEnergy(), GetMaxEnergy(), nc, fMinNCells, bd, fMinBadDist);
585     
586    
587     Int_t    nMax = 0;
588     Double_t mass = 0;
589     Double_t angle= 0;
590     Int_t pidTag = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(cluster,cells,GetCaloUtils(),
591                                                                                GetVertex(0), nMax, mass, angle);
592                                                                     
593     if (nMax <= 0) 
594     {
595       if(GetDebug() > 0 )
596         printf("AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms() - No local maximum found! It did not pass CaloPID selection criteria \n");
597       
598       return;
599     }
600     
601     Bool_t   matched   = IsTrackMatched(cluster,GetReader()->GetInputEvent());
602     
603     fhNLocMax[0][matched]->Fill(en,nMax);
604     
605     if     ( nMax == 1  ) { fhM02NLocMax1[0][matched]->Fill(en,l0) ; fhNCellNLocMax1[0][matched]->Fill(en,nc) ; }
606     else if( nMax == 2  ) { fhM02NLocMax2[0][matched]->Fill(en,l0) ; fhNCellNLocMax2[0][matched]->Fill(en,nc) ; }
607     else if( nMax >= 3  ) { fhM02NLocMaxN[0][matched]->Fill(en,l0) ; fhNCellNLocMaxN[0][matched]->Fill(en,nc) ; }
608     else printf("N max smaller than 1 -> %d \n",nMax);
609     
610     Float_t dZ  = cluster->GetTrackDz();
611     Float_t dR  = cluster->GetTrackDx();
612     
613     if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
614     {
615       dR = 2000., dZ = 2000.;
616       GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
617     }    
618     //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
619     
620     if(TMath::Abs(dR) < 999)
621     {
622       if     ( nMax == 1  ) { fhTrackMatchedDEtaLocMax1[0]->Fill(en,dZ); fhTrackMatchedDPhiLocMax1[0]->Fill(en,dR); }
623       else if( nMax == 2  ) { fhTrackMatchedDEtaLocMax2[0]->Fill(en,dZ); fhTrackMatchedDPhiLocMax2[0]->Fill(en,dR); }
624       else if( nMax >= 3  ) { fhTrackMatchedDEtaLocMaxN[0]->Fill(en,dZ); fhTrackMatchedDPhiLocMaxN[0]->Fill(en,dR); }
625     }
626
627     // Play with the MC stack if available
628     // Check origin of the candidates
629     Int_t mcindex = -1;
630     if(IsDataMC())
631     {
632       Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(), GetReader(), 0);
633             
634       if      ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0)  )      mcindex = kmcPi0;
635       else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta)  )      mcindex = kmcEta;
636       else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && 
637                !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) mcindex = kmcPhoton;
638       else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && 
639                 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion)) mcindex = kmcConversion;
640       else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))   mcindex = kmcElectron;
641       else                                                                                mcindex = kmcHadron;
642
643       fhNLocMax[mcindex][matched]->Fill(en,nMax);
644             
645       if     (nMax == 1 ) { fhM02NLocMax1[mcindex][matched]->Fill(en,l0) ; fhNCellNLocMax1[mcindex][matched]->Fill(en,nc) ; }
646       else if(nMax == 2 ) { fhM02NLocMax2[mcindex][matched]->Fill(en,l0) ; fhNCellNLocMax2[mcindex][matched]->Fill(en,nc) ; }
647       else if(nMax >= 3 ) { fhM02NLocMaxN[mcindex][matched]->Fill(en,l0) ; fhNCellNLocMaxN[mcindex][matched]->Fill(en,nc) ; }
648       
649       if(TMath::Abs(dR) < 999)
650       {
651         if     ( nMax == 1  ) { fhTrackMatchedDEtaLocMax1[mcindex]->Fill(en,dZ); fhTrackMatchedDPhiLocMax1[mcindex]->Fill(en,dR); }
652         else if( nMax == 2  ) { fhTrackMatchedDEtaLocMax2[mcindex]->Fill(en,dZ); fhTrackMatchedDPhiLocMax2[mcindex]->Fill(en,dR); }
653         else if( nMax >= 3  ) { fhTrackMatchedDEtaLocMaxN[mcindex]->Fill(en,dZ); fhTrackMatchedDPhiLocMaxN[mcindex]->Fill(en,dR); }
654       }
655       
656     }  
657
658     if     (nMax==1) 
659     { 
660       if( en > 7 ) 
661       {      
662         fhMassM02NLocMax1[0]  [matched]->Fill(l0,  mass ); 
663         if(IsDataMC()) 
664           fhMassM02NLocMax1[mcindex][matched]->Fill(l0,  mass ); 
665       }
666       
667       if(!matched)
668       {
669         if(en > 6  && en <= 10) fhMassM02NLocMax1Ebin[0]->Fill(l0,  mass ); 
670         if(en > 10 && en <= 15) fhMassM02NLocMax1Ebin[1]->Fill(l0,  mass ); 
671         if(en > 15 && en <= 20) fhMassM02NLocMax1Ebin[2]->Fill(l0,  mass ); 
672         if(en > 20)             fhMassM02NLocMax1Ebin[3]->Fill(l0,  mass ); 
673       }
674     }  
675     else if(nMax==2) 
676     {
677       if( en > 7 )
678       {
679         fhMassM02NLocMax2[0][matched]  ->Fill(l0,  mass ); 
680         if(IsDataMC()) 
681           fhMassM02NLocMax2[mcindex][matched]->Fill(l0,  mass ); 
682       }
683       
684       if(!matched)
685       {
686         if(en > 6  && en <= 10) fhMassM02NLocMax2Ebin[0]->Fill(l0,  mass ); 
687         if(en > 10 && en <= 15) fhMassM02NLocMax2Ebin[1]->Fill(l0,  mass ); 
688         if(en > 15 && en <= 20) fhMassM02NLocMax2Ebin[2]->Fill(l0,  mass ); 
689         if(en > 20)             fhMassM02NLocMax2Ebin[3]->Fill(l0,  mass );       
690       }
691     }
692     else if(nMax >2) 
693     {
694       if( en > 7 ) 
695       {      
696         fhMassM02NLocMaxN[0]  [matched]->Fill(l0  ,mass );
697         if(IsDataMC()) 
698           fhMassM02NLocMaxN[mcindex][matched]->Fill(l0,  mass ); 
699       }
700       
701       if(!matched)
702       {
703         if(en > 6  && en <= 10) fhMassM02NLocMaxNEbin[0]->Fill(l0,  mass ); 
704         if(en > 10 && en <= 15) fhMassM02NLocMaxNEbin[1]->Fill(l0,  mass ); 
705         if(en > 15 && en <= 20) fhMassM02NLocMaxNEbin[2]->Fill(l0,  mass ); 
706         if(en > 20)             fhMassM02NLocMaxNEbin[3]->Fill(l0,  mass );
707       }
708     }
709     
710     //---------------------------------------------------------------------
711     // From here only if M02 is large but not too large, fill histograms 
712     //---------------------------------------------------------------------
713     
714     if( l0 < fM02MinCut || l0 > fM02MaxCut ) continue ;
715     
716     fhNLocMaxM02Cut[0][matched]->Fill(en,nMax);
717     if(IsDataMC()) fhNLocMaxM02Cut[mcindex][matched]->Fill(en,nMax);
718     
719     if     (nMax==1) 
720     { 
721       fhAnglePairLocMax1[matched]->Fill(en,angle);
722       fhMassNLocMax1[0][matched] ->Fill(en,mass ); 
723       
724       if( en > 7 ) 
725       {      
726         fhAnglePairMassLocMax1[matched]->Fill(mass,angle);
727       }
728       
729       if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMax1[0][matched]->Fill(en,l0);
730       else if(pidTag==AliCaloPID::kPi0   ) fhM02Pi0LocMax1[0][matched]->Fill(en,l0);
731       else if(pidTag==AliCaloPID::kEta)    fhM02EtaLocMax1[0][matched]->Fill(en,l0);
732     }  
733     else if(nMax==2) 
734     {
735       fhAnglePairLocMax2[matched]->Fill(en,angle);
736       fhMassNLocMax2[0] [matched]->Fill(en,mass );
737       
738       if( en > 7 )
739       {
740         fhAnglePairMassLocMax2[matched]->Fill(mass,angle);        
741       }
742       
743       if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMax2[0][matched]->Fill(en,l0);
744       else if(pidTag==AliCaloPID::kPi0   ) fhM02Pi0LocMax2[0][matched]->Fill(en,l0);
745       else if(pidTag==AliCaloPID::kEta)    fhM02EtaLocMax2[0][matched]->Fill(en,l0);        
746     }
747     else if(nMax >2) 
748     {
749       fhAnglePairLocMaxN[matched]->Fill(en,angle);
750       fhMassNLocMaxN[0] [matched]->Fill(en,mass );
751       
752       if( en > 7 ) 
753       {      
754         fhAnglePairMassLocMaxN[matched]->Fill(mass,angle);
755       }
756       
757       if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMaxN[0][matched]->Fill(en,l0);
758       else if(pidTag==AliCaloPID::kPi0   ) fhM02Pi0LocMaxN[0][matched]->Fill(en,l0);
759       else if(pidTag==AliCaloPID::kEta   ) fhM02EtaLocMaxN[0][matched]->Fill(en,l0);
760     }
761     
762     
763     if(IsDataMC())
764     {
765       if     (nMax==1) 
766       { 
767         fhMassNLocMax1[mcindex][matched]->Fill(en,mass); 
768         if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMax1[mcindex][matched]->Fill(en,l0);
769         else if(pidTag==AliCaloPID::kPi0) fhM02Pi0LocMax1[mcindex][matched]->Fill(en,l0);
770         else if(pidTag==AliCaloPID::kEta) fhM02EtaLocMax1[mcindex][matched]->Fill(en,l0);
771       }  
772       else if(nMax==2) 
773       {
774         fhMassNLocMax2[mcindex][matched]->Fill(en,mass);
775         if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMax2[mcindex][matched]->Fill(en,l0);
776         else if(pidTag==AliCaloPID::kPi0   ) fhM02Pi0LocMax2[mcindex][matched]->Fill(en,l0);
777         else if(pidTag==AliCaloPID::kEta   ) fhM02EtaLocMax2[mcindex][matched]->Fill(en,l0);        
778       }
779       else if(nMax >2) 
780       {
781         fhMassNLocMaxN[mcindex][matched]->Fill(en,mass);
782         if     (pidTag==AliCaloPID::kPhoton) fhM02ConLocMaxN[mcindex][matched]->Fill(en,l0);
783         else if(pidTag==AliCaloPID::kPi0   ) fhM02Pi0LocMaxN[mcindex][matched]->Fill(en,l0);
784         else if(pidTag==AliCaloPID::kEta) fhM02EtaLocMaxN[mcindex][matched]->Fill(en,l0);
785       }
786       
787     }//Work with MC truth first
788     
789   }//loop
790   
791   if(GetDebug() > 1) printf("AliAnaInsideClusterInvariantMass::MakeAnalysisFillHistograms() - END \n");  
792
793 }
794
795 //______________________________________________________________________
796 void AliAnaInsideClusterInvariantMass::Print(const Option_t * opt) const
797 {
798   //Print some relevant parameters set for the analysis
799   if(! opt)
800     return;
801   
802   printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
803   AliAnaCaloTrackCorrBaseClass::Print("");
804   printf("Calorimeter     =     %s\n",  fCalorimeter.Data()) ;
805   printf("Loc. Max. E > %2.2f\n",       GetCaloUtils()->GetLocalMaximaCutE());
806   printf("Loc. Max. E Diff > %2.2f\n",  GetCaloUtils()->GetLocalMaximaCutEDiff());
807   printf("Min. N Cells =%d \n",         fMinNCells) ;
808   printf("Min. Dist. to Bad =%1.1f \n", fMinBadDist) ;
809   printf("%2.2f < lambda_0^2 <%2.2f \n",fM02MinCut,fM02MaxCut);
810  
811   printf("    \n") ;
812   
813
814
815
816