]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.cxx
Transition PWG4 --> PWGGA
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / AliAnaPi0EbE.cxx
CommitLineData
477d6cee 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 *
21a4b1c0 8 * documentation strictly for non-commercial purposes is hereby granted *
477d6cee 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 **************************************************************************/
477d6cee 15
16//_________________________________________________________________________
17// Class for the analysis of high pT pi0 event by event
09273901 18// Pi0/Eta identified by one of the following:
477d6cee 19// -Invariant mass of 2 cluster in calorimeter
20// -Shower shape analysis in calorimeter
21a4b1c0 21// -Invariant mass of one cluster in calorimeter and one photon reconstructed in CTS
477d6cee 22//
23// -- Author: Gustavo Conesa (LNF-INFN) & Raphaelle Ichou (SUBATECH)
24//////////////////////////////////////////////////////////////////////////////
25
26
27// --- ROOT system ---
28#include <TList.h>
29#include <TClonesArray.h>
0c1383b5 30#include <TObjString.h>
477d6cee 31
32// --- Analysis system ---
33#include "AliAnaPi0EbE.h"
34#include "AliCaloTrackReader.h"
35#include "AliIsolationCut.h"
36#include "AliNeutralMesonSelection.h"
37#include "AliCaloPID.h"
38#include "AliMCAnalysisUtils.h"
477d6cee 39#include "AliStack.h"
ff45398a 40#include "AliFiducialCut.h"
477d6cee 41#include "TParticle.h"
0ae57829 42#include "AliVCluster.h"
477d6cee 43#include "AliAODEvent.h"
591cc579 44#include "AliAODMCParticle.h"
477d6cee 45
46ClassImp(AliAnaPi0EbE)
47
78a28af3 48//____________________________
477d6cee 49AliAnaPi0EbE::AliAnaPi0EbE() :
09273901 50 AliAnaCaloTrackCorrBaseClass(),fAnaType(kIMCalo), fCalorimeter(""),
51 fMinDist(0.),fMinDist2(0.), fMinDist3(0.),
52 fFillWeightHistograms(kFALSE), fFillTMHisto(0),
1db06135 53 fInputAODGammaConvName(""),
521636d2 54 //Histograms
09273901 55 fhPt(0), fhE(0),
56 fhEEta(0), fhEPhi(0), fhEtaPhi(0),
57 fhPtDecay(0), fhEDecay(0),
521636d2 58 //Shower shape histos
09273901 59 fhEDispersion(0), fhELambda0(0), fhELambda1(0),
60 fhELambda0NoTRD(0), fhELambda0FracMaxCellCut(0),
61 fhEFracMaxCell(0), fhEFracMaxCellNoTRD(0),
62 fhENCells(0), fhETime(0), fhEPairDiffTime(0),
521636d2 63 //MC histos
09273901 64 fhPtMCNo(0), fhPhiMCNo(0), fhEtaMCNo(0),
65 fhPtMC(0), fhPhiMC(0), fhEtaMC(0),
78a28af3 66 // Weight studies
09273901 67 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
68 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
31ae6d59 69 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
70 fhdEdx(0), fhEOverP(0), fhTrackMatchedMCParticle(0)
477d6cee 71{
72 //default ctor
73
6db946bd 74 for(Int_t i = 0; i < 6; i++){
521636d2 75 fhEMCLambda0[i] = 0;
3bfcb597 76 fhEMCLambda0NoTRD[i]= 0;
77 fhEMCLambda0FracMaxCellCut[i]= 0;
78 fhEMCFracMaxCell[i] = 0;
521636d2 79 fhEMCLambda1[i] = 0;
80 fhEMCDispersion[i] = 0;
521636d2 81 }
82
78a28af3 83 //Weight studies
1a72f6c5 84 for(Int_t i =0; i < 14; i++){
78a28af3 85 fhLambda0ForW0[i] = 0;
1a72f6c5 86 //fhLambda1ForW0[i] = 0;
78a28af3 87 }
88
477d6cee 89 //Initialize parameters
90 InitParameters();
91
92}
477d6cee 93
42d47cb7 94//_____________________________________________________________________________________
95void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster, const Int_t tag){
96
97 // Fill shower shape, timing and other histograms for selected clusters from decay
98
99 Float_t e = cluster->E();
100 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
101 Float_t l0 = cluster->GetM02();
102 Float_t l1 = cluster->GetM20();
103 Int_t nSM = GetModuleNumber(cluster);
09273901 104
42d47cb7 105 AliVCaloCells * cell = 0x0;
106 if(fCalorimeter == "PHOS")
107 cell = GetPHOSCells();
108 else
109 cell = GetEMCALCells();
110
111 Float_t maxCellFraction = 0;
112 GetCaloUtils()->GetMaxEnergyCell(cell, cluster, maxCellFraction);
113 fhEFracMaxCell->Fill(e,maxCellFraction);
114
115 FillWeightHistograms(cluster);
116
117 fhEDispersion->Fill(e, disp);
118 fhELambda0 ->Fill(e, l0 );
119 fhELambda1 ->Fill(e, l1 );
120
121 if(fCalorimeter=="EMCAL" && nSM < 6) {
122 fhELambda0NoTRD->Fill(e, l0 );
123 fhEFracMaxCellNoTRD->Fill(e,maxCellFraction);
124 }
125
126 if(maxCellFraction < 0.5)
127 fhELambda0FracMaxCellCut->Fill(e, l0 );
128
129 fhETime ->Fill(e, cluster->GetTOF()*1.e9);
130 fhENCells->Fill(e, cluster->GetNCells());
131
09273901 132 // Fill Track matching control histograms
133 if(fFillTMHisto){
134 Float_t dZ = cluster->GetTrackDz();
135 Float_t dR = cluster->GetTrackDx();
136
137 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn()){
138 dR = 2000., dZ = 2000.;
31ae6d59 139 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
09273901 140 }
141 //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
142
143 if(fhTrackMatchedDEta && TMath::Abs(dR) < 999){
144 fhTrackMatchedDEta->Fill(e,dZ);
145 fhTrackMatchedDPhi->Fill(e,dR);
146 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
147 }
31ae6d59 148
149 // Check dEdx and E/p of matched clusters
150
151 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
152 {
153 AliVTrack *track = 0;
154 if(!strcmp("AliESDCaloCluster",Form("%s",cluster->ClassName()))){
155 Int_t iESDtrack = cluster->GetTrackMatchedIndex();
156 if(iESDtrack<0) printf("AliAnaPi0EbE::FillSelectedCluster - Wrong track index\n");
157 AliVEvent * event = GetReader()->GetInputEvent();
158 track = dynamic_cast<AliVTrack*> (event->GetTrack(iESDtrack));
159 }
160 else {
161 track = dynamic_cast<AliVTrack*>(cluster->GetTrackMatched(0));
162 }
163
164 if(track) {
165
166 Float_t dEdx = track->GetTPCsignal();
167 fhdEdx->Fill(e, dEdx);
168
169 Float_t eOverp = e/track->P();
170 fhEOverP->Fill(e, eOverp);
171
172 }
173
174 if(IsDataMC()){
175 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
176 {
177 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
178 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 2.5 );
179 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 0.5 );
180 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 1.5 );
181 else fhTrackMatchedMCParticle->Fill(e, 3.5 );
182
183 }
184 else
185 {
186 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
187 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 6.5 );
188 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 4.5 );
189 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 5.5 );
190 else fhTrackMatchedMCParticle->Fill(e, 7.5 );
191 }
192 } // MC
193 }
09273901 194 }// Track matching histograms
195
42d47cb7 196 if(IsDataMC()) {
197 //Photon1
198 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ){
c5693f62 199 fhEMCLambda0[kmcPi0] ->Fill(e, l0);
200 fhEMCLambda1[kmcPi0] ->Fill(e, l1);
201 fhEMCDispersion[kmcPi0] ->Fill(e, disp);
42d47cb7 202
c5693f62 203 fhEMCFracMaxCell[kmcPi0]->Fill(e,maxCellFraction);
42d47cb7 204 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 205 fhEMCLambda0NoTRD[kmcPi0]->Fill(e, l0 );
42d47cb7 206 if(maxCellFraction < 0.5)
c5693f62 207 fhEMCLambda0FracMaxCellCut[kmcPi0]->Fill(e, l0 );
42d47cb7 208
209 }//pi0
210 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ){
c5693f62 211 fhEMCLambda0[kmcEta] ->Fill(e, l0);
212 fhEMCLambda1[kmcEta] ->Fill(e, l1);
213 fhEMCDispersion[kmcEta] ->Fill(e, disp);
214 fhEMCFracMaxCell[kmcEta]->Fill(e,maxCellFraction);
42d47cb7 215 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 216 fhEMCLambda0NoTRD[kmcEta]->Fill(e, l0 );
42d47cb7 217 if(maxCellFraction < 0.5)
c5693f62 218 fhEMCLambda0FracMaxCellCut[kmcEta]->Fill(e, l0 );
42d47cb7 219 }//eta
220 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
221 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) ){
c5693f62 222 fhEMCLambda0[kmcConversion] ->Fill(e, l0);
223 fhEMCLambda1[kmcConversion] ->Fill(e, l1);
224 fhEMCDispersion[kmcConversion] ->Fill(e, disp);
225 fhEMCFracMaxCell[kmcConversion]->Fill(e,maxCellFraction);
42d47cb7 226 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 227 fhEMCLambda0NoTRD[kmcConversion]->Fill(e, l0 );
42d47cb7 228 if(maxCellFraction < 0.5)
c5693f62 229 fhEMCLambda0FracMaxCellCut[kmcConversion]->Fill(e, l0 );
42d47cb7 230 }//conversion photon
231 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ){
c5693f62 232 fhEMCLambda0[kmcPhoton] ->Fill(e, l0);
233 fhEMCLambda1[kmcPhoton] ->Fill(e, l1);
234 fhEMCDispersion[kmcPhoton] ->Fill(e, disp);
235 fhEMCFracMaxCell[kmcPhoton]->Fill(e,maxCellFraction);
42d47cb7 236 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 237 fhEMCLambda0NoTRD[kmcPhoton]->Fill(e, l0 );
42d47cb7 238 if(maxCellFraction < 0.5)
c5693f62 239 fhEMCLambda0FracMaxCellCut[kmcPhoton]->Fill(e, l0 );
42d47cb7 240 }//photon no conversion
241 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron)){
c5693f62 242 fhEMCLambda0[kmcElectron] ->Fill(e, l0);
243 fhEMCLambda1[kmcElectron] ->Fill(e, l1);
244 fhEMCDispersion[kmcElectron] ->Fill(e, disp);
245 fhEMCFracMaxCell[kmcElectron]->Fill(e,maxCellFraction);
42d47cb7 246 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 247 fhEMCLambda0NoTRD[kmcElectron]->Fill(e, l0 );
42d47cb7 248 if(maxCellFraction < 0.5)
c5693f62 249 fhEMCLambda0FracMaxCellCut[kmcElectron]->Fill(e, l0 );
42d47cb7 250 }//electron
251 else {
c5693f62 252 fhEMCLambda0[kmcHadron] ->Fill(e, l0);
253 fhEMCLambda1[kmcHadron] ->Fill(e, l1);
254 fhEMCDispersion[kmcHadron] ->Fill(e, disp);
255 fhEMCFracMaxCell[kmcHadron]->Fill(e,maxCellFraction);
42d47cb7 256 if(fCalorimeter=="EMCAL" && nSM < 6)
c5693f62 257 fhEMCLambda0NoTRD[kmcHadron]->Fill(e, l0 );
42d47cb7 258 if(maxCellFraction < 0.5)
c5693f62 259 fhEMCLambda0FracMaxCellCut[kmcHadron]->Fill(e, l0 );
42d47cb7 260 }//other particles
261 }//MC
262}
263
264//________________________________________________________
265void AliAnaPi0EbE::FillWeightHistograms(AliVCluster *clus)
266{
267 // Calculate weights and fill histograms
268
269 if(!fFillWeightHistograms || GetMixedEvent()) return;
270
271 AliVCaloCells* cells = 0;
272 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
273 else cells = GetPHOSCells();
274
275 // First recalculate energy in case non linearity was applied
276 Float_t energy = 0;
277 Float_t ampMax = 0;
278 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
279
280 Int_t id = clus->GetCellsAbsId()[ipos];
281
282 //Recalibrate cell energy if needed
283 Float_t amp = cells->GetCellAmplitude(id);
284 RecalibrateCellAmplitude(amp,id);
285
286 energy += amp;
287
288 if(amp> ampMax)
289 ampMax = amp;
290
291 } // energy loop
292
293 if(energy <=0 ) {
294 printf("AliAnaPi0EbE::WeightHistograms()- Wrong calculated energy %f\n",energy);
295 return;
296 }
297
298 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
299 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
300
301 //Get the ratio and log ratio to all cells in cluster
302 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
303 Int_t id = clus->GetCellsAbsId()[ipos];
304
305 //Recalibrate cell energy if needed
306 Float_t amp = cells->GetCellAmplitude(id);
307 RecalibrateCellAmplitude(amp,id);
308
309 fhECellClusterRatio ->Fill(energy,amp/energy);
310 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
311 }
312
313 //Recalculate shower shape for different W0
314 if(fCalorimeter=="EMCAL"){
315
316 Float_t l0org = clus->GetM02();
317 Float_t l1org = clus->GetM20();
318 Float_t dorg = clus->GetDispersion();
319
1a72f6c5 320 for(Int_t iw = 0; iw < 14; iw++){
321 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
42d47cb7 322 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
323
324 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
1a72f6c5 325 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
42d47cb7 326
327 } // w0 loop
328
329 // Set the original values back
330 clus->SetM02(l0org);
331 clus->SetM20(l1org);
332 clus->SetDispersion(dorg);
333
334 }// EMCAL
335}
336
78a28af3 337//___________________________________________
0c1383b5 338TObjString * AliAnaPi0EbE::GetAnalysisCuts()
339{
340 //Save parameters used for analysis
521636d2 341 TString parList ; //this will be list of parameters used for this analysis.
342 const Int_t buffersize = 255;
343 char onePar[buffersize] ;
344
345 snprintf(onePar,buffersize,"--- AliAnaPi0EbE ---\n") ;
346 parList+=onePar ;
347 snprintf(onePar,buffersize,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ;
348 parList+=onePar ;
349
350 if(fAnaType == kSSCalo){
351 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
352 parList+=onePar ;
353 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
354 parList+=onePar ;
355 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
356 parList+=onePar ;
357 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
358 parList+=onePar ;
359 }
360
361 //Get parameters set in base class.
362 parList += GetBaseParametersList() ;
363
364 //Get parameters set in PID class.
365 if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ;
366
367 return new TObjString(parList) ;
0c1383b5 368}
369
78a28af3 370//_____________________________________________
477d6cee 371TList * AliAnaPi0EbE::GetCreateOutputObjects()
372{
373 // Create histograms to be saved in output file and
374 // store them in outputContainer
375 TList * outputContainer = new TList() ;
376 outputContainer->SetName("Pi0EbEHistos") ;
377
745913ae 378 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
379 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
380 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
381 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
382 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
383 Int_t tbins = GetHistogramRanges()->GetHistoTimeBins() ; Float_t tmax = GetHistogramRanges()->GetHistoTimeMax(); Float_t tmin = GetHistogramRanges()->GetHistoTimeMin();
384 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
42d47cb7 385
09273901 386 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
387 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
388 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
389 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
390 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
391 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
392
31ae6d59 393 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
394 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
395 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
396 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
397 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
398 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
399
400
b9947879 401 fhPt = new TH1F("hPt","Number of identified #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
09273901 402 fhPt->SetYTitle("N");
9fb80477 403 fhPt->SetXTitle("p_{T} (GeV/c)");
09273901 404 outputContainer->Add(fhPt) ;
405
b9947879 406 fhE = new TH1F("hE","Number of identified #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
09273901 407 fhE->SetYTitle("N");
b9947879 408 fhE->SetXTitle("E (GeV)");
09273901 409 outputContainer->Add(fhE) ;
410
411 fhEPhi = new TH2F
b9947879 412 ("hEPhi","Selected #pi^{0} (#eta) pairs: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
413 fhEPhi->SetYTitle("#phi (rad)");
414 fhEPhi->SetXTitle("E (GeV)");
09273901 415 outputContainer->Add(fhEPhi) ;
416
417 fhEEta = new TH2F
b9947879 418 ("hEEta","Selected #pi^{0} (#eta) pairs: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
419 fhEEta->SetYTitle("#eta");
9fb80477 420 fhEEta->SetXTitle("E (GeV)");
09273901 421 outputContainer->Add(fhEEta) ;
422
423 fhEtaPhi = new TH2F
b9947879 424 ("hEtaPhi","Selected #pi^{0} (#eta) pairs: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
425 fhEtaPhi->SetYTitle("#phi (rad)");
426 fhEtaPhi->SetXTitle("#eta");
09273901 427 outputContainer->Add(fhEtaPhi) ;
428
b9947879 429 fhPtDecay = new TH1F("hPtDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
09273901 430 fhPtDecay->SetYTitle("N");
b9947879 431 fhPtDecay->SetXTitle("p_{T} (GeV/c)");
09273901 432 outputContainer->Add(fhPtDecay) ;
433
b9947879 434 fhEDecay = new TH1F("hEDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
09273901 435 fhEDecay->SetYTitle("N");
b9947879 436 fhEDecay->SetXTitle("E (GeV)");
09273901 437 outputContainer->Add(fhEDecay) ;
57b97dc6 438
c4a7d28a 439 ////////
57b97dc6 440
1db06135 441 if(fAnaType == kIMCalo || fAnaType == kIMCaloTracks ){
c4a7d28a 442
521636d2 443 fhEDispersion = new TH2F
b9947879 444 ("hEDispersion","Selected #pi^{0} (#eta) pairs: E vs dispersion",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 445 fhEDispersion->SetYTitle("D^{2}");
446 fhEDispersion->SetXTitle("E (GeV)");
447 outputContainer->Add(fhEDispersion) ;
448
449 fhELambda0 = new TH2F
b9947879 450 ("hELambda0","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
521636d2 451 fhELambda0->SetYTitle("#lambda_{0}^{2}");
452 fhELambda0->SetXTitle("E (GeV)");
453 outputContainer->Add(fhELambda0) ;
3bfcb597 454
42d47cb7 455 fhELambda1 = new TH2F
b9947879 456 ("hELambda1","Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
42d47cb7 457 fhELambda1->SetYTitle("#lambda_{1}^{2}");
458 fhELambda1->SetXTitle("E (GeV)");
459 outputContainer->Add(fhELambda1) ;
460
3bfcb597 461 fhELambda0FracMaxCellCut = new TH2F
b9947879 462 ("hELambda0FracMaxCellCut","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy < 0.5",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3bfcb597 463 fhELambda0FracMaxCellCut->SetYTitle("#lambda_{0}^{2}");
464 fhELambda0FracMaxCellCut->SetXTitle("E (GeV)");
465 outputContainer->Add(fhELambda0FracMaxCellCut) ;
466
467 fhEFracMaxCell = new TH2F
b9947879 468 ("hEFracMaxCell","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy",nptbins,ptmin,ptmax,100,0,1);
3bfcb597 469 fhEFracMaxCell->SetYTitle("Fraction");
470 fhEFracMaxCell->SetXTitle("E (GeV)");
471 outputContainer->Add(fhEFracMaxCell) ;
472
473 if(fCalorimeter=="EMCAL"){
474 fhELambda0NoTRD = new TH2F
b9947879 475 ("hELambda0NoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, not behind TRD",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3bfcb597 476 fhELambda0NoTRD->SetYTitle("#lambda_{0}^{2}");
477 fhELambda0NoTRD->SetXTitle("E (GeV)");
478 outputContainer->Add(fhELambda0NoTRD) ;
479
480 fhEFracMaxCellNoTRD = new TH2F
b9947879 481 ("hEFracMaxCellNoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy, not behind TRD",nptbins,ptmin,ptmax,100,0,1);
3bfcb597 482 fhEFracMaxCellNoTRD->SetYTitle("Fraction");
483 fhEFracMaxCellNoTRD->SetXTitle("E (GeV)");
484 outputContainer->Add(fhEFracMaxCellNoTRD) ;
485 }
521636d2 486
42d47cb7 487 fhENCells = new TH2F ("hENCells","N cells in cluster vs E ", nptbins,ptmin,ptmax, nbins,nmin,nmax);
488 fhENCells->SetXTitle("E (GeV)");
489 fhENCells->SetYTitle("# of cells in cluster");
490 outputContainer->Add(fhENCells);
491
492 fhETime = new TH2F("hETime","cluster time vs pair E",nptbins,ptmin,ptmax, tbins,tmin,tmax);
493 fhETime->SetXTitle("E (GeV)");
9fb80477 494 fhETime->SetYTitle("t (ns)");
42d47cb7 495 outputContainer->Add(fhETime);
521636d2 496
e7fd282f 497 }// Invariant mass analysis in calorimeters and calorimeter + conversion photons
498
499 if(fAnaType == kIMCalo){
42d47cb7 500 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs E",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
501 fhEPairDiffTime->SetXTitle("E_{pair} (GeV)");
502 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
503 outputContainer->Add(fhEPairDiffTime);
e7fd282f 504 }
477d6cee 505
09273901 506 if(fFillTMHisto){
507 fhTrackMatchedDEta = new TH2F
31ae6d59 508 ("hTrackMatchedDEta",
09273901 509 "d#eta of cluster-track vs cluster energy",
510 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
511 fhTrackMatchedDEta->SetYTitle("d#eta");
512 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
513
514 fhTrackMatchedDPhi = new TH2F
31ae6d59 515 ("hTrackMatchedDPhi",
09273901 516 "d#phi of cluster-track vs cluster energy",
517 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
518 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
519 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
520
521 fhTrackMatchedDEtaDPhi = new TH2F
31ae6d59 522 ("hTrackMatchedDEtaDPhi",
09273901 523 "d#eta vs d#phi of cluster-track vs cluster energy",
524 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
525 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
526 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
527
528 outputContainer->Add(fhTrackMatchedDEta) ;
529 outputContainer->Add(fhTrackMatchedDPhi) ;
530 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
31ae6d59 531
532 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
533 fhdEdx->SetXTitle("E (GeV)");
534 fhdEdx->SetYTitle("<dE/dx>");
535 outputContainer->Add(fhdEdx);
536
537 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
538 fhEOverP->SetXTitle("E (GeV)");
539 fhEOverP->SetYTitle("E/p");
540 outputContainer->Add(fhEOverP);
541
542 if(IsDataMC())
543 {
544 fhTrackMatchedMCParticle = new TH2F
545 ("hTrackMatchedMCParticle",
546 "Origin of particle vs energy",
547 nptbins,ptmin,ptmax,8,0,8);
548 fhTrackMatchedMCParticle->SetXTitle("E (GeV)");
549 //fhTrackMatchedMCParticle->SetYTitle("Particle type");
550
551 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(1 ,"Photon");
552 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(2 ,"Electron");
553 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
554 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(4 ,"Rest");
555 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
556 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
557 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
558 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
559
560 outputContainer->Add(fhTrackMatchedMCParticle);
561 }
09273901 562 }
563
78a28af3 564 if(fFillWeightHistograms){
565
566 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
567 nptbins,ptmin,ptmax, 100,0,1.);
568 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
569 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
570 outputContainer->Add(fhECellClusterRatio);
571
572 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1a72f6c5 573 nptbins,ptmin,ptmax, 100,-10,0);
78a28af3 574 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1a72f6c5 575 fhECellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
78a28af3 576 outputContainer->Add(fhECellClusterLogRatio);
577
578 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
579 nptbins,ptmin,ptmax, 100,0,1.);
580 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
581 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
582 outputContainer->Add(fhEMaxCellClusterRatio);
583
584 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1a72f6c5 585 nptbins,ptmin,ptmax, 100,-10,0);
78a28af3 586 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1a72f6c5 587 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
78a28af3 588 outputContainer->Add(fhEMaxCellClusterLogRatio);
589
1a72f6c5 590 for(Int_t iw = 0; iw < 14; iw++){
591 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for selected decay photons from neutral meson",1+0.5*iw),
78a28af3 592 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
593 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
594 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
595 outputContainer->Add(fhLambda0ForW0[iw]);
596
1a72f6c5 597// fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for selected decay photons from neutral meson",0.5+0.5*iw),
598// nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
599// fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
600// fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
601// outputContainer->Add(fhLambda1ForW0[iw]);
78a28af3 602
603 }
604 }
605
477d6cee 606 if(IsDataMC()) {
607 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
608 GetReader()->GetDataType() != AliCaloTrackReader::kMC){
609
b9947879 610 fhPtMC = new TH1F("hPtMC","Identified #pi^{0} (#eta) from #pi^{0} (#eta)",nptbins,ptmin,ptmax);
09273901 611 fhPtMC->SetYTitle("N");
9fb80477 612 fhPtMC->SetXTitle("p_{T} (GeV/c)");
09273901 613 outputContainer->Add(fhPtMC) ;
477d6cee 614
09273901 615 fhPhiMC = new TH2F
b9947879 616 ("hPhiMC","Identified #pi^{0} (#eta) from #pi^{0} (#eta)",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
09273901 617 fhPhiMC->SetYTitle("#phi");
b9947879 618 fhPhiMC->SetXTitle("p_{T} (GeV/c)");
09273901 619 outputContainer->Add(fhPhiMC) ;
477d6cee 620
09273901 621 fhEtaMC = new TH2F
b9947879 622 ("hEtaMC","Identified #pi^{0} (#eta) from #pi^{0} (#eta)",nptbins,ptmin,ptmax,netabins,etamin,etamax);
09273901 623 fhEtaMC->SetYTitle("#eta");
b9947879 624 fhEtaMC->SetXTitle("p_{T} (GeV/c)");
09273901 625 outputContainer->Add(fhEtaMC) ;
477d6cee 626
b9947879 627 fhPtMCNo = new TH1F("hPtMCNo","Identified #pi^{0} (#eta) not from #pi^{0} (#eta)",nptbins,ptmin,ptmax);
09273901 628 fhPtMCNo->SetYTitle("N");
9fb80477 629 fhPtMCNo->SetXTitle("p_{T} (GeV/c)");
09273901 630 outputContainer->Add(fhPtMCNo) ;
477d6cee 631
09273901 632 fhPhiMCNo = new TH2F
b9947879 633 ("hPhiMCNo","Identified #pi^{0} (#eta) not from #pi^{0} (#eta)",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
09273901 634 fhPhiMCNo->SetYTitle("#phi");
b9947879 635 fhPhiMCNo->SetXTitle("p_{T} (GeV/c)");
09273901 636 outputContainer->Add(fhPhiMCNo) ;
477d6cee 637
09273901 638 fhEtaMCNo = new TH2F
b9947879 639 ("hEtaMCNo","Identified #pi^{0} (#eta) not from #pi^{0} (#eta)",nptbins,ptmin,ptmax,netabins,etamin,etamax);
09273901 640 fhEtaMCNo->SetYTitle("#eta");
b9947879 641 fhEtaMCNo->SetXTitle("p_{T} (GeV/c)");
09273901 642 outputContainer->Add(fhEtaMCNo) ;
477d6cee 643
c4a7d28a 644 if(fAnaType == kIMCalo){
6db946bd 645 TString ptype[] ={"#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"};
b9947879 646 TString pname[] ={"Photon","Conversion", "Pi0", "Eta", "Electron","Hadron"};
6db946bd 647 for(Int_t i = 0; i < 6; i++){
521636d2 648
649 fhEMCLambda0[i] = new TH2F(Form("hELambda0_MC%s",pname[i].Data()),
650 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}",ptype[i].Data()),
651 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
652 fhEMCLambda0[i]->SetYTitle("#lambda_{0}^{2}");
653 fhEMCLambda0[i]->SetXTitle("E (GeV)");
654 outputContainer->Add(fhEMCLambda0[i]) ;
655
3bfcb597 656 if(fCalorimeter=="EMCAL"){
657 fhEMCLambda0NoTRD[i] = new TH2F(Form("hELambda0NoTRD_MC%s",pname[i].Data()),
658 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, NoTRD",ptype[i].Data()),
659 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
660 fhEMCLambda0NoTRD[i]->SetYTitle("#lambda_{0}^{2}");
661 fhEMCLambda0NoTRD[i]->SetXTitle("E (GeV)");
662 outputContainer->Add(fhEMCLambda0NoTRD[i]) ;
663 }
664
665 fhEMCLambda0FracMaxCellCut[i] = new TH2F(Form("hELambda0FracMaxCellCut_MC%s",pname[i].Data()),
666 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, Max cell fraction of energy < 0.5 ",ptype[i].Data()),
667 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
668 fhEMCLambda0FracMaxCellCut[i]->SetYTitle("#lambda_{0}^{2}");
669 fhEMCLambda0FracMaxCellCut[i]->SetXTitle("E (GeV)");
670 outputContainer->Add(fhEMCLambda0FracMaxCellCut[i]) ;
671
672 fhEMCFracMaxCell[i] = new TH2F(Form("hEFracMaxCell_MC%s",pname[i].Data()),
673 Form("Selected pair, cluster from %s : E vs Max cell fraction of energy",ptype[i].Data()),
674 nptbins,ptmin,ptmax,100,0,1);
675 fhEMCFracMaxCell[i]->SetYTitle("Fraction");
676 fhEMCFracMaxCell[i]->SetXTitle("E (GeV)");
677 outputContainer->Add(fhEMCFracMaxCell[i]) ;
678
521636d2 679 fhEMCLambda1[i] = new TH2F(Form("hELambda1_MC%s",pname[i].Data()),
680 Form("Selected pair, cluster from %s : E vs #lambda_{1}^{2}",ptype[i].Data()),
681 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
682 fhEMCLambda1[i]->SetYTitle("#lambda_{1}^{2}");
683 fhEMCLambda1[i]->SetXTitle("E (GeV)");
684 outputContainer->Add(fhEMCLambda1[i]) ;
7c65ad18 685
521636d2 686 fhEMCDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pname[i].Data()),
687 Form("Selected pair, cluster from %s : E vs dispersion^{2}",ptype[i].Data()),
688 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
689 fhEMCDispersion[i]->SetYTitle("D^{2}");
690 fhEMCDispersion[i]->SetXTitle("E (GeV)");
691 outputContainer->Add(fhEMCDispersion[i]) ;
7c65ad18 692
521636d2 693 }//
c4a7d28a 694
695 }//kIMCalo
521636d2 696 } //Not MC reader
477d6cee 697 }//Histos with MC
698
699
700 //Keep neutral meson selection histograms if requiered
701 //Setting done in AliNeutralMesonSelection
702
703 if(fAnaType!=kSSCalo && GetNeutralMesonSelection()){
704
705 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
706 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
707 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
5ae09196 708 delete nmsHistos;
a14fd526 709
477d6cee 710 }
711
477d6cee 712 return outputContainer ;
713
714}
715
521636d2 716//____________________________________________________________________________
717void AliAnaPi0EbE::Init()
718{
719 //Init
720 //Do some checks
721 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
722 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
723 abort();
724 }
725 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
726 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
727 abort();
728 }
729
730}
731
732//____________________________________________________________________________
733void AliAnaPi0EbE::InitParameters()
734{
735 //Initialize the parameters of the analysis.
736 AddToHistogramsName("AnaPi0EbE_");
737
1db06135 738 fInputAODGammaConvName = "PhotonsCTS" ;
521636d2 739 fAnaType = kIMCalo ;
740 fCalorimeter = "EMCAL" ;
741 fMinDist = 2.;
742 fMinDist2 = 4.;
743 fMinDist3 = 5.;
744
745}
746
477d6cee 747//__________________________________________________________________
748void AliAnaPi0EbE::MakeAnalysisFillAOD()
749{
750 //Do analysis and fill aods
751
752 switch(fAnaType)
521636d2 753 {
477d6cee 754 case kIMCalo:
755 MakeInvMassInCalorimeter();
756 break;
757
758 case kSSCalo:
759 MakeShowerShapeIdentification();
760 break;
761
762 case kIMCaloTracks:
763 MakeInvMassInCalorimeterAndCTS();
764 break;
765
521636d2 766 }
477d6cee 767}
768
42d47cb7 769//____________________________________________
477d6cee 770void AliAnaPi0EbE::MakeInvMassInCalorimeter()
771{
57b97dc6 772 //Do analysis and fill aods
773 //Search for the photon decay in calorimeters
774 //Read photon list from AOD, produced in class AliAnaPhoton
775 //Check if 2 photons have the mass of the pi0.
477d6cee 776
777 TLorentzVector mom1;
778 TLorentzVector mom2;
779 TLorentzVector mom ;
591cc579 780 Int_t tag1 = 0;
781 Int_t tag2 = 0;
782 Int_t tag = 0;
477d6cee 783
784 if(!GetInputAODBranch()){
a3aebfff 785 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
477d6cee 786 abort();
787 }
f8006433 788
42d47cb7 789 //Get shower shape information of clusters
790 TObjArray *clusters = 0;
791 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
792 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
793
c4a7d28a 794 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast()-1; iphoton++){
477d6cee 795 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
c8fe2783 796
c4a7d28a 797 //Vertex cut in case of mixed events
c8fe2783 798 Int_t evtIndex1 = 0 ;
799 if(GetMixedEvent())
800 evtIndex1 = GetMixedEvent()->EventIndexForCaloCluster(photon1->GetCaloLabel(0)) ;
5025c139 801 if(TMath::Abs(GetVertex(evtIndex1)[2]) > GetZvertexCut()) continue ; //vertex cut
477d6cee 802 mom1 = *(photon1->Momentum());
803
42d47cb7 804 //Get original cluster, to recover some information
1db06135 805 Int_t iclus = -1;
806 AliVCluster *cluster1 = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
42d47cb7 807
1db06135 808 if(!cluster1){
42d47cb7 809 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - First cluster not found\n");
810 return;
9ab9e937 811 }
c4a7d28a 812
813 for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast(); jphoton++){
477d6cee 814
a3aebfff 815 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(jphoton));
c8fe2783 816 Int_t evtIndex2 = 0 ;
817 if(GetMixedEvent())
818 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
819 if(GetMixedEvent() && (evtIndex1 == evtIndex2))
820 continue ;
5025c139 821 if(TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut()) continue ; //vertex cut
477d6cee 822 mom2 = *(photon2->Momentum());
c4a7d28a 823
1db06135 824 //Get original cluster, to recover some information
825 Int_t iclus2;
826 AliVCluster *cluster2 = FindCluster(clusters,photon2->GetCaloLabel(0),iclus2,iclus+1);
42d47cb7 827
1db06135 828 if(!cluster2){
42d47cb7 829 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Second cluster not found\n");
1db06135 830 return;
9ab9e937 831 }
c4a7d28a 832
42d47cb7 833 Float_t e1 = photon1->E();
834 Float_t e2 = photon2->E();
835
836 //Select clusters with good time window difference
837 Float_t tof1 = cluster1->GetTOF()*1e9;;
838 Float_t tof2 = cluster2->GetTOF()*1e9;;
839 Double_t t12diff = tof1-tof2;
840 fhEPairDiffTime->Fill(e1+e2, t12diff);
841 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
842
57b97dc6 843 //Select good pair (good phi, pt cuts, aperture and invariant mass)
3bfcb597 844 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
c8fe2783 845 {
846 if(GetDebug()>1)
847 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Selected gamma pair: pt %f, phi %f, eta%f \n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta());
42d47cb7 848
57b97dc6 849 //Play with the MC stack if available
c8fe2783 850 if(IsDataMC()){
57b97dc6 851 //Check origin of the candidates
c8fe2783 852 Int_t label1 = photon1->GetLabel();
853 Int_t label2 = photon2->GetLabel();
0db79843 854 if(label1>=0)tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader(), photon1->GetInputFileIndex());
855 if(label2>=0)tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(), photon2->GetInputFileIndex());
c8fe2783 856
857 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
0db79843 858 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
859 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay)){
c8fe2783 860
57b97dc6 861 //Check if pi0 mother is the same
c8fe2783 862 if(GetReader()->ReadStack()){
0db79843 863 if(label1>=0){
864 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
865 label1 = mother1->GetFirstMother();
866 //mother1 = GetMCStack()->Particle(label1);//pi0
867 }
868 if(label2>=0){
869 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
870 label2 = mother2->GetFirstMother();
871 //mother2 = GetMCStack()->Particle(label2);//pi0
521636d2 872 }
c8fe2783 873 }
f8006433 874 else if(GetReader()->ReadAODMCParticles()){//&& (input > -1)){
0db79843 875 if(label1>=0){
876 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon1->GetInputFileIndex()))->At(label1);//photon in kine tree
877 label1 = mother1->GetMother();
878 //mother1 = GetMCStack()->Particle(label1);//pi0
521636d2 879 }
0db79843 880 if(label2>=0){
881 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon2->GetInputFileIndex()))->At(label2);//photon in kine tree
882 label2 = mother2->GetMother();
883 //mother2 = GetMCStack()->Particle(label2);//pi0
884 }
c8fe2783 885 }
886
57b97dc6 887 //printf("mother1 %d, mother2 %d\n",label1,label2);
0db79843 888 if(label1 == label2 && label1>=0)
c8fe2783 889 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
890 }
891 }//Work with stack also
892
78a28af3 893
57b97dc6 894 //Fill some histograms about shower shape
9ab9e937 895 if(clusters && GetReader()->GetDataType()!=AliCaloTrackReader::kMC){
42d47cb7 896 FillSelectedClusterHistograms(cluster1, tag1);
897 FillSelectedClusterHistograms(cluster2, tag2);
898 }
521636d2 899
803d06a8 900 // Tag both photons as decay
901 photon1->SetTagged(kTRUE);
902 photon2->SetTagged(kTRUE);
09273901 903
904 fhPtDecay->Fill(photon1->Pt());
905 fhEDecay ->Fill(photon1->E() );
906
907 fhPtDecay->Fill(photon2->Pt());
908 fhEDecay ->Fill(photon2->E() );
803d06a8 909
57b97dc6 910 //Create AOD for analysis
c8fe2783 911 mom = mom1+mom2;
912 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
57b97dc6 913 //pi0.SetLabel(calo->GetLabel());
21a4b1c0 914 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
c8fe2783 915 pi0.SetDetector(photon1->GetDetector());
916 pi0.SetTag(tag);
57b97dc6 917 //Set the indeces of the original caloclusters
c8fe2783 918 pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0));
f8006433 919 //pi0.SetInputFileIndex(input);
c8fe2783 920 AddAODParticle(pi0);
921 }//pi0
57b97dc6 922
477d6cee 923 }//2n photon loop
924
925 }//1st photon loop
926
a3aebfff 927 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - End fill AODs \n");
477d6cee 928
929}
930
e7fd282f 931//__________________________________________________
477d6cee 932void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
933{
934 //Do analysis and fill aods
935 //Search for the photon decay in calorimeters
936 //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion
937 //Check if 2 photons have the mass of the pi0.
938
939 TLorentzVector mom1;
940 TLorentzVector mom2;
941 TLorentzVector mom ;
591cc579 942 Int_t tag1 = 0;
943 Int_t tag2 = 0;
944 Int_t tag = 0;
5025c139 945 Int_t evtIndex = 0;
1db06135 946
947 // Check calorimeter input
477d6cee 948 if(!GetInputAODBranch()){
a3aebfff 949 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data());
477d6cee 950 abort();
951 }
57b97dc6 952
1db06135 953 // Get the array with conversion photons
954 TClonesArray * inputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName);
955 if(!inputAODGammaConv) {
956
957 inputAODGammaConv = (TClonesArray *) GetReader()->GetInputEvent()->FindListObject(fInputAODGammaConvName);
958
959 if(!inputAODGammaConv) {
960 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input gamma conversions in AOD branch with name < %s >\n",fInputAODGammaConvName.Data());
961
962 return;
963 }
964 }
965
966 //Get shower shape information of clusters
967 TObjArray *clusters = 0;
968 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
969 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
970
971 Int_t nCTS = inputAODGammaConv->GetEntriesFast();
972 Int_t nCalo = GetInputAODBranch()->GetEntriesFast();
973 if(nCTS<=0 || nCalo <=0) {
974 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - nCalo %d, nCTS %d, cannot loop\n",nCalo,nCTS);
975 return;
976 }
977
978 if(GetDebug() > 1)
979 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Number of conversion photons %d\n",nCTS);
980
981 // Do the loop, first calo, second CTS
477d6cee 982 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){
983 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
984 mom1 = *(photon1->Momentum());
985
1db06135 986 //Get original cluster, to recover some information
987 Int_t iclus = -1;
988 AliVCluster *cluster = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
989
990 for(Int_t jphoton = 0; jphoton < nCTS; jphoton++){
991 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (inputAODGammaConv->At(jphoton));
5025c139 992 if(GetMixedEvent())
993 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
994 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
995
477d6cee 996 mom2 = *(photon2->Momentum());
57b97dc6 997
477d6cee 998 //Select good pair (good phi, pt cuts, aperture and invariant mass)
3bfcb597 999 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter)){
57b97dc6 1000 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Selected gamma pair: pt %f, phi %f, eta%f\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta());
1001
1002 if(IsDataMC()){
1003 Int_t label1 = photon1->GetLabel();
1004 Int_t label2 = photon2->GetLabel();
0db79843 1005 if(label1>=0)tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader(), photon1->GetInputFileIndex());
1006 if(label2>=0)tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(), photon2->GetInputFileIndex());
57b97dc6 1007 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
0db79843 1008 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
1009 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay)){
57b97dc6 1010 //Check if pi0 mother is the same
1011
1012 if(GetReader()->ReadStack()){
0db79843 1013 if(label1>=0){
1014 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
1015 label1 = mother1->GetFirstMother();
1016 //mother1 = GetMCStack()->Particle(label1);//pi0
1017 }
1018 if(label2>=0){
1019 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
1020 label2 = mother2->GetFirstMother();
1021 //mother2 = GetMCStack()->Particle(label2);//pi0
1022 }
57b97dc6 1023 }
0db79843 1024 else if(GetReader()->ReadAODMCParticles()&& label1>=0 && label2>=0){ //&& (input > -1)){
1025 if(label1>=0){
1026 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon1->GetInputFileIndex()))->At(label1);//photon in kine tree
1027 label1 = mother1->GetMother();
1028 //mother1 = GetMCStack()->Particle(label1);//pi0
1029 }
1030 if(label2>=0){
1031 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon2->GetInputFileIndex()))->At(label2);//photon in kine tree
1032 label2 = mother2->GetMother();
1033 //mother2 = GetMCStack()->Particle(label2);//pi0
1034 }
57b97dc6 1035 }
1036
1037 //printf("mother1 %d, mother2 %d\n",label1,label2);
0db79843 1038 if(label1 == label2 && label1>=0)
57b97dc6 1039 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
1040 }
1041 }//Work with stack also
1042
1db06135 1043 //Fill some histograms about shower shape
1044 if(cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC){
1045 FillSelectedClusterHistograms(cluster, tag1);
1046 }
803d06a8 1047
1048 // Tag both photons as decay
1049 photon1->SetTagged(kTRUE);
1050 photon2->SetTagged(kTRUE);
1db06135 1051
09273901 1052 fhPtDecay->Fill(photon1->Pt());
1053 fhEDecay ->Fill(photon1->E() );
1054
1055 //fhPtDecay->Fill(photon2->Pt());
1056 //fhEDecay ->Fill(photon2->E() );
1057
57b97dc6 1058 //Create AOD for analysis
1059 mom = mom1+mom2;
1060 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1061 //pi0.SetLabel(calo->GetLabel());
21a4b1c0 1062 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
57b97dc6 1063 pi0.SetDetector(photon1->GetDetector());
1064 pi0.SetTag(tag);
1065 //Set the indeces of the original tracks or caloclusters
1066 pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1);
1067 pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1));
f8006433 1068 //pi0.SetInputFileIndex(input);
57b97dc6 1069 AddAODParticle(pi0);
477d6cee 1070 }//pi0
1071 }//2n photon loop
1072
1073 }//1st photon loop
1074
a3aebfff 1075 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - End fill AODs \n");
477d6cee 1076
1077}
1078
1079
e7fd282f 1080//_________________________________________________
477d6cee 1081void AliAnaPi0EbE::MakeShowerShapeIdentification()
1082{
1083 //Search for pi0 in fCalorimeter with shower shape analysis
1084
4a745797 1085 TObjArray * pl = 0x0;
5ae09196 1086 //Select the Calorimeter of the photon
1087 if(fCalorimeter == "PHOS")
be518ab0 1088 pl = GetPHOSClusters();
5ae09196 1089 else if (fCalorimeter == "EMCAL")
be518ab0 1090 pl = GetEMCALClusters();
57b97dc6 1091
5ae09196 1092 if(!pl) {
1093 Info("MakeShowerShapeIdentification","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
1094 return;
1095 }
233e0df8 1096
477d6cee 1097 TLorentzVector mom ;
1098 for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){
0ae57829 1099 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
477d6cee 1100
f8006433 1101 Int_t evtIndex = 0 ;
1102 if (GetMixedEvent()) {
1103 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
1104 }
5025c139 1105 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
521636d2 1106
57b97dc6 1107 //Get Momentum vector,
f8006433 1108 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
1109 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
1110 else{
1111 Double_t vertex[]={0,0,0};
1112 calo->GetMomentum(mom,vertex) ;
1113 }
233e0df8 1114
57b97dc6 1115 //If too small or big pt, skip it
477d6cee 1116 if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ;
1117 //Check acceptance selection
ff45398a 1118 if(IsFiducialCutOn()){
1119 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
477d6cee 1120 if(! in ) continue ;
1121 }
1122
1123 //Create AOD for analysis
1124 AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
c8fe2783 1125 aodpi0.SetLabel(calo->GetLabel());
477d6cee 1126 //Set the indeces of the original caloclusters
1127 aodpi0.SetCaloLabel(calo->GetID(),-1);
1128 aodpi0.SetDetector(fCalorimeter);
1129 if(GetDebug() > 1)
ff45398a 1130 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Min pt cut and fiducial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodpi0.Pt(),aodpi0.Phi(),aodpi0.Eta());
477d6cee 1131
1132 //Check Distance to Bad channel, set bit.
c8fe2783 1133 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
477d6cee 1134 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
1135 if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
1136 continue ;
1137
a3aebfff 1138 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
477d6cee 1139
1140 if(distBad > fMinDist3) aodpi0.SetDistToBad(2) ;
1141 else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ;
1142 else aodpi0.SetDistToBad(0) ;
1143
1144 //Check PID
1145 //PID selection or bit setting
49b5c49b 1146 if(IsCaloPIDOn()){
477d6cee 1147 //Skip matched clusters with tracks
49b5c49b 1148 if(IsTrackMatched(calo, GetReader()->GetInputEvent())) continue ;
477d6cee 1149
49b5c49b 1150 // Get most probable PID, 2 options check bayesian PID weights or redo PID
1151 // By default, redo PID
1152
1153 aodpi0.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(fCalorimeter,mom,calo));//PID recalculated
477d6cee 1154
21a4b1c0 1155 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",aodpi0.GetIdentifiedParticleType());
477d6cee 1156
1157 //If cluster does not pass pid, not pi0, skip it.
21a4b1c0 1158 if(aodpi0.GetIdentifiedParticleType() != AliCaloPID::kPi0) continue ;
477d6cee 1159
1160 }
1161 else{
49b5c49b 1162 //Set PID bits for later selection
477d6cee 1163 //GetPDG already called in SetPIDBits.
49b5c49b 1164 GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodpi0, GetCaloUtils(), GetReader()->GetInputEvent());
a3aebfff 1165 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PID Bits set \n");
477d6cee 1166 }
1167
21a4b1c0 1168 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0 selection cuts passed: pT %3.2f, pdg %d\n",aodpi0.Pt(), aodpi0.GetIdentifiedParticleType());
477d6cee 1169
1170 //Play with the MC stack if available
1171 //Check origin of the candidates
1172 if(IsDataMC()){
1173 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
57b97dc6 1174 GetReader()->GetDataType() != AliCaloTrackReader::kMC){
f8006433 1175 //aodpi0.SetInputFileIndex(input);
57b97dc6 1176 Int_t tag =0;
1177 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(),GetReader(), aodpi0.GetInputFileIndex());
1178 //GetMCAnalysisUtils()->CheckMultipleOrigin(calo->GetLabels(),calo->GetNLabels(), GetReader(), aodpi0.GetInputFileIndex(), tag);
1179 aodpi0.SetTag(tag);
1180 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",aodpi0.GetTag());
477d6cee 1181 }
1182 }//Work with stack also
1183
1184 //Add AOD with pi0 object to aod branch
1185 AddAODParticle(aodpi0);
1186
1187 }//loop
1188
a3aebfff 1189 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
477d6cee 1190
1191}
e7fd282f 1192//______________________________________________
477d6cee 1193void AliAnaPi0EbE::MakeAnalysisFillHistograms()
691bdd02 1194{
477d6cee 1195 //Do analysis and fill histograms
691bdd02 1196
477d6cee 1197 if(!GetOutputAODBranch()){
a3aebfff 1198 printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
477d6cee 1199 abort();
1200 }
1201 //Loop on stored AOD pi0
1202 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
a3aebfff 1203 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
477d6cee 1204
1205 for(Int_t iaod = 0; iaod < naod ; iaod++){
1206
1207 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
21a4b1c0 1208 Int_t pdg = pi0->GetIdentifiedParticleType();
9415d854 1209
1210 if(IsCaloPIDOn() && pdg != AliCaloPID::kPi0) continue;
477d6cee 1211
1212 //Fill pi0 histograms
c4a7d28a 1213 Float_t ener = pi0->E();
1214 Float_t pt = pi0->Pt();
1215 Float_t phi = pi0->Phi();
57b97dc6 1216 if(phi < 0) phi+=TMath::TwoPi();
477d6cee 1217 Float_t eta = pi0->Eta();
1218
09273901 1219 fhPt ->Fill(pt);
1220 fhE ->Fill(ener);
477d6cee 1221
09273901 1222 fhEEta ->Fill(ener,eta);
1223 fhEPhi ->Fill(ener,phi);
1224 fhEtaPhi ->Fill(eta,phi);
7a972c0c 1225
477d6cee 1226 if(IsDataMC()){
1227 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
57b97dc6 1228 GetReader()->GetDataType() != AliCaloTrackReader::kMC){
1229 if(GetMCAnalysisUtils()->CheckTagBit(pi0->GetTag(), AliMCAnalysisUtils::kMCPi0)){
09273901 1230 fhPtMC ->Fill(pt);
1231 fhPhiMC ->Fill(pt,phi);
1232 fhEtaMC ->Fill(pt,eta);
57b97dc6 1233 }
1234 else{
09273901 1235 fhPtMCNo ->Fill(pt);
1236 fhPhiMCNo ->Fill(pt,phi);
1237 fhEtaMCNo ->Fill(pt,eta);
57b97dc6 1238 }
477d6cee 1239 }
1240 }//Histograms with MC
1241
1242 }// aod loop
1243
1244}
1245
477d6cee 1246//__________________________________________________________________
1247void AliAnaPi0EbE::Print(const Option_t * opt) const
1248{
1249 //Print some relevant parameters set for the analysis
1250 if(! opt)
1251 return;
1252
1253 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
745913ae 1254 AliAnaCaloTrackCorrBaseClass::Print("");
477d6cee 1255 printf("Analysis Type = %d \n", fAnaType) ;
1256 if(fAnaType == kSSCalo){
1257 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
1258 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
1259 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
1260 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
1261 }
1262 printf(" \n") ;
1263
1264}
78a28af3 1265
1266//___________________________________________________________________________________
1267void AliAnaPi0EbE::RecalibrateCellAmplitude(Float_t & amp, const Int_t id)
1268{
1269 //Recaculate cell energy if recalibration factor
1270
1271 Int_t icol = -1; Int_t irow = -1; Int_t iRCU = -1;
1272 Int_t nModule = GetModuleNumberCellIndexes(id,fCalorimeter, icol, irow, iRCU);
1273
1274 if (GetCaloUtils()->IsRecalibrationOn()) {
1275 if(fCalorimeter == "PHOS") {
1276 amp *= GetCaloUtils()->GetPHOSChannelRecalibrationFactor(nModule,icol,irow);
1277 }
1278 else {
1279 amp *= GetCaloUtils()->GetEMCALChannelRecalibrationFactor(nModule,icol,irow);
1280 }
1281 }
1282}
1283
78a28af3 1284