1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_________________________________________________________________________
17 // Class to check results from simulations or reconstructed real data.
18 // Fill few histograms and do some checking plots
20 //-- Author: Gustavo Conesa (INFN-LNF)
21 //_________________________________________________________________________
24 // --- ROOT system ---
25 //#include "Riostream.h"
26 #include "TObjArray.h"
27 #include "TParticle.h"
28 #include "TDatabasePDG.h"
35 #include <TObjString.h>
37 //---- AliRoot system ----
38 #include "AliAnaCalorimeterQA.h"
39 #include "AliCaloTrackReader.h"
41 #include "AliVCaloCells.h"
42 #include "AliFiducialCut.h"
43 #include "AliAODTrack.h"
44 #include "AliVCluster.h"
45 #include "AliVEvent.h"
46 #include "AliVEventHandler.h"
47 #include "AliAnalysisManager.h"
48 #include "AliAODMCParticle.h"
49 #include "AliMCAnalysisUtils.h"
50 #include "AliAODPid.h"
51 #include "AliExternalTrackParam.h"
54 #include "AliPHOSGeoUtils.h"
55 #include "AliEMCALGeometry.h"
57 ClassImp(AliAnaCalorimeterQA)
59 //________________________________________
60 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
61 AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
64 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kTRUE),
65 fFillAllTH12(kFALSE), fFillAllTH3(kTRUE),
66 fFillAllTMHisto(kTRUE), fFillAllPi0Histo(kTRUE),
67 fCorrelate(kTRUE), fStudyBadClusters(kFALSE),
68 fStudyClustersAsymmetry(kFALSE), fStudyWeight(kFALSE),
71 fNModules(12), fNRCU(2),
72 fNMaxCols(48), fNMaxRows(24),
73 fTimeCutMin(-10000), fTimeCutMax(10000),
74 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
78 fhPhi(0), fhEta(0), fhEtaPhiE(0),
79 fhECharged(0), fhPtCharged(0),
80 fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
85 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0), fhNClusters(0),
88 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
89 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
90 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
91 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
92 fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightedTime(0),
93 fhClusterMaxCellECross(0),
94 fhLambda0(0), fhLambda1(0), fhDispersion(0),
97 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0),
98 fhBadClusterPairDiffTimeE(0), fhBadCellTimeSpreadRespectToCellMax(0),
99 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
100 fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightedTime(0),
101 fhBadClusterMaxCellECross(0),
102 fhBadClusterDeltaIEtaDeltaIPhiE0(0), fhBadClusterDeltaIEtaDeltaIPhiE2(0),
103 fhBadClusterDeltaIEtaDeltaIPhiE6(0), fhBadClusterDeltaIA(0),
106 fhRNCells(0), fhXNCells(0),
107 fhYNCells(0), fhZNCells(0),
111 fhRCellE(0), fhXCellE(0),
112 fhYCellE(0), fhZCellE(0),
114 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
115 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
116 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
117 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
120 fhNCells(0), fhAmplitude(0),
121 fhAmpId(0), fhEtaPhiAmp(0),
122 fhTime(0), fhTimeVz(0),
123 fhTimeId(0), fhTimeAmp(0),
125 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0),
126 fhCaloCorrNCells(0), fhCaloCorrECells(0),
127 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
128 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
129 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
130 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
131 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
132 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
134 //Super-Module dependent histgrams
135 fhEMod(0), fhAmpMod(0), fhTimeMod(0),
136 fhNClustersMod(0), fhNCellsMod(0),
137 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
139 fhGridCells(0), fhGridCellsE(0), fhGridCellsTime(0),
140 fhTimeAmpPerRCU(0), fhIMMod(0),
143 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
144 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
147 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
148 fhRecoMCDeltaE(), fhRecoMCRatioE(),
149 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
152 fhGenMCE(), fhGenMCEtaPhi(),
153 fhGenMCAccE(), fhGenMCAccEtaPhi(),
156 fhEMVxyz(0), fhEMR(0),
157 fhHaVxyz(0), fhHaR(0),
158 fh1pOverE(0), fh1dR(0),
159 fh2EledEdx(0), fh2MatchdEdx(0),
160 fhMCEle1pOverE(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
161 fhMCChHad1pOverE(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
162 fhMCNeutral1pOverE(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0), fh1pOverER02(0),
163 fhMCEle1pOverER02(0), fhMCChHad1pOverER02(0), fhMCNeutral1pOverER02(0)
168 for(Int_t i =0; i < 14; i++){
169 fhLambda0ForW0[i] = 0;
170 //fhLambda1ForW0[i] = 0;
172 for(Int_t j = 0; j < 5; j++){
173 fhLambda0ForW0MC[i][j] = 0;
174 //fhLambda1ForW0MC[i][j] = 0;
180 fhDeltaIEtaDeltaIPhiE0[0] = 0 ; fhDeltaIEtaDeltaIPhiE2[0] = 0; fhDeltaIEtaDeltaIPhiE6[0] = 0;
181 fhDeltaIEtaDeltaIPhiE0[1] = 0 ; fhDeltaIEtaDeltaIPhiE2[1] = 0; fhDeltaIEtaDeltaIPhiE6[1] = 0;
182 fhDeltaIA[0] = 0 ; fhDeltaIAL0[0] = 0; fhDeltaIAL1[0] = 0;
183 fhDeltaIA[1] = 0 ; fhDeltaIAL0[1] = 0; fhDeltaIAL1[1] = 0;
184 fhDeltaIANCells[0] = 0 ; fhDeltaIANCells[1] = 0;
185 fhDeltaIAMC[0] = 0 ; fhDeltaIAMC[1] = 0;
186 fhDeltaIAMC[2] = 0 ; fhDeltaIAMC[3] = 0;
190 for(Int_t i = 0; i < 6; i++){
192 fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
193 fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
194 fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
195 fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
196 fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
197 fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
198 fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
202 //Initialize parameters
206 //____________________________________________________________________________________________________________________________
207 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
208 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
209 const Double_t tmax, Double_t timeAverages[2]
212 //Bad cluster histograms
214 // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
215 // GetReader()->GetEventNumber(), fCalorimeter.Data(),
216 // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
218 fhBadClusterEnergy ->Fill(clus->E());
219 Double_t tof = clus->GetTOF()*1.e9;
220 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
221 fhBadClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
222 fhBadClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
224 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kFALSE);
226 //Clusters in event time differencem bad minus good
228 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
230 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
232 if(clus->GetID()==clus2->GetID()) continue;
234 Float_t maxCellFraction2 = 0.;
235 Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
236 if(IsGoodCluster(absIdMax2,cells)){
237 Double_t tof2 = clus2->GetTOF()*1.e9;
238 fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2));
243 // Max cell compared to other cells in cluster
244 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
246 fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
247 fhBadClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
250 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
252 Int_t absId = clus->GetCellsAbsId()[ipos];
253 if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
255 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
257 fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
258 fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
260 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
262 Double_t time = cells->GetCellTime(absId);
263 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
265 Float_t diff = (tmax-time*1e9);
266 fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
274 //______________________________________________________________________
275 void AliAnaCalorimeterQA::CalculateAverageTime(AliVCluster *clus,
276 AliVCaloCells* cells,
277 Double_t timeAverages[2])
279 // Calculate time averages and weights
281 // First recalculate energy in case non linearity was applied
283 Float_t ampMax = 0, amp = 0;
285 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
287 Int_t id = clus->GetCellsAbsId()[ipos];
289 //Recalibrate cell energy if needed
290 amp = cells->GetCellAmplitude(id);
291 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
303 // Calculate average time of cells in cluster and weighted average
310 Int_t ncells = clus->GetNCells();
311 for (Int_t ipos = 0; ipos < ncells; ipos++)
313 id = clus ->GetCellsAbsId()[ipos];
314 amp = cells->GetCellAmplitude(id);
315 time = cells->GetCellTime(id);
317 //Recalibrate energy and time
318 GetCaloUtils()->RecalibrateCellAmplitude(amp , fCalorimeter, id);
319 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
321 w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
323 wTime += time*1e9 * w;
328 if(ncells > 0) aTime /= ncells;
331 if(wTot > 0) wTime /= wTot;
334 timeAverages[0] = aTime;
335 timeAverages[1] = wTime;
339 //____________________________________________________________
340 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
342 // Plot histograms related to cells only
344 Int_t ncells = cells->GetNumberOfCells();
347 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), ncells );
349 //Init arrays and used variables
350 Int_t *nCellsInModule = new Int_t[fNModules];
351 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
360 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
362 for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++) {
364 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell));
365 Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
367 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
369 if(nModule < fNModules) {
371 //Check if the cell is a bad channel
372 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
373 if(fCalorimeter=="EMCAL")
375 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
379 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
381 } // use bad channel map
383 amp = cells->GetAmplitude(iCell)*recalF;
384 time = cells->GetTime(iCell);
385 id = cells->GetCellNumber(iCell);
387 // Amplitude recalibration if set
388 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
390 // Time recalibration if set
391 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
393 //Transform time to ns
396 // Remove noisy channels, only possible in ESDs
397 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
398 if(time < fTimeCutMin || time > fTimeCutMax){
399 if(GetDebug() > 0 )printf("AliAnaCalorimeterQA - Remove cell with Time %f\n",time);
404 // Remove exotic cells, defined only for EMCAL
405 if(fCalorimeter=="EMCAL" &&
406 GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
409 fhAmplitude->Fill(amp);
410 fhAmpId ->Fill(amp,id);
411 fhAmpMod ->Fill(amp,nModule);
413 if ((fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ||
414 (fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin ) )
417 //E cross for exotic cells
418 if(amp > 0.01) fhCellECross->Fill(amp,1-GetECross(id,cells)/amp);
420 nCellsInModule[nModule]++ ;
425 if(fCalorimeter=="EMCAL")
427 icols = (nModule % 2) ? icol + fNMaxCols : icol;
429 irows = irow + fNMaxRows * Int_t(nModule / 2);
431 irows = irow + (fNMaxRows / 3) * Int_t(nModule / 2);
435 irows = irow + fNMaxRows * nModule;
438 fhGridCells ->Fill(icols,irows);
439 fhGridCellsE->Fill(icols,irows,amp);
441 if(GetReader()->GetDataType() == AliCaloTrackReader::kESD){
442 //printf("%s: time %g\n",fCalorimeter.Data(), time);
444 Double_t v[3] = {0,0,0}; //vertex ;
445 GetReader()->GetVertex(v);
446 if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]),time);
449 fhTimeId ->Fill(time,id);
450 fhTimeAmp ->Fill(amp,time);
451 fhGridCellsTime->Fill(icols,irows,time);
452 fhTimeMod ->Fill(time,nModule);
453 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
458 //Get Eta-Phi position of Cell
461 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
462 Float_t celleta = 0.;
463 Float_t cellphi = 0.;
464 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
466 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
467 Double_t cellpos[] = {0, 0, 0};
468 GetEMCALGeometry()->GetGlobal(id, cellpos);
469 fhXCellE->Fill(cellpos[0],amp) ;
470 fhYCellE->Fill(cellpos[1],amp) ;
471 fhZCellE->Fill(cellpos[2],amp) ;
472 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
473 fhRCellE->Fill(rcell,amp) ;
474 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
476 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
478 Int_t relId[4], module;
479 Float_t xCell, zCell;
481 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
483 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
484 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
485 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
486 fhXCellE ->Fill(xyz.X(),amp) ;
487 fhYCellE ->Fill(xyz.Y(),amp) ;
488 fhZCellE ->Fill(xyz.Z(),amp) ;
489 fhRCellE ->Fill(rcell ,amp) ;
490 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
492 }//fill cell position histograms
494 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
495 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
497 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
501 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
503 //Number of cells per module
504 for(Int_t imod = 0; imod < fNModules; imod++ ) {
507 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
509 fhNCellsMod->Fill(nCellsInModule[imod],imod) ;
513 delete [] nCellsInModule;
517 //__________________________________________________________________________
518 void AliAnaCalorimeterQA::CellInClusterPositionHistograms(AliVCluster* clus)
520 // Fill histograms releated to cell position
523 Int_t nCaloCellsPerCluster = clus->GetNCells();
524 UShort_t * indexList = clus->GetCellsAbsId();
526 clus->GetPosition(pos);
527 Float_t clEnergy = clus->E();
529 //Loop on cluster cells
530 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
532 // printf("Index %d\n",ipos);
533 Int_t absId = indexList[ipos];
535 //Get position of cell compare to cluster
537 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
539 Double_t cellpos[] = {0, 0, 0};
540 GetEMCALGeometry()->GetGlobal(absId, cellpos);
542 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
543 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
544 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
546 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],clEnergy) ;
547 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],clEnergy) ;
548 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],clEnergy) ;
550 Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
551 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
553 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
554 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
556 }//EMCAL and its matrices are available
557 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
559 Int_t relId[4], module;
560 Float_t xCell, zCell;
562 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
564 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
565 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
567 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
568 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
569 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
571 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),clEnergy) ;
572 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),clEnergy) ;
573 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),clEnergy) ;
575 Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
576 Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
578 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
579 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
581 }//PHOS and its matrices are available
582 }// cluster cell loop
585 //___________________________________________________________________________________________
586 void AliAnaCalorimeterQA::ClusterAsymmetryHistograms(AliVCluster* clus, const Int_t absIdMax,
587 const Bool_t goodCluster)
589 // Study the shape of the cluster in cell units terms
591 //No use to study clusters with less than 4 cells
592 if(clus->GetNCells() <=3 ) return;
597 Int_t ietaMax=-1; Int_t iphiMax = 0; Int_t rcuMax = 0;
598 Int_t smMax = GetModuleNumberCellIndexes(absIdMax,fCalorimeter, ietaMax, iphiMax, rcuMax);
600 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
602 Int_t absId = clus->GetCellsAbsId()[ipos];
604 Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
605 Int_t sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ieta, iphi, rcu);
607 if(dIphi < TMath::Abs(iphi-iphiMax)) dIphi = TMath::Abs(iphi-iphiMax);
610 if(dIeta < TMath::Abs(ieta-ietaMax)) dIeta = TMath::Abs(ieta-ietaMax);
613 Int_t ietaShift = ieta;
614 Int_t ietaMaxShift = ietaMax;
615 if (ieta > ietaMax) ietaMaxShift+=48;
617 if(dIeta < TMath::Abs(ietaShift-ietaMaxShift)) dIeta = TMath::Abs(ietaShift-ietaMaxShift);
620 }// fill cell-cluster histogram loop
623 Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
628 // Was cluster matched?
629 Bool_t matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(),GetReader()->GetInputEvent());
631 if (clus->E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta,dIphi);
632 else if(clus->E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta,dIphi);
633 else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta,dIphi);
635 fhDeltaIA[matched]->Fill(clus->E(),dIA);
639 fhDeltaIAL0[matched] ->Fill(clus->GetM02(),dIA);
640 fhDeltaIAL1[matched] ->Fill(clus->GetM20(),dIA);
641 fhDeltaIANCells[matched]->Fill(clus->GetNCells(),dIA);
645 // Origin of clusters
646 Int_t nLabel = clus->GetNLabels();
647 Int_t* labels = clus->GetLabels();
649 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),0);
650 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
651 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
652 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
653 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
654 fhDeltaIAMC[0]->Fill(clus->E(),dIA);//Pure Photon
656 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
657 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
658 fhDeltaIAMC[1]->Fill(clus->E(),dIA);//Pure electron
660 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
661 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
662 fhDeltaIAMC[2]->Fill(clus->E(),dIA);//Converted cluster
664 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
665 fhDeltaIAMC[3]->Fill(clus->E(),dIA);//Hadrons
672 if (clus->E() < 2 ) fhBadClusterDeltaIEtaDeltaIPhiE0->Fill(dIeta,dIphi);
673 else if(clus->E() < 6 ) fhBadClusterDeltaIEtaDeltaIPhiE2->Fill(dIeta,dIphi);
674 else fhBadClusterDeltaIEtaDeltaIPhiE6->Fill(dIeta,dIphi);
676 fhBadClusterDeltaIA->Fill(clus->E(),dIA);
681 //_________________________________________________________________________________________________________________________
682 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus,const TObjArray *caloClusters, AliVCaloCells * cells,
683 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
684 const Double_t tmax, Double_t timeAverages[2])
686 //Fill CaloCluster related histograms
688 Double_t tof = clus->GetTOF()*1.e9;
690 fhLambda0 ->Fill(clus->E(),clus->GetM02());
691 fhLambda1 ->Fill(clus->E(),clus->GetM20());
692 fhDispersion ->Fill(clus->E(),clus->GetDispersion());
694 fhClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
695 fhClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
696 fhClusterTimeEnergy ->Fill(clus->E(),tof);
698 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kTRUE);
700 //Clusters in event time difference
701 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
703 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
705 if(clus->GetID()==clus2->GetID()) continue;
707 if(clus->GetM02() > 0.01 && clus2->GetM02() > 0.01) {
708 Double_t tof2 = clus2->GetTOF()*1.e9;
709 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2);
713 Int_t nModule = GetModuleNumber(clus);
714 Int_t nCaloCellsPerCluster = clus->GetNCells();
716 if(nCaloCellsPerCluster > 1){
718 // check time of cells respect to max energy cell
720 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
721 fhClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
722 fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
725 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
727 Int_t absId = clus->GetCellsAbsId()[ipos];
728 if(absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01) continue;
730 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
731 fhClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
732 fhClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
734 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
736 Double_t time = cells->GetCellTime(absId);
737 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
739 Float_t diff = (tmax-time*1.0e9);
740 fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
741 if(TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId);
744 }// fill cell-cluster histogram loop
746 }//check time and energy of cells respect to max energy cell if cluster of more than 1 cell
749 // Get vertex for photon momentum calculation and event selection
750 Double_t v[3] = {0,0,0}; //vertex ;
751 //GetReader()->GetVertex(v); //
754 clus->GetMomentum(mom,v);
757 Float_t pt = mom.Pt();
758 Float_t eta = mom.Eta();
759 Float_t phi = mom.Phi();
760 if(phi < 0) phi +=TMath::TwoPi();
763 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
767 if(nModule >=0 && nModule < fNModules) fhEMod->Fill(e,nModule);
775 fhEtaPhiE->Fill(eta,phi,e);
778 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
781 if(fFillAllPosHisto2){
784 clus->GetPosition(pos);
786 fhXE ->Fill(pos[0],e);
787 fhYE ->Fill(pos[1],e);
788 fhZE ->Fill(pos[2],e);
790 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
792 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
793 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
794 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
795 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
797 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
800 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
804 //____________________________________________________________________________
805 void AliAnaCalorimeterQA::ClusterLoopHistograms(const TObjArray *caloClusters,
806 AliVCaloCells* cells)
808 // Fill clusters related histograms
813 Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
814 Int_t nCaloClustersAccepted = 0 ;
815 Int_t nCaloCellsPerCluster = 0 ;
816 Bool_t matched = kFALSE;
819 // Get vertex for photon momentum calculation and event selection
820 Double_t v[3] = {0,0,0}; //vertex ;
821 //GetReader()->GetVertex(v);
823 Int_t *nClustersInModule = new Int_t[fNModules];
824 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
827 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
829 // Loop over CaloClusters
830 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
833 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
834 iclus+1,nCaloClusters,GetReader()->GetDataType());
836 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
838 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
839 Float_t maxCellFraction = 0.;
840 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
842 //Cut on time of clusters
843 Double_t tof = clus->GetTOF()*1.e9;
844 if(tof < fTimeCutMin || tof > fTimeCutMax){
845 if(GetDebug() > 0 )printf("AliAnaCalorimeterQA - Remove cluster with TOF %f\n",tof);
849 // Get cluster kinematics
850 clus->GetMomentum(mom,v);
852 // Check only certain regions
854 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
858 nLabel = clus->GetNLabels();
859 labels = clus->GetLabels();
861 // SuperModule number of cluster
862 nModule = GetModuleNumber(clus);
865 nCaloCellsPerCluster = clus->GetNCells();
867 // Cluster mathed with track?
868 matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
870 // Get some time averages
871 Double_t averTime[4] = {0.,0.,0.,0.};
872 CalculateAverageTime(clus, cells, averTime);
874 //Get time of max cell
875 Double_t tmax = cells->GetCellTime(absIdMax);
876 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
879 // Fill histograms related to single cluster
882 // Fill some histograms before applying the exotic cell / bad map cut
883 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
884 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
886 fhClusterMaxCellDiffNoCut->Fill(clus->E(),maxCellFraction);
888 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
889 GetCaloUtils()->RecalibrateCellAmplitude(ampMax,fCalorimeter, absIdMax);
891 //Check bad clusters if requested and rejection was not on
892 Bool_t goodCluster = IsGoodCluster(absIdMax, cells);
894 Float_t eCrossFrac = 0;
895 if(ampMax > 0.01) eCrossFrac = 1-GetECross(absIdMax,cells)/ampMax;
899 BadClusterHistograms(clus, caloClusters, cells, absIdMax,
900 maxCellFraction, eCrossFrac, tmax, averTime);
904 ClusterHistograms(clus, caloClusters, cells, absIdMax,
905 maxCellFraction, eCrossFrac, tmax, averTime);
907 nCaloClustersAccepted++;
908 nModule = GetModuleNumber(clus);
909 if(nModule >=0 && nModule < fNModules)
911 if (fCalorimeter=="EMCAL" && mom.E() > 2*fEMCALCellAmpMin) nClustersInModule[nModule]++;
912 else if(fCalorimeter=="PHOS" && mom.E() > 2*fPHOSCellAmpMin ) nClustersInModule[nModule]++;
916 if(fStudyWeight) WeightHistograms(clus, cells);
918 // Cells in cluster position
919 if(fFillAllPosHisto) CellInClusterPositionHistograms(clus);
921 // Fill histograms related to single cluster, mc vs data
924 if(IsDataMC() && nLabel > 0 && labels)
925 mcOK = ClusterMCHistograms(mom, matched, labels, nLabel, pdg);
927 // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
928 if( matched && fFillAllTMHisto)
929 ClusterMatchedWithTrackHistograms(clus,mom,mcOK,pdg);
932 // Try to reduce background with a mild shower shape cut and no more than 1 maxima
933 // in cluster and remove low energy clusters
934 if(fFillAllPi0Histo && nCaloClusters > 1 && nCaloCellsPerCluster > 1 &&
935 GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1 &&
936 clus->GetM02() < 0.5 && clus->E() > 0.3)
937 InvariantMassHistograms(iclus, mom, nModule, caloClusters,cells);
941 // Number of clusters histograms
942 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
944 // Number of clusters per module
945 for(Int_t imod = 0; imod < fNModules; imod++ )
948 printf("AliAnaCalorimeterQA::ClusterLoopHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
949 fhNClustersMod->Fill(nClustersInModule[imod],imod);
952 delete [] nClustersInModule;
956 //______________________________________________________________________________________________________
957 Bool_t AliAnaCalorimeterQA::ClusterMCHistograms(const TLorentzVector mom, const Bool_t matched,
958 const Int_t * labels, const Int_t nLabels, Int_t & pdg )
961 //Fill histograms only possible when simulation
963 if(!labels || nLabels<=0)
965 if(GetDebug() > 1) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Strange, labels array %p, n labels %d \n", labels,nLabels);
971 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Primaries: nlabels %d\n",nLabels);
975 Float_t eta = mom.Eta();
976 Float_t phi = mom.Phi();
977 if(phi < 0) phi +=TMath::TwoPi();
979 AliAODMCParticle * aodprimary = 0x0;
980 TParticle * primary = 0x0;
982 //Play with the MC stack if available
983 Int_t label = labels[0];
987 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** bad label ***: label %d \n", label);
991 Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
992 Float_t vxMC= 0; Float_t vyMC = 0;
993 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
997 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
999 if ( GetReader()->ReadStack() &&
1000 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1001 { //it MC stack and known tag
1003 if( label >= GetMCStack()->GetNtrack())
1005 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1009 primary = GetMCStack()->Particle(label);
1011 pdg0 = TMath::Abs(primary->GetPdgCode());
1013 status = primary->GetStatusCode();
1014 vxMC = primary->Vx();
1015 vyMC = primary->Vy();
1016 iParent = primary->GetFirstMother();
1020 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Cluster most contributing mother: \n");
1021 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1024 //Get final particle, no conversion products
1025 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1028 primary = GetMCStack()->Particle(iParent);
1029 pdg = TMath::Abs(primary->GetPdgCode());
1031 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Converted cluster!. Find before conversion: \n");
1033 while((pdg == 22 || pdg == 11) && status != 1)
1035 Int_t iMotherOrg = iMother;
1037 primary = GetMCStack()->Particle(iMother);
1038 status = primary->GetStatusCode();
1039 pdg = TMath::Abs(primary->GetPdgCode());
1040 iParent = primary->GetFirstMother();
1042 // If gone too back and non stable, assign the decay photon/electron
1043 // there are other possible decays, ignore them for the moment
1044 if(pdg==111 || pdg==221)
1046 primary = GetMCStack()->Particle(iMotherOrg);
1057 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1062 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1063 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1068 //Overlapped pi0 (or eta, there will be very few), get the meson
1069 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1070 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1072 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1074 while(pdg != 111 && pdg != 221)
1076 //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMCStack()->Particle(iParent)->GetPdgCode());
1078 primary = GetMCStack()->Particle(iMother);
1079 status = primary->GetStatusCode();
1080 pdg = TMath::Abs(primary->GetPdgCode());
1081 iParent = primary->GetFirstMother();
1083 if( iParent < 0 )break;
1085 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1089 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1094 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1095 primary->GetName(),iMother);
1098 eMC = primary->Energy();
1099 ptMC = primary->Pt();
1100 phiMC = primary->Phi();
1101 etaMC = primary->Eta();
1102 pdg = TMath::Abs(primary->GetPdgCode());
1103 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1106 else if( GetReader()->ReadAODMCParticles() &&
1107 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1108 {//it MC AOD and known tag
1109 //Get the list of MC particles
1110 if(!GetReader()->GetAODMCParticles(0))
1111 AliFatal("MCParticles not available!");
1113 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1115 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1117 status = aodprimary->IsPrimary();
1118 vxMC = aodprimary->Xv();
1119 vyMC = aodprimary->Yv();
1120 iParent = aodprimary->GetMother();
1124 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1125 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1126 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1129 //Get final particle, no conversion products
1130 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1133 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1135 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1136 pdg = TMath::Abs(aodprimary->GetPdgCode());
1137 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary())
1139 Int_t iMotherOrg = iMother;
1141 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1142 status = aodprimary->IsPrimary();
1143 iParent = aodprimary->GetMother();
1144 pdg = TMath::Abs(aodprimary->GetPdgCode());
1146 // If gone too back and non stable, assign the decay photon/electron
1147 // there are other possible decays, ignore them for the moment
1148 if(pdg==111 || pdg==221)
1150 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMotherOrg);
1161 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1162 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1167 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1168 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1169 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1174 //Overlapped pi0 (or eta, there will be very few), get the meson
1175 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1176 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1178 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1179 while(pdg != 111 && pdg != 221)
1182 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1183 status = aodprimary->IsPrimary();
1184 iParent = aodprimary->GetMother();
1185 pdg = TMath::Abs(aodprimary->GetPdgCode());
1187 if(iParent < 0 ) break;
1189 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1193 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1198 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1199 aodprimary->GetName(),iMother);
1202 status = aodprimary->IsPrimary();
1203 eMC = aodprimary->E();
1204 ptMC = aodprimary->Pt();
1205 phiMC = aodprimary->Phi();
1206 etaMC = aodprimary->Eta();
1207 pdg = TMath::Abs(aodprimary->GetPdgCode());
1208 charge = aodprimary->Charge();
1212 //Float_t vz = primary->Vz();
1213 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1214 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1)
1216 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1217 fhEMR ->Fill(e,rVMC);
1220 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1221 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1222 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1224 //Overlapped pi0 (or eta, there will be very few)
1225 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0))
1227 fhRecoMCE [kmcPi0][matched] ->Fill(e,eMC);
1228 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPi0][(matched)]->Fill(eta,etaMC);
1229 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPi0][(matched)]->Fill(phi,phiMC);
1230 if(eMC > 0) fhRecoMCRatioE [kmcPi0][(matched)]->Fill(e,e/eMC);
1231 fhRecoMCDeltaE [kmcPi0][(matched)]->Fill(e,eMC-e);
1232 fhRecoMCDeltaPhi[kmcPi0][(matched)]->Fill(e,phiMC-phi);
1233 fhRecoMCDeltaEta[kmcPi0][(matched)]->Fill(e,etaMC-eta);
1234 }//Overlapped pizero decay
1235 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1237 fhRecoMCE [kmcEta][(matched)] ->Fill(e,eMC);
1238 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcEta][(matched)]->Fill(eta,etaMC);
1239 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcEta][(matched)]->Fill(phi,phiMC);
1240 if(eMC > 0) fhRecoMCRatioE [kmcEta][(matched)]->Fill(e,e/eMC);
1241 fhRecoMCDeltaE [kmcEta][(matched)]->Fill(e,eMC-e);
1242 fhRecoMCDeltaPhi[kmcEta][(matched)]->Fill(e,phiMC-phi);
1243 fhRecoMCDeltaEta[kmcEta][(matched)]->Fill(e,etaMC-eta);
1244 }//Overlapped eta decay
1245 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
1246 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1248 fhRecoMCE [kmcPhoton][(matched)] ->Fill(e,eMC);
1249 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPhoton][(matched)]->Fill(eta,etaMC);
1250 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPhoton][(matched)]->Fill(phi,phiMC);
1251 if(eMC > 0) fhRecoMCRatioE [kmcPhoton][(matched)]->Fill(e,e/eMC);
1253 fhRecoMCDeltaE [kmcPhoton][(matched)]->Fill(e,eMC-e);
1254 fhRecoMCDeltaPhi[kmcPhoton][(matched)]->Fill(e,phiMC-phi);
1255 fhRecoMCDeltaEta[kmcPhoton][(matched)]->Fill(e,etaMC-eta);
1257 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
1258 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1260 fhRecoMCE [kmcElectron][(matched)] ->Fill(e,eMC);
1261 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcElectron][(matched)]->Fill(eta,etaMC);
1262 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcElectron][(matched)]->Fill(phi,phiMC);
1263 if(eMC > 0) fhRecoMCRatioE [kmcElectron][(matched)]->Fill(e,e/eMC);
1264 fhRecoMCDeltaE [kmcElectron][(matched)]->Fill(e,eMC-e);
1265 fhRecoMCDeltaPhi[kmcElectron][(matched)]->Fill(e,phiMC-phi);
1266 fhRecoMCDeltaEta[kmcElectron][(matched)]->Fill(e,etaMC-eta);
1267 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1268 fhEMR ->Fill(e,rVMC);
1270 else if(charge == 0)
1272 fhRecoMCE [kmcNeHadron][(matched)] ->Fill(e,eMC);
1273 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcNeHadron][(matched)]->Fill(eta,etaMC);
1274 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcNeHadron][(matched)]->Fill(phi,phiMC);
1275 if(eMC > 0) fhRecoMCRatioE [kmcNeHadron][(matched)]->Fill(e,e/eMC);
1276 fhRecoMCDeltaE [kmcNeHadron][(matched)]->Fill(e,eMC-e);
1277 fhRecoMCDeltaPhi[kmcNeHadron][(matched)]->Fill(e,phiMC-phi);
1278 fhRecoMCDeltaEta[kmcNeHadron][(matched)]->Fill(e,etaMC-eta);
1279 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1280 fhHaR ->Fill(e,rVMC);
1284 fhRecoMCE [kmcChHadron][(matched)] ->Fill(e,eMC);
1285 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcChHadron][(matched)]->Fill(eta,etaMC);
1286 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcChHadron][(matched)]->Fill(phi,phiMC);
1287 if(eMC > 0) fhRecoMCRatioE [kmcChHadron][(matched)]->Fill(e,e/eMC);
1288 fhRecoMCDeltaE [kmcChHadron][(matched)]->Fill(e,eMC-e);
1289 fhRecoMCDeltaPhi[kmcChHadron][(matched)]->Fill(e,phiMC-phi);
1290 fhRecoMCDeltaEta[kmcChHadron][(matched)]->Fill(e,etaMC-eta);
1291 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1292 fhHaR ->Fill(e,rVMC);
1295 if(primary || aodprimary) return kTRUE ;
1300 //________________________________________________________________________________________________
1301 void AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(AliVCluster *clus, TLorentzVector mom,
1302 const Bool_t okPrimary, const Int_t pdg)
1304 //Histograms for clusters matched with tracks
1306 Float_t e = mom.E();
1307 Float_t pt = mom.Pt();
1308 Float_t eta = mom.Eta();
1309 Float_t phi = mom.Phi();
1310 if(phi < 0) phi +=TMath::TwoPi();
1314 fhECharged ->Fill(e);
1315 fhPtCharged ->Fill(pt);
1316 fhPhiCharged ->Fill(phi);
1317 fhEtaCharged ->Fill(eta);
1320 //Study the track and matched cluster if track exists.
1322 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
1326 Double_t emcpos[3] = {0.,0.,0.};
1327 Double_t emcmom[3] = {0.,0.,0.};
1328 Double_t radius = 441.0; //[cm] EMCAL radius +13cm
1329 Double_t bfield = 0.;
1335 Double_t tpcSignal = 0;
1336 Bool_t okpos = kFALSE;
1337 Bool_t okmom = kFALSE;
1338 Bool_t okout = kFALSE;
1342 //In case of ESDs get the parameters in this way
1343 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD)
1345 if (track->GetOuterParam() )
1349 bfield = GetReader()->GetInputEvent()->GetMagneticField();
1350 okpos = track->GetOuterParam()->GetXYZAt(radius,bfield,emcpos);
1351 okmom = track->GetOuterParam()->GetPxPyPzAt(radius,bfield,emcmom);
1352 if(!(okpos && okmom)) return;
1354 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1355 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1356 tphi = position.Phi();
1357 teta = position.Eta();
1358 tmom = momentum.Mag();
1362 tpcSignal = track->GetTPCsignal();
1364 nITS = track->GetNcls(0);
1365 nTPC = track->GetNcls(1);
1366 }//Outer param available
1368 else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD)
1370 AliAODPid* pid = (AliAODPid*) ((AliAODTrack *) track)->GetDetPid();
1373 pid->GetEMCALPosition(emcpos);
1374 pid->GetEMCALMomentum(emcmom);
1376 TVector3 position(emcpos[0],emcpos[1],emcpos[2]);
1377 TVector3 momentum(emcmom[0],emcmom[1],emcmom[2]);
1378 tphi = position.Phi();
1379 teta = position.Eta();
1380 tmom = momentum.Mag();
1384 tpcSignal = pid->GetTPCsignal();
1391 //printf("okout\n");
1392 Double_t deta = teta - eta;
1393 Double_t dphi = tphi - phi;
1394 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
1395 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
1396 Double_t dR = sqrt(dphi*dphi + deta*deta);
1398 Double_t pOverE = tmom/e;
1400 fh1pOverE->Fill(tpt, pOverE);
1401 if(dR < 0.02) fh1pOverER02->Fill(tpt,pOverE);
1404 fh2MatchdEdx->Fill(tmom2,tpcSignal);
1406 if(IsDataMC() && okPrimary){
1407 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1409 if(TMath::Abs(pdg) == 11){
1410 fhMCEle1pOverE->Fill(tpt,pOverE);
1411 fhMCEle1dR->Fill(dR);
1412 fhMCEle2MatchdEdx->Fill(tmom2,tpcSignal);
1413 if(dR < 0.02) fhMCEle1pOverER02->Fill(tpt,pOverE);
1416 fhMCChHad1pOverE->Fill(tpt,pOverE);
1417 fhMCChHad1dR->Fill(dR);
1418 fhMCChHad2MatchdEdx->Fill(tmom2,tpcSignal);
1419 if(dR < 0.02) fhMCChHad1pOverER02->Fill(tpt,pOverE);
1421 else if(charge == 0){
1422 fhMCNeutral1pOverE->Fill(tpt,pOverE);
1423 fhMCNeutral1dR->Fill(dR);
1424 fhMCNeutral2MatchdEdx->Fill(tmom2,tpcSignal);
1425 if(dR < 0.02) fhMCNeutral1pOverER02->Fill(tpt,pOverE);
1429 if(dR < 0.02 && pOverE > 0.5 && pOverE < 1.5
1430 && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20) {
1431 fh2EledEdx->Fill(tmom2,tpcSignal);
1434 else{//no ESD external param or AODPid
1436 if(GetDebug() >= 0) printf("No ESD external param or AliAODPid \n");
1441 //___________________________________
1442 void AliAnaCalorimeterQA::Correlate()
1444 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
1447 TObjArray * caloClustersEMCAL = GetEMCALClusters();
1448 TObjArray * caloClustersPHOS = GetPHOSClusters();
1450 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
1451 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
1453 Float_t sumClusterEnergyEMCAL = 0;
1454 Float_t sumClusterEnergyPHOS = 0;
1456 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1457 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
1458 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1459 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
1464 AliVCaloCells * cellsEMCAL = GetEMCALCells();
1465 AliVCaloCells * cellsPHOS = GetPHOSCells();
1467 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
1468 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
1470 Float_t sumCellEnergyEMCAL = 0;
1471 Float_t sumCellEnergyPHOS = 0;
1473 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1474 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1475 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1476 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1480 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
1481 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1482 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
1483 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1485 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
1486 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
1487 Int_t trM = GetTrackMultiplicity();
1488 if(fCalorimeter=="PHOS"){
1489 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
1490 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
1491 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
1492 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
1494 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
1495 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
1496 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
1497 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
1499 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
1500 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
1501 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
1502 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
1505 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
1506 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
1507 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
1508 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
1510 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
1511 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
1512 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
1513 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
1515 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
1516 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
1517 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
1518 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
1523 printf("AliAnaCalorimeterQA::Correlate(): \n");
1524 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1525 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1526 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1527 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
1528 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
1533 //__________________________________________________
1534 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
1536 //Save parameters used for analysis
1537 TString parList ; //this will be list of parameters used for this analysis.
1538 const Int_t buffersize = 255;
1539 char onePar[buffersize] ;
1541 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
1543 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1545 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
1547 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
1549 //Get parameters set in base class.
1550 //parList += GetBaseParametersList() ;
1552 //Get parameters set in FiducialCut class (not available yet)
1553 //parlist += GetFidCut()->GetFidCutParametersList()
1555 return new TObjString(parList) ;
1558 //____________________________________________________
1559 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
1561 // Create histograms to be saved in output file and
1562 // store them in outputContainer
1564 TList * outputContainer = new TList() ;
1565 outputContainer->SetName("QAHistos") ;
1568 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1569 Int_t nfineptbins = GetHistogramRanges()->GetHistoFinePtBins(); Float_t ptfinemax = GetHistogramRanges()->GetHistoFinePtMax(); Float_t ptfinemin = GetHistogramRanges()->GetHistoFinePtMin();
1570 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1571 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1572 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins(); Float_t massmax = GetHistogramRanges()->GetHistoMassMax(); Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
1573 Int_t nasymbins = GetHistogramRanges()->GetHistoAsymmetryBins(); Float_t asymmax = GetHistogramRanges()->GetHistoAsymmetryMax(); Float_t asymmin = GetHistogramRanges()->GetHistoAsymmetryMin();
1574 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins(); Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax(); Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1575 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins(); Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax(); Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1576 Int_t ndRbins = GetHistogramRanges()->GetHistodRBins(); Float_t dRmax = GetHistogramRanges()->GetHistodRMax(); Float_t dRmin = GetHistogramRanges()->GetHistodRMin();
1577 Int_t ntimebins = GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1578 Int_t nclbins = GetHistogramRanges()->GetHistoNClustersBins(); Int_t nclmax = GetHistogramRanges()->GetHistoNClustersMax(); Int_t nclmin = GetHistogramRanges()->GetHistoNClustersMin();
1579 Int_t ncebins = GetHistogramRanges()->GetHistoNCellsBins(); Int_t ncemax = GetHistogramRanges()->GetHistoNCellsMax(); Int_t ncemin = GetHistogramRanges()->GetHistoNCellsMin();
1580 Int_t nceclbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nceclmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nceclmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1581 Int_t nvdistbins = GetHistogramRanges()->GetHistoVertexDistBins(); Float_t vdistmax = GetHistogramRanges()->GetHistoVertexDistMax(); Float_t vdistmin = GetHistogramRanges()->GetHistoVertexDistMin();
1582 Int_t rbins = GetHistogramRanges()->GetHistoRBins(); Float_t rmax = GetHistogramRanges()->GetHistoRMax(); Float_t rmin = GetHistogramRanges()->GetHistoRMin();
1583 Int_t xbins = GetHistogramRanges()->GetHistoXBins(); Float_t xmax = GetHistogramRanges()->GetHistoXMax(); Float_t xmin = GetHistogramRanges()->GetHistoXMin();
1584 Int_t ybins = GetHistogramRanges()->GetHistoYBins(); Float_t ymax = GetHistogramRanges()->GetHistoYMax(); Float_t ymin = GetHistogramRanges()->GetHistoYMin();
1585 Int_t zbins = GetHistogramRanges()->GetHistoZBins(); Float_t zmax = GetHistogramRanges()->GetHistoZMax(); Float_t zmin = GetHistogramRanges()->GetHistoZMin();
1586 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1587 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
1589 Int_t nv0sbins = GetHistogramRanges()->GetHistoV0SignalBins(); Int_t nv0smax = GetHistogramRanges()->GetHistoV0SignalMax(); Int_t nv0smin = GetHistogramRanges()->GetHistoV0SignalMin();
1590 Int_t nv0mbins = GetHistogramRanges()->GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistogramRanges()->GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistogramRanges()->GetHistoV0MultiplicityMin();
1591 Int_t ntrmbins = GetHistogramRanges()->GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistogramRanges()->GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistogramRanges()->GetHistoTrackMultiplicityMin();
1598 if(fCalorimeter=="PHOS"){
1604 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
1605 fhE->SetXTitle("E (GeV)");
1606 outputContainer->Add(fhE);
1609 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
1610 fhPt->SetXTitle("p_{T} (GeV/c)");
1611 outputContainer->Add(fhPt);
1613 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
1614 fhPhi->SetXTitle("#phi (rad)");
1615 outputContainer->Add(fhPhi);
1617 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
1618 fhEta->SetXTitle("#eta ");
1619 outputContainer->Add(fhEta);
1623 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
1624 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1625 fhEtaPhiE->SetXTitle("#eta ");
1626 fhEtaPhiE->SetYTitle("#phi (rad)");
1627 fhEtaPhiE->SetZTitle("E (GeV) ");
1628 outputContainer->Add(fhEtaPhiE);
1631 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
1632 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1633 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
1634 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
1635 outputContainer->Add(fhClusterTimeEnergy);
1637 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
1638 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1639 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
1640 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1641 outputContainer->Add(fhClusterPairDiffTimeE);
1643 fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
1644 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1645 fhLambda0->SetXTitle("E_{cluster}");
1646 fhLambda0->SetYTitle("#lambda^{2}_{0}");
1647 outputContainer->Add(fhLambda0);
1649 fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E for bad cluster ",
1650 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1651 fhLambda1->SetXTitle("E_{cluster}");
1652 fhLambda1->SetYTitle("#lambda^{2}_{1}");
1653 outputContainer->Add(fhLambda1);
1655 fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
1656 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1657 fhDispersion->SetXTitle("E_{cluster}");
1658 fhDispersion->SetYTitle("Dispersion");
1659 outputContainer->Add(fhDispersion);
1661 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1662 nptbins,ptmin,ptmax, 100,0,1.);
1663 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1664 fhClusterMaxCellCloseCellRatio->SetYTitle("E_{cell i}/E_{cell max}");
1665 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
1667 fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1668 nptbins,ptmin,ptmax, 500,0,100.);
1669 fhClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1670 fhClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max}-E_{cell i} (GeV)");
1671 outputContainer->Add(fhClusterMaxCellCloseCellDiff);
1673 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1674 nptbins,ptmin,ptmax, 500,0,1.);
1675 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1676 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1677 outputContainer->Add(fhClusterMaxCellDiff);
1679 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
1680 nptbins,ptmin,ptmax, 500,0,1.);
1681 fhClusterMaxCellDiffNoCut->SetXTitle("E_{cluster} (GeV) ");
1682 fhClusterMaxCellDiffNoCut->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1683 outputContainer->Add(fhClusterMaxCellDiffNoCut);
1685 fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
1686 nptbins,ptmin,ptmax, 400,-1,1.);
1687 fhClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1688 fhClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1689 outputContainer->Add(fhClusterMaxCellECross);
1691 if(fStudyBadClusters)
1694 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
1695 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
1696 outputContainer->Add(fhBadClusterEnergy);
1698 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
1699 nptbins,ptmin,ptmax, 100,0,1.);
1700 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1701 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
1702 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
1704 fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
1705 nptbins,ptmin,ptmax, 500,0,100);
1706 fhBadClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1707 fhBadClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max} - E_{cell i} (GeV)");
1708 outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
1710 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
1711 nptbins,ptmin,ptmax, 500,0,1.);
1712 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1713 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster}");
1714 outputContainer->Add(fhBadClusterMaxCellDiff);
1716 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
1717 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1718 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
1719 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
1720 outputContainer->Add(fhBadClusterTimeEnergy);
1722 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1723 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
1724 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1725 outputContainer->Add(fhBadClusterPairDiffTimeE);
1727 fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, bad clusters",
1728 nptbins,ptmin,ptmax, 400,-1,1.);
1729 fhBadClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1730 fhBadClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1731 outputContainer->Add(fhBadClusterMaxCellECross);
1733 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
1734 fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1735 fhBadCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
1736 fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max - i} (ns)");
1737 outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
1739 fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1740 fhBadClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
1741 fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
1742 outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
1744 fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1745 fhBadClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
1746 fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
1747 outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
1753 // Cluster size in terms of cells
1754 if(fStudyClustersAsymmetry){
1755 fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1757 fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
1758 fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
1759 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
1761 fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1763 fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
1764 fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
1765 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
1767 fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1769 fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
1770 fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
1771 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
1773 fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
1774 nptbins,ptmin,ptmax,21,-1.05,1.05);
1775 fhDeltaIA[0]->SetXTitle("E_{cluster}");
1776 fhDeltaIA[0]->SetYTitle("A_{cell in cluster}");
1777 outputContainer->Add(fhDeltaIA[0]);
1779 fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
1780 ssbins,ssmin,ssmax,21,-1.05,1.05);
1781 fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
1782 fhDeltaIAL0[0]->SetYTitle("A_{cell in cluster}");
1783 outputContainer->Add(fhDeltaIAL0[0]);
1785 fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
1786 ssbins,ssmin,ssmax,21,-1.05,1.05);
1787 fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
1788 fhDeltaIAL1[0]->SetYTitle("A_{cell in cluster}");
1789 outputContainer->Add(fhDeltaIAL1[0]);
1791 fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
1792 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1793 fhDeltaIANCells[0]->SetXTitle("N_{cell in cluster}");
1794 fhDeltaIANCells[0]->SetYTitle("A_{cell in cluster}");
1795 outputContainer->Add(fhDeltaIANCells[0]);
1798 fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3, matched with track",
1800 fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
1801 fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
1802 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
1804 fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3, matched with track",
1806 fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
1807 fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
1808 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
1810 fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3, matched with track",
1812 fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
1813 fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
1814 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
1816 fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
1817 nptbins,ptmin,ptmax,21,-1.05,1.05);
1818 fhDeltaIA[1]->SetXTitle("E_{cluster}");
1819 fhDeltaIA[1]->SetYTitle("A_{cell in cluster}");
1820 outputContainer->Add(fhDeltaIA[1]);
1822 fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
1823 ssbins,ssmin,ssmax,21,-1.05,1.05);
1824 fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
1825 fhDeltaIAL0[1]->SetYTitle("A_{cell in cluster}");
1826 outputContainer->Add(fhDeltaIAL0[1]);
1828 fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
1829 ssbins,ssmin,ssmax,21,-1.05,1.05);
1830 fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
1831 fhDeltaIAL1[1]->SetYTitle("A_{cell in cluster}");
1832 outputContainer->Add(fhDeltaIAL1[1]);
1834 fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
1835 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1836 fhDeltaIANCells[1]->SetXTitle("N_{cell in cluster}");
1837 fhDeltaIANCells[1]->SetYTitle("A_{cell in cluster}");
1838 outputContainer->Add(fhDeltaIANCells[1]);
1841 TString particle[]={"Photon","Electron","Conversion","Hadron"};
1842 for (Int_t iPart = 0; iPart < 4; iPart++) {
1844 fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
1845 nptbins,ptmin,ptmax,21,-1.05,1.05);
1846 fhDeltaIAMC[iPart]->SetXTitle("E_{cluster}");
1847 fhDeltaIAMC[iPart]->SetYTitle("A_{cell in cluster}");
1848 outputContainer->Add(fhDeltaIAMC[iPart]);
1851 if(fStudyBadClusters)
1853 fhBadClusterDeltaIEtaDeltaIPhiE0 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1855 fhBadClusterDeltaIEtaDeltaIPhiE0->SetXTitle("#Delta Column");
1856 fhBadClusterDeltaIEtaDeltaIPhiE0->SetYTitle("#Delta Row");
1857 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE0);
1859 fhBadClusterDeltaIEtaDeltaIPhiE2 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1861 fhBadClusterDeltaIEtaDeltaIPhiE2->SetXTitle("#Delta Column");
1862 fhBadClusterDeltaIEtaDeltaIPhiE2->SetYTitle("#Delta Row");
1863 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE2);
1865 fhBadClusterDeltaIEtaDeltaIPhiE6 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1867 fhBadClusterDeltaIEtaDeltaIPhiE6->SetXTitle("#Delta Column");
1868 fhBadClusterDeltaIEtaDeltaIPhiE6->SetYTitle("#Delta Row");
1869 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE6);
1871 fhBadClusterDeltaIA = new TH2F ("hBadClusterDeltaIA"," Cluster *asymmetry* in cell units vs E",
1872 nptbins,ptmin,ptmax,21,-1.05,1.05);
1873 fhBadClusterDeltaIA->SetXTitle("E_{cluster}");
1874 fhBadClusterDeltaIA->SetYTitle("A_{cell in cluster}");
1875 outputContainer->Add(fhBadClusterDeltaIA);
1881 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy",
1882 nptbins,ptmin,ptmax, 100,0,1.);
1883 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1884 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
1885 outputContainer->Add(fhECellClusterRatio);
1887 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy",
1888 nptbins,ptmin,ptmax, 100,-10,0);
1889 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1890 fhECellClusterLogRatio->SetYTitle("Log(E_{cell i}/E_{cluster})");
1891 outputContainer->Add(fhECellClusterLogRatio);
1893 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy",
1894 nptbins,ptmin,ptmax, 100,0,1.);
1895 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1896 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
1897 outputContainer->Add(fhEMaxCellClusterRatio);
1899 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy",
1900 nptbins,ptmin,ptmax, 100,-10,0);
1901 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1902 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1903 outputContainer->Add(fhEMaxCellClusterLogRatio);
1905 for(Int_t iw = 0; iw < 14; iw++){
1906 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f",1+0.5*iw),
1907 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1908 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
1909 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
1910 outputContainer->Add(fhLambda0ForW0[iw]);
1912 // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f",1+0.5*iw),
1913 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1914 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
1915 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
1916 // outputContainer->Add(fhLambda1ForW0[iw]);
1919 TString mcnames[] = {"Photon", "Electron","Conversion","Pi0","Hadron"};
1920 for(Int_t imc = 0; imc < 5; imc++){
1921 fhLambda0ForW0MC[iw][imc] = new TH2F (Form("hLambda0ForW0%d_MC%s",iw,mcnames[imc].Data()),
1922 Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
1923 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1924 fhLambda0ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
1925 fhLambda0ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{0}");
1926 outputContainer->Add(fhLambda0ForW0MC[iw][imc]);
1928 // fhLambda1ForW0MC[iw][imc] = new TH2F (Form("hLambda1ForW0%d_MC%s",iw,mcnames[imc].Data()),
1929 // Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
1930 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1931 // fhLambda1ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
1932 // fhLambda1ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{1}");
1933 // outputContainer->Add(fhLambda1ForW0MC[iw][imc]);
1942 if(fFillAllTMHisto){
1944 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
1945 fhECharged->SetXTitle("E (GeV)");
1946 outputContainer->Add(fhECharged);
1948 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
1949 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
1950 outputContainer->Add(fhPtCharged);
1952 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
1953 fhPhiCharged->SetXTitle("#phi (rad)");
1954 outputContainer->Add(fhPhiCharged);
1956 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
1957 fhEtaCharged->SetXTitle("#eta ");
1958 outputContainer->Add(fhEtaCharged);
1961 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
1962 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1963 fhEtaPhiECharged->SetXTitle("#eta ");
1964 fhEtaPhiECharged->SetYTitle("#phi ");
1965 fhEtaPhiECharged->SetZTitle("E (GeV) ");
1966 outputContainer->Add(fhEtaPhiECharged);
1969 fh1pOverE = new TH2F("h1pOverE","TRACK matches p/E",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1970 fh1pOverE->SetYTitle("p/E");
1971 fh1pOverE->SetXTitle("p_{T} (GeV/c)");
1972 outputContainer->Add(fh1pOverE);
1974 fh1dR = new TH1F("h1dR","TRACK matches dR",ndRbins,dRmin,dRmax);
1975 fh1dR->SetXTitle("#Delta R (rad)");
1976 outputContainer->Add(fh1dR) ;
1978 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1979 fh2MatchdEdx->SetXTitle("p (GeV/c)");
1980 fh2MatchdEdx->SetYTitle("<dE/dx>");
1981 outputContainer->Add(fh2MatchdEdx);
1983 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
1984 fh2EledEdx->SetXTitle("p (GeV/c)");
1985 fh2EledEdx->SetYTitle("<dE/dx>");
1986 outputContainer->Add(fh2EledEdx) ;
1988 fh1pOverER02 = new TH2F("h1pOverER02","TRACK matches p/E, all",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
1989 fh1pOverER02->SetYTitle("p/E");
1990 fh1pOverER02->SetXTitle("p_{T} (GeV/c)");
1991 outputContainer->Add(fh1pOverER02);
1994 if(fFillAllPi0Histo){
1995 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy, ncell > 1",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1996 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
1997 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
1998 outputContainer->Add(fhIM);
2000 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
2001 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
2002 fhAsym->SetYTitle("Asymmetry");
2003 outputContainer->Add(fhAsym);
2007 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
2008 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2009 fhNCellsPerClusterNoCut->SetXTitle("E (GeV)");
2010 fhNCellsPerClusterNoCut->SetYTitle("n cells");
2011 outputContainer->Add(fhNCellsPerClusterNoCut);
2013 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2014 fhNCellsPerCluster->SetXTitle("E (GeV)");
2015 fhNCellsPerCluster->SetYTitle("n cells");
2016 outputContainer->Add(fhNCellsPerCluster);
2018 fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
2019 fhNClusters->SetXTitle("number of clusters");
2020 outputContainer->Add(fhNClusters);
2022 if(fFillAllPosHisto2){
2025 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2026 fhXYZ->SetXTitle("x (cm)");
2027 fhXYZ->SetYTitle("y (cm)");
2028 fhXYZ->SetZTitle("z (cm) ");
2029 outputContainer->Add(fhXYZ);
2032 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
2033 fhXNCells->SetXTitle("x (cm)");
2034 fhXNCells->SetYTitle("N cells per cluster");
2035 outputContainer->Add(fhXNCells);
2037 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
2038 fhZNCells->SetXTitle("z (cm)");
2039 fhZNCells->SetYTitle("N cells per cluster");
2040 outputContainer->Add(fhZNCells);
2042 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2043 fhXE->SetXTitle("x (cm)");
2044 fhXE->SetYTitle("E (GeV)");
2045 outputContainer->Add(fhXE);
2047 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2048 fhZE->SetXTitle("z (cm)");
2049 fhZE->SetYTitle("E (GeV)");
2050 outputContainer->Add(fhZE);
2052 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
2053 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2054 fhRNCells->SetYTitle("N cells per cluster");
2055 outputContainer->Add(fhRNCells);
2058 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
2059 fhYNCells->SetXTitle("y (cm)");
2060 fhYNCells->SetYTitle("N cells per cluster");
2061 outputContainer->Add(fhYNCells);
2063 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2064 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2065 fhRE->SetYTitle("E (GeV)");
2066 outputContainer->Add(fhRE);
2068 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2069 fhYE->SetXTitle("y (cm)");
2070 fhYE->SetYTitle("E (GeV)");
2071 outputContainer->Add(fhYE);
2073 if(fFillAllPosHisto){
2075 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2076 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2077 fhRCellE->SetYTitle("E (GeV)");
2078 outputContainer->Add(fhRCellE);
2080 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2081 fhXCellE->SetXTitle("x (cm)");
2082 fhXCellE->SetYTitle("E (GeV)");
2083 outputContainer->Add(fhXCellE);
2085 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2086 fhYCellE->SetXTitle("y (cm)");
2087 fhYCellE->SetYTitle("E (GeV)");
2088 outputContainer->Add(fhYCellE);
2090 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2091 fhZCellE->SetXTitle("z (cm)");
2092 fhZCellE->SetYTitle("E (GeV)");
2093 outputContainer->Add(fhZCellE);
2095 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2096 fhXYZCell->SetXTitle("x (cm)");
2097 fhXYZCell->SetYTitle("y (cm)");
2098 fhXYZCell->SetZTitle("z (cm)");
2099 outputContainer->Add(fhXYZCell);
2102 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
2103 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
2104 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
2105 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
2107 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
2108 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2109 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
2110 outputContainer->Add(fhDeltaCellClusterRNCells);
2112 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
2113 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
2114 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
2115 outputContainer->Add(fhDeltaCellClusterXNCells);
2117 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
2118 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
2119 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
2120 outputContainer->Add(fhDeltaCellClusterYNCells);
2122 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
2123 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
2124 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
2125 outputContainer->Add(fhDeltaCellClusterZNCells);
2127 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
2128 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2129 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
2130 outputContainer->Add(fhDeltaCellClusterRE);
2132 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
2133 fhDeltaCellClusterXE->SetXTitle("x (cm)");
2134 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
2135 outputContainer->Add(fhDeltaCellClusterXE);
2137 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
2138 fhDeltaCellClusterYE->SetXTitle("y (cm)");
2139 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
2140 outputContainer->Add(fhDeltaCellClusterYE);
2142 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
2143 fhDeltaCellClusterZE->SetXTitle("z (cm)");
2144 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
2145 outputContainer->Add(fhDeltaCellClusterZE);
2147 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2148 fhEtaPhiAmp->SetXTitle("#eta ");
2149 fhEtaPhiAmp->SetYTitle("#phi (rad)");
2150 fhEtaPhiAmp->SetZTitle("E (GeV) ");
2151 outputContainer->Add(fhEtaPhiAmp);
2156 fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin,ncemax);
2157 fhNCells->SetXTitle("n cells");
2158 outputContainer->Add(fhNCells);
2160 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
2161 fhAmplitude->SetXTitle("Cell Energy (GeV)");
2162 outputContainer->Add(fhAmplitude);
2164 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2165 fhAmpId->SetXTitle("Cell Energy (GeV)");
2166 outputContainer->Add(fhAmpId);
2168 //Cell Time histograms, time only available in ESDs
2169 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2171 fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
2172 fhCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
2173 fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max-i} (ns)");
2174 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
2176 fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2177 fhClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
2178 fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
2179 outputContainer->Add(fhClusterMaxCellDiffAverageTime);
2181 fhClusterMaxCellDiffWeightedTime = new TH2F ("hClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2182 fhClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
2183 fhClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
2184 outputContainer->Add(fhClusterMaxCellDiffWeightedTime);
2186 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
2187 fNMaxCols*fNMaxRows*fNModules,0,fNMaxCols*fNMaxRows*fNModules);
2188 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
2189 outputContainer->Add(fhCellIdCellLargeTimeSpread);
2191 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
2192 fhTime->SetXTitle("Cell Time (ns)");
2193 outputContainer->Add(fhTime);
2195 fhTimeVz = new TH2F ("hTimeVz","Cell Time vs vertex, amplitude > 0.5 GeV",100, 0, 50,ntimebins,timemin,timemax);
2196 fhTimeVz->SetXTitle("|v_{z}| (cm)");
2197 fhTimeVz->SetYTitle("Cell Time (ns)");
2198 outputContainer->Add(fhTimeVz);
2200 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",
2201 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2202 fhTimeId->SetXTitle("Cell Time (ns)");
2203 fhTimeId->SetYTitle("Cell Absolute Id");
2204 outputContainer->Add(fhTimeId);
2206 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
2207 fhTimeAmp->SetYTitle("Cell Time (ns)");
2208 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
2209 outputContainer->Add(fhTimeAmp);
2213 fhCellECross = new TH2F ("hCellECross","1 - Energy in cross around cell / cell energy",
2214 nptbins,ptmin,ptmax, 400,-1,1.);
2215 fhCellECross->SetXTitle("E_{cell} (GeV) ");
2216 fhCellECross->SetYTitle("1- E_{cross}/E_{cell}");
2217 outputContainer->Add(fhCellECross);
2222 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2223 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
2224 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
2225 outputContainer->Add(fhCaloCorrNClusters);
2227 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2228 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
2229 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
2230 outputContainer->Add(fhCaloCorrEClusters);
2232 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2233 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
2234 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
2235 outputContainer->Add(fhCaloCorrNCells);
2237 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
2238 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
2239 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
2240 outputContainer->Add(fhCaloCorrECells);
2242 //Calorimeter VS V0 signal
2243 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
2244 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
2245 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2246 outputContainer->Add(fhCaloV0SCorrNClusters);
2248 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2249 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
2250 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2251 outputContainer->Add(fhCaloV0SCorrEClusters);
2253 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
2254 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
2255 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2256 outputContainer->Add(fhCaloV0SCorrNCells);
2258 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2259 fhCaloV0SCorrECells->SetXTitle("V0 signal");
2260 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2261 outputContainer->Add(fhCaloV0SCorrECells);
2263 //Calorimeter VS V0 multiplicity
2264 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
2265 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
2266 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2267 outputContainer->Add(fhCaloV0MCorrNClusters);
2269 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2270 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
2271 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2272 outputContainer->Add(fhCaloV0MCorrEClusters);
2274 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
2275 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
2276 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2277 outputContainer->Add(fhCaloV0MCorrNCells);
2279 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2280 fhCaloV0MCorrECells->SetXTitle("V0 signal");
2281 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2282 outputContainer->Add(fhCaloV0MCorrECells);
2284 //Calorimeter VS Track multiplicity
2285 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
2286 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
2287 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2288 outputContainer->Add(fhCaloTrackMCorrNClusters);
2290 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2291 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
2292 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2293 outputContainer->Add(fhCaloTrackMCorrEClusters);
2295 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
2296 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
2297 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2298 outputContainer->Add(fhCaloTrackMCorrNCells);
2300 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2301 fhCaloTrackMCorrECells->SetXTitle("# tracks");
2302 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2303 outputContainer->Add(fhCaloTrackMCorrECells);
2306 }//correlate calorimeters
2310 fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2311 fhEMod->SetXTitle("E (GeV)");
2312 fhEMod->SetYTitle("Module");
2313 outputContainer->Add(fhEMod);
2315 fhAmpMod = new TH2F ("hAmp_Mod","Cell energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2316 fhAmpMod->SetXTitle("E (GeV)");
2317 fhAmpMod->SetYTitle("Module");
2318 outputContainer->Add(fhAmpMod);
2320 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2321 fhTimeMod = new TH2F ("hTime_Mod","Cell time in each present Module",ntimebins,timemin,timemax,fNModules,0,fNModules);
2322 fhTimeMod->SetXTitle("t (ns)");
2323 fhTimeMod->SetYTitle("Module");
2324 outputContainer->Add(fhTimeMod);
2327 fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin,nclmax,fNModules,0,fNModules);
2328 fhNClustersMod->SetXTitle("number of clusters");
2329 fhNClustersMod->SetYTitle("Module");
2330 outputContainer->Add(fhNClustersMod);
2332 fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", ncebins,ncemin,ncemax,fNModules,0,fNModules);
2333 fhNCellsMod->SetXTitle("n cells");
2334 fhNCellsMod->SetYTitle("Module");
2335 outputContainer->Add(fhNCellsMod);
2337 Int_t colmaxs = fNMaxCols;
2338 Int_t rowmaxs = fNMaxRows;
2339 if(fCalorimeter=="EMCAL"){
2340 colmaxs=2*fNMaxCols;
2341 rowmaxs=Int_t(fNModules/2)*fNMaxRows;
2344 rowmaxs=fNModules*fNMaxRows;
2347 fhGridCells = new TH2F ("hGridCells",Form("Entries in grid of cells"),
2348 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2349 fhGridCells->SetYTitle("row (phi direction)");
2350 fhGridCells->SetXTitle("column (eta direction)");
2351 outputContainer->Add(fhGridCells);
2353 fhGridCellsE = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
2354 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2355 fhGridCellsE->SetYTitle("row (phi direction)");
2356 fhGridCellsE->SetXTitle("column (eta direction)");
2357 outputContainer->Add(fhGridCellsE);
2359 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD){
2360 fhGridCellsTime = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
2361 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2362 fhGridCellsTime->SetYTitle("row (phi direction)");
2363 fhGridCellsTime->SetXTitle("column (eta direction)");
2364 outputContainer->Add(fhGridCellsTime);
2367 fhNCellsPerClusterMod = new TH2F*[fNModules];
2368 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
2369 fhIMMod = new TH2F*[fNModules];
2370 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2372 for(Int_t imod = 0; imod < fNModules; imod++){
2374 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
2375 Form("# cells per cluster vs cluster energy in Module %d",imod),
2376 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2377 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
2378 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
2379 outputContainer->Add(fhNCellsPerClusterMod[imod]);
2381 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
2382 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
2383 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2384 fhNCellsPerClusterModNoCut[imod]->SetXTitle("E (GeV)");
2385 fhNCellsPerClusterModNoCut[imod]->SetYTitle("n cells");
2386 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
2388 if(GetReader()->GetDataType()==AliCaloTrackReader::kESD) {
2390 for(Int_t ircu = 0; ircu < fNRCU; ircu++){
2391 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
2392 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
2393 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2394 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
2395 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
2396 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
2401 if(fFillAllPi0Histo){
2402 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
2403 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
2404 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2405 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
2406 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
2407 outputContainer->Add(fhIMMod[imod]);
2412 // Monte Carlo Histograms
2414 TString particleName[] = { "Photon", "Pi0", "Eta", "Electron", "NeutralHadron", "ChargedHadron" };
2417 for(Int_t iPart = 0; iPart < 6; iPart++){
2419 for(Int_t iCh = 0; iCh < 2; iCh++){
2421 fhRecoMCRatioE[iPart][iCh] = new TH2F (Form("hRecoMCRatioE_%s_Match%d",particleName[iPart].Data(),iCh),
2422 Form("Reco/Gen E, %s, Matched %d",particleName[iPart].Data(),iCh),
2423 nptbins, ptmin, ptmax, 200,0,2);
2424 fhRecoMCRatioE[iPart][iCh]->SetXTitle("E_{reconstructed}/E_{generated}");
2425 outputContainer->Add(fhRecoMCRatioE[iPart][iCh]);
2428 fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
2429 Form("MC - Reco E, %s, Matched %d",particleName[iPart].Data(),iCh),
2430 nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
2431 fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#Delta E (GeV)");
2432 outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
2434 fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2435 Form("MC - Reco #phi, %s, Matched %d",particleName[iPart].Data(),iCh),
2436 nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
2437 fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#Delta #phi (rad)");
2438 outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
2440 fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
2441 Form("MC- Reco #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
2442 nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
2443 fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#Delta #eta ");
2444 outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
2446 fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
2447 Form("E distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2448 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2449 fhRecoMCE[iPart][iCh]->SetXTitle("E_{rec} (GeV)");
2450 fhRecoMCE[iPart][iCh]->SetYTitle("E_{gen} (GeV)");
2451 outputContainer->Add(fhRecoMCE[iPart][iCh]);
2453 fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2454 Form("#phi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2455 nphibins,phimin,phimax, nphibins,phimin,phimax);
2456 fhRecoMCPhi[iPart][iCh]->SetXTitle("#phi_{rec} (rad)");
2457 fhRecoMCPhi[iPart][iCh]->SetYTitle("#phi_{gen} (rad)");
2458 outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
2460 fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
2461 Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2462 netabins,etamin,etamax,netabins,etamin,etamax);
2463 fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{rec} ");
2464 fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{gen} ");
2465 outputContainer->Add(fhRecoMCEta[iPart][iCh]);
2470 for(Int_t iPart = 0; iPart < 4; iPart++){
2471 fhGenMCE[iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
2472 Form("p_{T} of generated %s",particleName[iPart].Data()),
2473 nptbins,ptmin,ptmax);
2474 fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
2475 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2476 netabins,etamin,etamax,nphibins,phimin,phimax);
2478 fhGenMCE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2479 fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
2480 fhGenMCEtaPhi[iPart]->SetYTitle("#phi (rad)");
2482 outputContainer->Add(fhGenMCE[iPart]);
2483 outputContainer->Add(fhGenMCEtaPhi[iPart]);
2486 fhGenMCAccE[iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
2487 Form("p_{T} of generated %s",particleName[iPart].Data()),
2488 nptbins,ptmin,ptmax);
2489 fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
2490 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2491 netabins,etamin,etamax,nphibins,phimin,phimax);
2493 fhGenMCAccE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2494 fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
2495 fhGenMCAccEtaPhi[iPart]->SetYTitle("#phi (rad)");
2497 outputContainer->Add(fhGenMCAccE[iPart]);
2498 outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
2502 //Vertex of generated particles
2504 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2505 fhEMVxyz->SetXTitle("v_{x}");
2506 fhEMVxyz->SetYTitle("v_{y}");
2507 //fhEMVxyz->SetZTitle("v_{z}");
2508 outputContainer->Add(fhEMVxyz);
2510 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2511 fhHaVxyz->SetXTitle("v_{x}");
2512 fhHaVxyz->SetYTitle("v_{y}");
2513 //fhHaVxyz->SetZTitle("v_{z}");
2514 outputContainer->Add(fhHaVxyz);
2516 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2517 fhEMR->SetXTitle("E (GeV)");
2518 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2519 outputContainer->Add(fhEMR);
2521 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2522 fhHaR->SetXTitle("E (GeV)");
2523 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2524 outputContainer->Add(fhHaR);
2529 fhMCEle1pOverE = new TH2F("hMCEle1pOverE","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2530 fhMCEle1pOverE->SetYTitle("p/E");
2531 fhMCEle1pOverE->SetXTitle("p_{T} (GeV/c)");
2532 outputContainer->Add(fhMCEle1pOverE);
2534 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
2535 fhMCEle1dR->SetXTitle("#Delta R (rad)");
2536 outputContainer->Add(fhMCEle1dR) ;
2538 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2539 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
2540 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
2541 outputContainer->Add(fhMCEle2MatchdEdx);
2543 fhMCChHad1pOverE = new TH2F("hMCChHad1pOverE","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2544 fhMCChHad1pOverE->SetYTitle("p/E");
2545 fhMCChHad1pOverE->SetXTitle("p_{T} (GeV/c)");
2546 outputContainer->Add(fhMCChHad1pOverE);
2548 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
2549 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
2550 outputContainer->Add(fhMCChHad1dR) ;
2552 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2553 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
2554 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
2555 outputContainer->Add(fhMCChHad2MatchdEdx);
2557 fhMCNeutral1pOverE = new TH2F("hMCNeutral1pOverE","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2558 fhMCNeutral1pOverE->SetYTitle("p/E");
2559 fhMCNeutral1pOverE->SetXTitle("p_{T} (GeV/c)");
2560 outputContainer->Add(fhMCNeutral1pOverE);
2562 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
2563 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
2564 outputContainer->Add(fhMCNeutral1dR) ;
2566 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2567 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
2568 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
2569 outputContainer->Add(fhMCNeutral2MatchdEdx);
2571 fhMCEle1pOverER02 = new TH2F("hMCEle1pOverER02","TRACK matches p/E, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2572 fhMCEle1pOverER02->SetYTitle("p/E");
2573 fhMCEle1pOverER02->SetXTitle("p_{T} (GeV/c)");
2574 outputContainer->Add(fhMCEle1pOverER02);
2576 fhMCChHad1pOverER02 = new TH2F("hMCChHad1pOverER02","TRACK matches p/E, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2577 fhMCChHad1pOverER02->SetYTitle("p/E");
2578 fhMCChHad1pOverER02->SetXTitle("p_{T} (GeV/c)");
2579 outputContainer->Add(fhMCChHad1pOverER02);
2581 fhMCNeutral1pOverER02 = new TH2F("hMCNeutral1pOverER02","TRACK matches p/E, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,pOverEmin,pOverEmax);
2582 fhMCNeutral1pOverER02->SetYTitle("p/E");
2583 fhMCNeutral1pOverER02->SetXTitle("p_{T} (GeV/c)");
2584 outputContainer->Add(fhMCNeutral1pOverER02);
2587 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
2588 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
2590 return outputContainer;
2593 //_____________________________________________________________________________________________
2594 Float_t AliAnaCalorimeterQA::GetECross(const Int_t absID, AliVCaloCells* cells)
2596 // Get energy in cross axis around maximum cell, for EMCAL only
2598 Int_t icol =-1, irow=-1,iRCU = -1;
2599 Int_t imod = GetModuleNumberCellIndexes(absID, fCalorimeter, icol, irow, iRCU);
2601 if(fCalorimeter=="EMCAL")
2603 //Get close cells index, energy and time, not in corners
2604 Int_t absID1 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow+1, icol);
2605 Int_t absID2 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow-1, icol);
2608 // In case of cell in eta = 0 border, depending on SM shift the cross cell index
2612 if ( icol == AliEMCALGeoParams::fgkEMCALCols - 1 && !(imod%2) )
2614 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, 0);
2615 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol-1);
2617 else if( icol == 0 && imod%2 )
2619 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol+1);
2620 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, AliEMCALGeoParams::fgkEMCALCols-1);
2624 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol+1);
2625 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol-1);
2628 //Recalibrate cell energy if needed
2629 //Float_t ecell = cells->GetCellAmplitude(absID);
2630 //GetCaloUtils()->RecalibrateCellAmplitude(ecell,fCalorimeter, absID);
2631 Double_t tcell = cells->GetCellTime(absID);
2632 GetCaloUtils()->RecalibrateCellTime(tcell, fCalorimeter, absID,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2634 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2635 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
2639 ecell1 = cells->GetCellAmplitude(absID1);
2640 GetCaloUtils()->RecalibrateCellAmplitude(ecell1, fCalorimeter, absID1);
2641 tcell1 = cells->GetCellTime(absID1);
2642 GetCaloUtils()->RecalibrateCellTime (tcell1, fCalorimeter, absID1,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2646 ecell2 = cells->GetCellAmplitude(absID2);
2647 GetCaloUtils()->RecalibrateCellAmplitude(ecell2, fCalorimeter, absID2);
2648 tcell2 = cells->GetCellTime(absID2);
2649 GetCaloUtils()->RecalibrateCellTime (tcell2, fCalorimeter, absID2, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2653 ecell3 = cells->GetCellAmplitude(absID3);
2654 GetCaloUtils()->RecalibrateCellAmplitude(ecell3, fCalorimeter, absID3);
2655 tcell3 = cells->GetCellTime(absID3);
2656 GetCaloUtils()->RecalibrateCellTime (tcell3, fCalorimeter, absID3, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2660 ecell4 = cells->GetCellAmplitude(absID4);
2661 GetCaloUtils()->RecalibrateCellAmplitude(ecell4, fCalorimeter, absID4);
2662 tcell4 = cells->GetCellTime(absID4);
2663 GetCaloUtils()->RecalibrateCellTime (tcell4, fCalorimeter, absID4, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2666 if(TMath::Abs(tcell-tcell1)*1.e9 > 50) ecell1 = 0 ;
2667 if(TMath::Abs(tcell-tcell2)*1.e9 > 50) ecell2 = 0 ;
2668 if(TMath::Abs(tcell-tcell3)*1.e9 > 50) ecell3 = 0 ;
2669 if(TMath::Abs(tcell-tcell4)*1.e9 > 50) ecell4 = 0 ;
2671 return ecell1+ecell2+ecell3+ecell4;
2676 Int_t absId1 = -1, absId2 = -1, absId3 = -1, absId4 = -1;
2678 Int_t relId1[] = { imod+1, 0, irow+1, icol };
2679 Int_t relId2[] = { imod+1, 0, irow-1, icol };
2680 Int_t relId3[] = { imod+1, 0, irow , icol+1 };
2681 Int_t relId4[] = { imod+1, 0, irow , icol-1 };
2683 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId1, absId1);
2684 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId2, absId2);
2685 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId3, absId3);
2686 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId4, absId4);
2688 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2690 if(absId1 > 0 ) ecell1 = cells->GetCellAmplitude(absId1);
2691 if(absId2 > 0 ) ecell2 = cells->GetCellAmplitude(absId2);
2692 if(absId3 > 0 ) ecell3 = cells->GetCellAmplitude(absId3);
2693 if(absId4 > 0 ) ecell4 = cells->GetCellAmplitude(absId4);
2695 return ecell1+ecell2+ecell3+ecell4;
2701 //__________________________________________________________________________________________________
2702 void AliAnaCalorimeterQA::InvariantMassHistograms(const Int_t iclus, const TLorentzVector mom,
2703 const Int_t nModule, const TObjArray* caloClusters,
2704 AliVCaloCells * cells)
2706 // Fill Invariant mass histograms
2708 if(GetDebug()>1) printf("AliAnaCalorimeterQA::InvariantMassHistograms() - Start \n");
2710 //Get vertex for photon momentum calculation and event selection
2711 Double_t v[3] = {0,0,0}; //vertex ;
2712 //GetReader()->GetVertex(v);
2714 Int_t nModule2 = -1;
2715 TLorentzVector mom2 ;
2716 Int_t nCaloClusters = caloClusters->GetEntriesFast();
2718 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++)
2720 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
2722 Float_t maxCellFraction = 0.;
2723 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction);
2725 // Try to rediuce background with a mild shower shape cut and no more than 1 maxima
2726 // in cluster and remove low energy clusters
2727 if( clus2->GetNCells() <= 1 || !IsGoodCluster(absIdMax,cells) ||
2728 GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1 ||
2729 clus2->GetM02() > 0.5 || clus2->E() < 0.3) continue;
2731 //Get cluster kinematics
2732 clus2->GetMomentum(mom2,v);
2734 //Check only certain regions
2736 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
2739 //Get module of cluster
2740 nModule2 = GetModuleNumber(clus2);
2745 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
2748 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
2749 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
2752 //Asymetry histograms
2753 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
2755 }// 2nd cluster loop
2759 //______________________________
2760 void AliAnaCalorimeterQA::Init()
2762 //Check if the data or settings are ok
2764 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
2765 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
2767 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
2768 AliFatal("Analysis of reconstructed data, MC reader not aplicable");
2772 //________________________________________
2773 void AliAnaCalorimeterQA::InitParameters()
2775 //Initialize the parameters of the analysis.
2776 AddToHistogramsName("AnaCaloQA_");
2778 fCalorimeter = "EMCAL"; //or PHOS
2779 fNModules = 12; // set maximum to maximum number of EMCAL modules
2780 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
2782 fTimeCutMax = 9999999;
2783 fEMCALCellAmpMin = 0.2;
2784 fPHOSCellAmpMin = 0.2;
2788 //___________________________________________________________________________________
2789 Bool_t AliAnaCalorimeterQA::IsGoodCluster(const Int_t absIdMax, AliVCaloCells* cells)
2791 //Identify cluster as exotic or not
2793 if(!fStudyBadClusters) return kTRUE;
2795 if(fCalorimeter=="EMCAL")
2797 if(!GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster())
2799 return !( GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(absIdMax,cells,(GetReader()->GetInputEvent())->GetBunchCrossNumber()) );
2808 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
2809 GetCaloUtils()->RecalibrateCellAmplitude(ampMax, fCalorimeter, absIdMax);
2811 if(ampMax < 0.01) return kFALSE;
2813 if(1-GetECross(absIdMax,cells)/ampMax > 0.95) return kFALSE;
2819 //_________________________________________________________
2820 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
2822 //Print some relevant parameters set for the analysis
2826 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2827 AliAnaCaloTrackCorrBaseClass::Print(" ");
2829 printf("Select Calorimeter %s \n",fCalorimeter.Data());
2830 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2831 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
2832 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
2836 //_____________________________________________________
2837 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
2839 //Fill Calorimeter QA histograms
2841 //Play with the MC stack if available
2842 if(IsDataMC()) MCHistograms();
2844 //Get List with CaloClusters
2845 TObjArray * caloClusters = NULL;
2846 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
2847 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
2849 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
2851 // Do not do anything if there are no clusters
2852 if(caloClusters->GetEntriesFast() == 0) return;
2854 //Get List with CaloCells
2855 AliVCaloCells * cells = 0x0;
2856 if(fCalorimeter == "PHOS") cells = GetPHOSCells();
2857 else cells = GetEMCALCells();
2859 if(!caloClusters || !cells) {
2860 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters or CaloCells available\n"));
2861 return; // trick coverity
2864 //printf("QA: N cells %d, N clusters %d \n",cells->GetNumberOfCells(),caloClusters->GetEntriesFast());
2866 // Correlate Calorimeters and V0 and track Multiplicity
2867 if(fCorrelate) Correlate();
2870 ClusterLoopHistograms(caloClusters,cells);
2873 CellHistograms(cells);
2876 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
2880 //______________________________________
2881 void AliAnaCalorimeterQA::MCHistograms()
2883 //Get the MC arrays and do some checks before filling MC histograms
2885 TLorentzVector mom ;
2887 if(GetReader()->ReadStack()){
2890 AliFatal("Stack not available, is the MC handler called?\n");
2892 //Fill some pure MC histograms, only primaries.
2893 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++)
2894 {//Only primary particles, for all MC transport put GetNtrack()
2895 TParticle *primary = GetMCStack()->Particle(i) ;
2897 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
2898 primary->Momentum(mom);
2899 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
2902 else if(GetReader()->ReadAODMCParticles()){
2904 if(!GetReader()->GetAODMCParticles(0))
2905 AliFatal("AODMCParticles not available!");
2907 //Fill some pure MC histograms, only primaries.
2908 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++)
2910 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
2912 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
2914 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
2915 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
2921 //_______________________________________________________________________________
2922 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg)
2924 //Fill pure monte carlo related histograms
2926 Float_t eMC = mom.E();
2927 Float_t phiMC = mom.Phi();
2929 phiMC += TMath::TwoPi();
2930 Float_t etaMC = mom.Eta();
2932 if (TMath::Abs(etaMC) > 1) return;
2936 //Rough stimate of acceptance for pi0, Eta and electrons
2937 if(fCalorimeter == "PHOS")
2939 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
2941 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
2944 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
2946 if(GetEMCALGeometry())
2949 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(mom.Eta(),mom.Phi(),absID);
2954 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s Real acceptance? %d\n",fCalorimeter.Data(),in);
2958 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
2960 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
2966 fhGenMCE[kmcPhoton] ->Fill(eMC);
2967 if(eMC > 0.5) fhGenMCEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
2970 fhGenMCAccE[kmcPhoton] ->Fill(eMC);
2971 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
2976 fhGenMCE[kmcPi0] ->Fill(eMC);
2977 if(eMC > 0.5) fhGenMCEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
2980 fhGenMCAccE[kmcPi0] ->Fill(eMC);
2981 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
2986 fhGenMCE[kmcEta] ->Fill(eMC);
2987 if(eMC > 0.5) fhGenMCEtaPhi[kmcEta]->Fill(etaMC,phiMC);
2990 fhGenMCAccE[kmcEta] ->Fill(eMC);
2991 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcEta]->Fill(etaMC,phiMC);
2994 else if (TMath::Abs(pdg)==11)
2996 fhGenMCE[kmcElectron] ->Fill(eMC);
2997 if(eMC > 0.5) fhGenMCEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3000 fhGenMCAccE[kmcElectron] ->Fill(eMC);
3001 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3006 //_________________________________________________________________________________
3007 void AliAnaCalorimeterQA::WeightHistograms(AliVCluster *clus, AliVCaloCells* cells)
3009 // Calculate weights
3011 // First recalculate energy in case non linearity was applied
3014 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3016 Int_t id = clus->GetCellsAbsId()[ipos];
3018 //Recalibrate cell energy if needed
3019 Float_t amp = cells->GetCellAmplitude(id);
3020 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3031 printf("AliAnaCalorimeterQA::WeightHistograms()- Wrong calculated energy %f\n",energy);
3035 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
3036 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
3038 //Get the ratio and log ratio to all cells in cluster
3039 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3041 Int_t id = clus->GetCellsAbsId()[ipos];
3043 //Recalibrate cell energy if needed
3044 Float_t amp = cells->GetCellAmplitude(id);
3045 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3047 fhECellClusterRatio ->Fill(energy,amp/energy);
3048 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
3051 //Recalculate shower shape for different W0
3052 if(fCalorimeter=="EMCAL")
3054 Float_t l0org = clus->GetM02();
3055 Float_t l1org = clus->GetM20();
3056 Float_t dorg = clus->GetDispersion();
3058 for(Int_t iw = 0; iw < 14; iw++){
3059 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
3060 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
3062 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
3063 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
3067 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(clus->GetLabels(),clus->GetNLabels(), GetReader(),0);
3069 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
3070 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
3071 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3072 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3073 fhLambda0ForW0MC[iw][0]->Fill(energy,clus->GetM02());
3074 //fhLambda1ForW0MC[iw][0]->Fill(energy,clus->GetM20());
3076 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
3077 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3078 fhLambda0ForW0MC[iw][1]->Fill(energy,clus->GetM02());
3079 //fhLambda1ForW0MC[iw][1]->Fill(energy,clus->GetM20());
3081 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3082 fhLambda0ForW0MC[iw][2]->Fill(energy,clus->GetM02());
3083 //fhLambda1ForW0MC[iw][2]->Fill(energy,clus->GetM20());
3085 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ){
3086 fhLambda0ForW0MC[iw][3]->Fill(energy,clus->GetM02());
3087 //fhLambda1ForW0MC[iw][3]->Fill(energy,clus->GetM20());
3089 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3090 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) ){
3091 fhLambda0ForW0MC[iw][4]->Fill(energy,clus->GetM02());
3092 //fhLambda1ForW0MC[iw][4]->Fill(energy,clus->GetM20());
3098 // Set the original values back
3099 clus->SetM02(l0org);
3100 clus->SetM20(l1org);
3101 clus->SetDispersion(dorg);