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 <TObjArray.h>
26 #include <TParticle.h>
27 #include <TDatabasePDG.h>
29 #include <TObjString.h>
31 //---- AliRoot system ----
32 #include "AliAnaCalorimeterQA.h"
33 #include "AliCaloTrackReader.h"
35 #include "AliVCaloCells.h"
36 #include "AliFiducialCut.h"
37 #include "AliVCluster.h"
38 #include "AliVTrack.h"
39 #include "AliVEvent.h"
40 #include "AliVEventHandler.h"
41 #include "AliAODMCParticle.h"
42 #include "AliMCAnalysisUtils.h"
45 #include "AliPHOSGeoUtils.h"
46 #include "AliEMCALGeometry.h"
48 ClassImp(AliAnaCalorimeterQA)
50 //________________________________________
51 AliAnaCalorimeterQA::AliAnaCalorimeterQA() :
52 AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
55 fFillAllCellTimeHisto(kTRUE),
56 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(kTRUE),
57 fFillAllTH12(kFALSE), fFillAllTH3(kTRUE),
58 fFillAllTMHisto(kTRUE), fFillAllPi0Histo(kTRUE),
59 fCorrelate(kTRUE), fStudyBadClusters(kFALSE),
60 fStudyClustersAsymmetry(kFALSE), fStudyExotic(kFALSE),
64 fNModules(12), fNRCU(2),
65 fNMaxCols(48), fNMaxRows(24),
66 fTimeCutMin(-10000), fTimeCutMax(10000),
67 fEMCALCellAmpMin(0), fPHOSCellAmpMin(0),
70 fExoNECrossCuts(0), fExoECrossCuts(),
71 fExoNDTimeCuts(0), fExoDTimeCuts(),
75 fhPhi(0), fhEta(0), fhEtaPhiE(0),
76 fhECharged(0), fhPtCharged(0),
77 fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
82 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0), fhNClusters(0),
85 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
86 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
87 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
88 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
89 fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightedTime(0),
90 fhClusterMaxCellECross(0),
91 fhLambda0(0), fhLambda1(0), fhDispersion(0),
94 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0),
95 fhBadClusterPairDiffTimeE(0), fhBadCellTimeSpreadRespectToCellMax(0),
96 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
97 fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightedTime(0),
98 fhBadClusterMaxCellECross(0),
99 fhBadClusterDeltaIEtaDeltaIPhiE0(0), fhBadClusterDeltaIEtaDeltaIPhiE2(0),
100 fhBadClusterDeltaIEtaDeltaIPhiE6(0), fhBadClusterDeltaIA(0),
103 fhRNCells(0), fhXNCells(0),
104 fhYNCells(0), fhZNCells(0),
108 fhRCellE(0), fhXCellE(0),
109 fhYCellE(0), fhZCellE(0),
111 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
112 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
113 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
114 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
117 fhNCells(0), fhAmplitude(0),
118 fhAmpId(0), fhEtaPhiAmp(0),
119 fhTime(0), fhTimeVz(0),
120 fhTimeId(0), fhTimeAmp(0),
122 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0),
123 fhCaloCorrNCells(0), fhCaloCorrECells(0),
124 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
125 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
126 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
127 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
128 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
129 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
131 //Super-Module dependent histgrams
132 fhEMod(0), fhAmpMod(0), fhTimeMod(0),
133 fhNClustersMod(0), fhNCellsMod(0),
134 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
136 fhGridCells(0), fhGridCellsE(0), fhGridCellsTime(0),
137 fhTimeAmpPerRCU(0), fhIMMod(0),
140 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
141 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
144 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
145 fhRecoMCDeltaE(), fhRecoMCRatioE(),
146 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
149 fhGenMCE(), fhGenMCEtaPhi(),
150 fhGenMCAccE(), fhGenMCAccEtaPhi(),
153 fhEMVxyz(0), fhEMR(0),
154 fhHaVxyz(0), fhHaR(0),
155 fh1EOverP(0), fh2dR(0),
156 fh2EledEdx(0), fh2MatchdEdx(0),
157 fhMCEle1EOverP(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
158 fhMCChHad1EOverP(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
159 fhMCNeutral1EOverP(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0), fh1EOverPR02(0),
160 fhMCEle1EOverPR02(0), fhMCChHad1EOverPR02(0), fhMCNeutral1EOverPR02(0)
165 for(Int_t i =0; i < 14; i++){
166 fhLambda0ForW0[i] = 0;
167 //fhLambda1ForW0[i] = 0;
169 for(Int_t j = 0; j < 5; j++){
170 fhLambda0ForW0MC[i][j] = 0;
171 //fhLambda1ForW0MC[i][j] = 0;
177 fhDeltaIEtaDeltaIPhiE0[0] = 0 ; fhDeltaIEtaDeltaIPhiE2[0] = 0; fhDeltaIEtaDeltaIPhiE6[0] = 0;
178 fhDeltaIEtaDeltaIPhiE0[1] = 0 ; fhDeltaIEtaDeltaIPhiE2[1] = 0; fhDeltaIEtaDeltaIPhiE6[1] = 0;
179 fhDeltaIA[0] = 0 ; fhDeltaIAL0[0] = 0; fhDeltaIAL1[0] = 0;
180 fhDeltaIA[1] = 0 ; fhDeltaIAL0[1] = 0; fhDeltaIAL1[1] = 0;
181 fhDeltaIANCells[0] = 0 ; fhDeltaIANCells[1] = 0;
182 fhDeltaIAMC[0] = 0 ; fhDeltaIAMC[1] = 0;
183 fhDeltaIAMC[2] = 0 ; fhDeltaIAMC[3] = 0;
186 for (Int_t ie = 0; ie < 10 ; ie++)
189 for (Int_t idt = 0; idt < 5 ; idt++)
191 fhExoNCell [ie][idt] = 0;
192 fhExoL0 [ie][idt] = 0;
193 fhExoECross [ie][idt] = 0;
194 fhExoTime [ie][idt] = 0;
200 for(Int_t i = 0; i < 6; i++){
202 fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
203 fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
204 fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
205 fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
206 fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
207 fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
208 fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
212 //Initialize parameters
216 //____________________________________________________________________________________________________________________________
217 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
218 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
219 const Double_t tmax, Double_t timeAverages[2]
222 //Bad cluster histograms
224 // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
225 // GetReader()->GetEventNumber(), fCalorimeter.Data(),
226 // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
228 fhBadClusterEnergy ->Fill(clus->E());
229 Double_t tof = clus->GetTOF()*1.e9;
230 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
231 fhBadClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
232 fhBadClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
234 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kFALSE);
236 //Clusters in event time differencem bad minus good
238 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
240 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
242 if(clus->GetID()==clus2->GetID()) continue;
244 Float_t maxCellFraction2 = 0.;
245 Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
246 if(IsGoodCluster(absIdMax2,cells)){
247 Double_t tof2 = clus2->GetTOF()*1.e9;
248 fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2));
253 // Max cell compared to other cells in cluster
254 if(fFillAllCellTimeHisto)
256 fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
257 fhBadClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
260 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
262 Int_t absId = clus->GetCellsAbsId()[ipos];
263 if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
265 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
267 fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
268 fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
270 if(fFillAllCellTimeHisto)
272 Double_t time = cells->GetCellTime(absId);
273 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
275 Float_t diff = (tmax-time*1e9);
276 fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
284 //______________________________________________________________________
285 void AliAnaCalorimeterQA::CalculateAverageTime(AliVCluster *clus,
286 AliVCaloCells* cells,
287 Double_t timeAverages[2])
289 // Calculate time averages and weights
291 // First recalculate energy in case non linearity was applied
293 Float_t ampMax = 0, amp = 0;
295 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
297 Int_t id = clus->GetCellsAbsId()[ipos];
299 //Recalibrate cell energy if needed
300 amp = cells->GetCellAmplitude(id);
301 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
313 // Calculate average time of cells in cluster and weighted average
320 Int_t ncells = clus->GetNCells();
321 for (Int_t ipos = 0; ipos < ncells; ipos++)
323 id = clus ->GetCellsAbsId()[ipos];
324 amp = cells->GetCellAmplitude(id);
325 time = cells->GetCellTime(id);
327 //Recalibrate energy and time
328 GetCaloUtils()->RecalibrateCellAmplitude(amp , fCalorimeter, id);
329 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
331 w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
333 wTime += time*1e9 * w;
338 if(ncells > 0) aTime /= ncells;
341 if(wTot > 0) wTime /= wTot;
344 timeAverages[0] = aTime;
345 timeAverages[1] = wTime;
349 //____________________________________________________________
350 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
352 // Plot histograms related to cells only
354 Int_t ncells = cells->GetNumberOfCells();
357 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), ncells );
359 //Init arrays and used variables
360 Int_t *nCellsInModule = new Int_t[fNModules];
361 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
370 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
372 for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++) {
374 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell));
375 Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
377 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
379 if(nModule < fNModules)
381 //Check if the cell is a bad channel
382 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
383 if(fCalorimeter=="EMCAL")
385 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
389 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
391 } // use bad channel map
393 amp = cells->GetAmplitude(iCell)*recalF;
394 time = cells->GetTime(iCell);
395 id = cells->GetCellNumber(iCell);
397 // Amplitude recalibration if set
398 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
400 // Time recalibration if set
401 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
403 //Transform time to ns
406 if(time < fTimeCutMin || time > fTimeCutMax)
408 //if(GetDebug() > 0 )
409 printf("AliAnaCalorimeterQA - Remove cell with Time %f\n",time);
413 // Remove exotic cells, defined only for EMCAL
414 if(fCalorimeter=="EMCAL" &&
415 GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
418 fhAmplitude->Fill(amp);
419 fhAmpId ->Fill(amp,id);
420 fhAmpMod ->Fill(amp,nModule);
422 if ((fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ||
423 (fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin ) )
426 //E cross for exotic cells
427 if(amp > 0.01) fhCellECross->Fill(amp,1-GetECross(id,cells)/amp);
429 nCellsInModule[nModule]++ ;
434 if(fCalorimeter=="EMCAL")
436 icols = (nModule % 2) ? icol + fNMaxCols : icol;
438 irows = irow + fNMaxRows * Int_t(nModule / 2);
440 irows = irow + (fNMaxRows / 3) * Int_t(nModule / 2);
444 irows = irow + fNMaxRows * nModule;
447 fhGridCells ->Fill(icols,irows);
448 fhGridCellsE->Fill(icols,irows,amp);
450 if(fFillAllCellTimeHisto)
452 //printf("%s: time %g\n",fCalorimeter.Data(), time);
454 Double_t v[3] = {0,0,0}; //vertex ;
455 GetReader()->GetVertex(v);
456 if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]),time);
459 fhTimeId ->Fill(time,id);
460 fhTimeAmp ->Fill(amp,time);
461 fhGridCellsTime->Fill(icols,irows,time);
462 fhTimeMod ->Fill(time,nModule);
463 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
468 //Get Eta-Phi position of Cell
471 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
472 Float_t celleta = 0.;
473 Float_t cellphi = 0.;
474 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
476 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
477 Double_t cellpos[] = {0, 0, 0};
478 GetEMCALGeometry()->GetGlobal(id, cellpos);
479 fhXCellE->Fill(cellpos[0],amp) ;
480 fhYCellE->Fill(cellpos[1],amp) ;
481 fhZCellE->Fill(cellpos[2],amp) ;
482 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
483 fhRCellE->Fill(rcell,amp) ;
484 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
486 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
488 Int_t relId[4], module;
489 Float_t xCell, zCell;
491 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
493 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
494 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
495 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
496 fhXCellE ->Fill(xyz.X(),amp) ;
497 fhYCellE ->Fill(xyz.Y(),amp) ;
498 fhZCellE ->Fill(xyz.Z(),amp) ;
499 fhRCellE ->Fill(rcell ,amp) ;
500 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
502 }//fill cell position histograms
504 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
505 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
507 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
511 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
513 //Number of cells per module
514 for(Int_t imod = 0; imod < fNModules; imod++ ) {
517 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
519 fhNCellsMod->Fill(nCellsInModule[imod],imod) ;
523 delete [] nCellsInModule;
527 //__________________________________________________________________________
528 void AliAnaCalorimeterQA::CellInClusterPositionHistograms(AliVCluster* clus)
530 // Fill histograms releated to cell position
533 Int_t nCaloCellsPerCluster = clus->GetNCells();
534 UShort_t * indexList = clus->GetCellsAbsId();
536 clus->GetPosition(pos);
537 Float_t clEnergy = clus->E();
539 //Loop on cluster cells
540 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
542 // printf("Index %d\n",ipos);
543 Int_t absId = indexList[ipos];
545 //Get position of cell compare to cluster
547 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
549 Double_t cellpos[] = {0, 0, 0};
550 GetEMCALGeometry()->GetGlobal(absId, cellpos);
552 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
553 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
554 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
556 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],clEnergy) ;
557 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],clEnergy) ;
558 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],clEnergy) ;
560 Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
561 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
563 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
564 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
566 }//EMCAL and its matrices are available
567 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
569 Int_t relId[4], module;
570 Float_t xCell, zCell;
572 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
574 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
575 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
577 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
578 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
579 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
581 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),clEnergy) ;
582 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),clEnergy) ;
583 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),clEnergy) ;
585 Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
586 Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
588 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
589 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
591 }//PHOS and its matrices are available
592 }// cluster cell loop
595 //___________________________________________________________________________________________
596 void AliAnaCalorimeterQA::ClusterAsymmetryHistograms(AliVCluster* clus, const Int_t absIdMax,
597 const Bool_t goodCluster)
599 // Study the shape of the cluster in cell units terms
601 //No use to study clusters with less than 4 cells
602 if(clus->GetNCells() <=3 ) return;
607 Int_t ietaMax=-1; Int_t iphiMax = 0; Int_t rcuMax = 0;
608 Int_t smMax = GetModuleNumberCellIndexes(absIdMax,fCalorimeter, ietaMax, iphiMax, rcuMax);
610 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
612 Int_t absId = clus->GetCellsAbsId()[ipos];
614 Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
615 Int_t sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ieta, iphi, rcu);
617 if(dIphi < TMath::Abs(iphi-iphiMax)) dIphi = TMath::Abs(iphi-iphiMax);
620 if(dIeta < TMath::Abs(ieta-ietaMax)) dIeta = TMath::Abs(ieta-ietaMax);
623 Int_t ietaShift = ieta;
624 Int_t ietaMaxShift = ietaMax;
625 if (ieta > ietaMax) ietaMaxShift+=48;
627 if(dIeta < TMath::Abs(ietaShift-ietaMaxShift)) dIeta = TMath::Abs(ietaShift-ietaMaxShift);
630 }// fill cell-cluster histogram loop
633 Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
638 // Was cluster matched?
639 Bool_t matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(),GetReader()->GetInputEvent());
641 if (clus->E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta,dIphi);
642 else if(clus->E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta,dIphi);
643 else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta,dIphi);
645 fhDeltaIA[matched]->Fill(clus->E(),dIA);
649 fhDeltaIAL0[matched] ->Fill(clus->GetM02(),dIA);
650 fhDeltaIAL1[matched] ->Fill(clus->GetM20(),dIA);
651 fhDeltaIANCells[matched]->Fill(clus->GetNCells(),dIA);
655 // Origin of clusters
656 Int_t nLabel = clus->GetNLabels();
657 Int_t* labels = clus->GetLabels();
659 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),0);
660 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
661 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
662 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
663 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
664 fhDeltaIAMC[0]->Fill(clus->E(),dIA);//Pure Photon
666 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
667 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
668 fhDeltaIAMC[1]->Fill(clus->E(),dIA);//Pure electron
670 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
671 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
672 fhDeltaIAMC[2]->Fill(clus->E(),dIA);//Converted cluster
674 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
675 fhDeltaIAMC[3]->Fill(clus->E(),dIA);//Hadrons
682 if (clus->E() < 2 ) fhBadClusterDeltaIEtaDeltaIPhiE0->Fill(dIeta,dIphi);
683 else if(clus->E() < 6 ) fhBadClusterDeltaIEtaDeltaIPhiE2->Fill(dIeta,dIphi);
684 else fhBadClusterDeltaIEtaDeltaIPhiE6->Fill(dIeta,dIphi);
686 fhBadClusterDeltaIA->Fill(clus->E(),dIA);
691 //_________________________________________________________________________________________________________________________
692 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus,const TObjArray *caloClusters, AliVCaloCells * cells,
693 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
694 const Double_t tmax, Double_t timeAverages[2])
696 //Fill CaloCluster related histograms
698 Double_t tof = clus->GetTOF()*1.e9;
700 fhLambda0 ->Fill(clus->E(),clus->GetM02());
701 fhLambda1 ->Fill(clus->E(),clus->GetM20());
702 fhDispersion ->Fill(clus->E(),clus->GetDispersion());
704 fhClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
705 fhClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
706 fhClusterTimeEnergy ->Fill(clus->E(),tof);
708 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kTRUE);
710 //Clusters in event time difference
711 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
713 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
715 if(clus->GetID()==clus2->GetID()) continue;
717 if(clus->GetM02() > 0.01 && clus2->GetM02() > 0.01)
719 Double_t tof2 = clus2->GetTOF()*1.e9;
720 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2);
724 Int_t nModule = GetModuleNumber(clus);
725 Int_t nCaloCellsPerCluster = clus->GetNCells();
727 if(nCaloCellsPerCluster > 1){
729 // check time of cells respect to max energy cell
731 if(fFillAllCellTimeHisto)
733 fhClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
734 fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
737 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
739 Int_t absId = clus->GetCellsAbsId()[ipos];
740 if(absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01) continue;
742 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
743 fhClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
744 fhClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
746 if(fFillAllCellTimeHisto)
748 Double_t time = cells->GetCellTime(absId);
749 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
751 Float_t diff = (tmax-time*1.0e9);
752 fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
753 if(TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId);
756 }// fill cell-cluster histogram loop
758 }//check time and energy of cells respect to max energy cell if cluster of more than 1 cell
761 // Get vertex for photon momentum calculation and event selection
762 Double_t v[3] = {0,0,0}; //vertex ;
763 //GetReader()->GetVertex(v); //
766 clus->GetMomentum(mom,v);
769 Float_t pt = mom.Pt();
770 Float_t eta = mom.Eta();
771 Float_t phi = mom.Phi();
772 if(phi < 0) phi +=TMath::TwoPi();
775 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
779 if(nModule >=0 && nModule < fNModules) fhEMod->Fill(e,nModule);
787 fhEtaPhiE->Fill(eta,phi,e);
790 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
793 if(fFillAllPosHisto2){
796 clus->GetPosition(pos);
798 fhXE ->Fill(pos[0],e);
799 fhYE ->Fill(pos[1],e);
800 fhZE ->Fill(pos[2],e);
802 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
804 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
805 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
806 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
807 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
809 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
812 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
816 //____________________________________________________________________________
817 void AliAnaCalorimeterQA::ClusterLoopHistograms(const TObjArray *caloClusters,
818 AliVCaloCells* cells)
820 // Fill clusters related histograms
825 Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
826 Int_t nCaloClustersAccepted = 0 ;
827 Int_t nCaloCellsPerCluster = 0 ;
828 Bool_t matched = kFALSE;
831 // Get vertex for photon momentum calculation and event selection
832 Double_t v[3] = {0,0,0}; //vertex ;
833 //GetReader()->GetVertex(v);
835 Int_t *nClustersInModule = new Int_t[fNModules];
836 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
839 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
841 // Loop over CaloClusters
842 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
845 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
846 iclus+1,nCaloClusters,GetReader()->GetDataType());
848 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
850 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
851 Float_t maxCellFraction = 0.;
852 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
854 //Cut on time of clusters
855 Double_t tof = clus->GetTOF()*1.e9;
856 if(tof < fTimeCutMin || tof > fTimeCutMax)
858 if(GetDebug() > 0 )printf("AliAnaCalorimeterQA - Remove cluster with TOF %f\n",tof);
862 // Get cluster kinematics
863 clus->GetMomentum(mom,v);
865 // Check only certain regions
867 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
871 nLabel = clus->GetNLabels();
872 labels = clus->GetLabels();
874 // SuperModule number of cluster
875 nModule = GetModuleNumber(clus);
878 nCaloCellsPerCluster = clus->GetNCells();
880 // Cluster mathed with track?
881 matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
883 // Get some time averages
884 Double_t averTime[4] = {0.,0.,0.,0.};
885 CalculateAverageTime(clus, cells, averTime);
887 //Get time of max cell
888 Double_t tmax = cells->GetCellTime(absIdMax);
889 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
892 // Fill histograms related to single cluster
895 // Fill some histograms before applying the exotic cell / bad map cut
896 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
897 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
899 fhClusterMaxCellDiffNoCut->Fill(clus->E(),maxCellFraction);
901 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
902 GetCaloUtils()->RecalibrateCellAmplitude(ampMax,fCalorimeter, absIdMax);
904 if(fStudyExotic) ExoticHistograms(absIdMax, ampMax, clus, cells);
906 //Check bad clusters if requested and rejection was not on
907 Bool_t goodCluster = IsGoodCluster(absIdMax, cells);
909 Float_t eCrossFrac = 0;
910 if(ampMax > 0.01) eCrossFrac = 1-GetECross(absIdMax,cells)/ampMax;
914 BadClusterHistograms(clus, caloClusters, cells, absIdMax,
915 maxCellFraction, eCrossFrac, tmax, averTime);
919 ClusterHistograms(clus, caloClusters, cells, absIdMax,
920 maxCellFraction, eCrossFrac, tmax, averTime);
922 nCaloClustersAccepted++;
923 nModule = GetModuleNumber(clus);
924 if(nModule >=0 && nModule < fNModules)
926 if (fCalorimeter=="EMCAL" && mom.E() > 2*fEMCALCellAmpMin) nClustersInModule[nModule]++;
927 else if(fCalorimeter=="PHOS" && mom.E() > 2*fPHOSCellAmpMin ) nClustersInModule[nModule]++;
931 if(fStudyWeight) WeightHistograms(clus, cells);
933 // Cells in cluster position
934 if(fFillAllPosHisto) CellInClusterPositionHistograms(clus);
936 // Fill histograms related to single cluster, mc vs data
939 if(IsDataMC() && nLabel > 0 && labels)
940 mcOK = ClusterMCHistograms(mom, matched, labels, nLabel, pdg);
942 // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
943 if( matched && fFillAllTMHisto)
944 ClusterMatchedWithTrackHistograms(clus,mom,mcOK,pdg);
947 // Try to reduce background with a mild shower shape cut and no more than 1 maxima
948 // in cluster and remove low energy clusters
949 if(fFillAllPi0Histo && nCaloClusters > 1 && nCaloCellsPerCluster > 1 &&
950 GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1 &&
951 clus->GetM02() < 0.5 && clus->E() > 0.3)
952 InvariantMassHistograms(iclus, mom, nModule, caloClusters,cells);
956 // Number of clusters histograms
957 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
959 // Number of clusters per module
960 for(Int_t imod = 0; imod < fNModules; imod++ )
963 printf("AliAnaCalorimeterQA::ClusterLoopHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
964 fhNClustersMod->Fill(nClustersInModule[imod],imod);
967 delete [] nClustersInModule;
971 //______________________________________________________________________________________________________
972 Bool_t AliAnaCalorimeterQA::ClusterMCHistograms(const TLorentzVector mom, const Bool_t matched,
973 const Int_t * labels, const Int_t nLabels, Int_t & pdg )
976 //Fill histograms only possible when simulation
978 if(!labels || nLabels<=0)
980 if(GetDebug() > 1) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Strange, labels array %p, n labels %d \n", labels,nLabels);
986 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Primaries: nlabels %d\n",nLabels);
990 Float_t eta = mom.Eta();
991 Float_t phi = mom.Phi();
992 if(phi < 0) phi +=TMath::TwoPi();
994 AliAODMCParticle * aodprimary = 0x0;
995 TParticle * primary = 0x0;
997 //Play with the MC stack if available
998 Int_t label = labels[0];
1002 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** bad label ***: label %d \n", label);
1006 Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1007 Float_t vxMC= 0; Float_t vyMC = 0;
1008 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1012 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1014 if ( GetReader()->ReadStack() &&
1015 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1016 { //it MC stack and known tag
1018 if( label >= GetMCStack()->GetNtrack())
1020 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1024 primary = GetMCStack()->Particle(label);
1026 pdg0 = TMath::Abs(primary->GetPdgCode());
1028 status = primary->GetStatusCode();
1029 vxMC = primary->Vx();
1030 vyMC = primary->Vy();
1031 iParent = primary->GetFirstMother();
1035 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Cluster most contributing mother: \n");
1036 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1039 //Get final particle, no conversion products
1040 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1043 primary = GetMCStack()->Particle(iParent);
1044 pdg = TMath::Abs(primary->GetPdgCode());
1046 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Converted cluster!. Find before conversion: \n");
1048 while((pdg == 22 || pdg == 11) && status != 1)
1050 Int_t iMotherOrg = iMother;
1052 primary = GetMCStack()->Particle(iMother);
1053 status = primary->GetStatusCode();
1054 pdg = TMath::Abs(primary->GetPdgCode());
1055 iParent = primary->GetFirstMother();
1057 // If gone too back and non stable, assign the decay photon/electron
1058 // there are other possible decays, ignore them for the moment
1059 if(pdg==111 || pdg==221)
1061 primary = GetMCStack()->Particle(iMotherOrg);
1072 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1077 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1078 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1083 //Overlapped pi0 (or eta, there will be very few), get the meson
1084 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1085 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1087 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1089 while(pdg != 111 && pdg != 221)
1091 //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMCStack()->Particle(iParent)->GetPdgCode());
1093 primary = GetMCStack()->Particle(iMother);
1094 status = primary->GetStatusCode();
1095 pdg = TMath::Abs(primary->GetPdgCode());
1096 iParent = primary->GetFirstMother();
1098 if( iParent < 0 )break;
1100 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1104 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1109 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1110 primary->GetName(),iMother);
1113 eMC = primary->Energy();
1114 ptMC = primary->Pt();
1115 phiMC = primary->Phi();
1116 etaMC = primary->Eta();
1117 pdg = TMath::Abs(primary->GetPdgCode());
1118 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1121 else if( GetReader()->ReadAODMCParticles() &&
1122 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1123 {//it MC AOD and known tag
1124 //Get the list of MC particles
1125 if(!GetReader()->GetAODMCParticles(0))
1126 AliFatal("MCParticles not available!");
1128 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1130 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1132 status = aodprimary->IsPrimary();
1133 vxMC = aodprimary->Xv();
1134 vyMC = aodprimary->Yv();
1135 iParent = aodprimary->GetMother();
1139 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1140 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1141 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1144 //Get final particle, no conversion products
1145 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1148 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1150 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1151 pdg = TMath::Abs(aodprimary->GetPdgCode());
1152 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary())
1154 Int_t iMotherOrg = iMother;
1156 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1157 status = aodprimary->IsPrimary();
1158 iParent = aodprimary->GetMother();
1159 pdg = TMath::Abs(aodprimary->GetPdgCode());
1161 // If gone too back and non stable, assign the decay photon/electron
1162 // there are other possible decays, ignore them for the moment
1163 if(pdg==111 || pdg==221)
1165 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMotherOrg);
1176 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1177 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1182 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1183 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1184 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1189 //Overlapped pi0 (or eta, there will be very few), get the meson
1190 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1191 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1193 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1194 while(pdg != 111 && pdg != 221)
1197 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1198 status = aodprimary->IsPrimary();
1199 iParent = aodprimary->GetMother();
1200 pdg = TMath::Abs(aodprimary->GetPdgCode());
1202 if(iParent < 0 ) break;
1204 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1208 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1213 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1214 aodprimary->GetName(),iMother);
1217 status = aodprimary->IsPrimary();
1218 eMC = aodprimary->E();
1219 ptMC = aodprimary->Pt();
1220 phiMC = aodprimary->Phi();
1221 etaMC = aodprimary->Eta();
1222 pdg = TMath::Abs(aodprimary->GetPdgCode());
1223 charge = aodprimary->Charge();
1227 //Float_t vz = primary->Vz();
1228 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1229 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1)
1231 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1232 fhEMR ->Fill(e,rVMC);
1235 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1236 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1237 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1239 //Overlapped pi0 (or eta, there will be very few)
1240 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0))
1242 fhRecoMCE [kmcPi0][matched] ->Fill(e,eMC);
1243 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPi0][(matched)]->Fill(eta,etaMC);
1244 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPi0][(matched)]->Fill(phi,phiMC);
1245 if(eMC > 0) fhRecoMCRatioE [kmcPi0][(matched)]->Fill(e,e/eMC);
1246 fhRecoMCDeltaE [kmcPi0][(matched)]->Fill(e,eMC-e);
1247 fhRecoMCDeltaPhi[kmcPi0][(matched)]->Fill(e,phiMC-phi);
1248 fhRecoMCDeltaEta[kmcPi0][(matched)]->Fill(e,etaMC-eta);
1249 }//Overlapped pizero decay
1250 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1252 fhRecoMCE [kmcEta][(matched)] ->Fill(e,eMC);
1253 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcEta][(matched)]->Fill(eta,etaMC);
1254 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcEta][(matched)]->Fill(phi,phiMC);
1255 if(eMC > 0) fhRecoMCRatioE [kmcEta][(matched)]->Fill(e,e/eMC);
1256 fhRecoMCDeltaE [kmcEta][(matched)]->Fill(e,eMC-e);
1257 fhRecoMCDeltaPhi[kmcEta][(matched)]->Fill(e,phiMC-phi);
1258 fhRecoMCDeltaEta[kmcEta][(matched)]->Fill(e,etaMC-eta);
1259 }//Overlapped eta decay
1260 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
1261 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1263 fhRecoMCE [kmcPhoton][(matched)] ->Fill(e,eMC);
1264 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPhoton][(matched)]->Fill(eta,etaMC);
1265 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPhoton][(matched)]->Fill(phi,phiMC);
1266 if(eMC > 0) fhRecoMCRatioE [kmcPhoton][(matched)]->Fill(e,e/eMC);
1268 fhRecoMCDeltaE [kmcPhoton][(matched)]->Fill(e,eMC-e);
1269 fhRecoMCDeltaPhi[kmcPhoton][(matched)]->Fill(e,phiMC-phi);
1270 fhRecoMCDeltaEta[kmcPhoton][(matched)]->Fill(e,etaMC-eta);
1272 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
1273 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1275 fhRecoMCE [kmcElectron][(matched)] ->Fill(e,eMC);
1276 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcElectron][(matched)]->Fill(eta,etaMC);
1277 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcElectron][(matched)]->Fill(phi,phiMC);
1278 if(eMC > 0) fhRecoMCRatioE [kmcElectron][(matched)]->Fill(e,e/eMC);
1279 fhRecoMCDeltaE [kmcElectron][(matched)]->Fill(e,eMC-e);
1280 fhRecoMCDeltaPhi[kmcElectron][(matched)]->Fill(e,phiMC-phi);
1281 fhRecoMCDeltaEta[kmcElectron][(matched)]->Fill(e,etaMC-eta);
1282 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1283 fhEMR ->Fill(e,rVMC);
1285 else if(charge == 0)
1287 fhRecoMCE [kmcNeHadron][(matched)] ->Fill(e,eMC);
1288 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcNeHadron][(matched)]->Fill(eta,etaMC);
1289 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcNeHadron][(matched)]->Fill(phi,phiMC);
1290 if(eMC > 0) fhRecoMCRatioE [kmcNeHadron][(matched)]->Fill(e,e/eMC);
1291 fhRecoMCDeltaE [kmcNeHadron][(matched)]->Fill(e,eMC-e);
1292 fhRecoMCDeltaPhi[kmcNeHadron][(matched)]->Fill(e,phiMC-phi);
1293 fhRecoMCDeltaEta[kmcNeHadron][(matched)]->Fill(e,etaMC-eta);
1294 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1295 fhHaR ->Fill(e,rVMC);
1299 fhRecoMCE [kmcChHadron][(matched)] ->Fill(e,eMC);
1300 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcChHadron][(matched)]->Fill(eta,etaMC);
1301 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcChHadron][(matched)]->Fill(phi,phiMC);
1302 if(eMC > 0) fhRecoMCRatioE [kmcChHadron][(matched)]->Fill(e,e/eMC);
1303 fhRecoMCDeltaE [kmcChHadron][(matched)]->Fill(e,eMC-e);
1304 fhRecoMCDeltaPhi[kmcChHadron][(matched)]->Fill(e,phiMC-phi);
1305 fhRecoMCDeltaEta[kmcChHadron][(matched)]->Fill(e,etaMC-eta);
1306 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1307 fhHaR ->Fill(e,rVMC);
1310 if(primary || aodprimary) return kTRUE ;
1315 //________________________________________________________________________________________________
1316 void AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(AliVCluster *clus, TLorentzVector mom,
1317 const Bool_t okPrimary, const Int_t pdg)
1319 //Histograms for clusters matched with tracks
1321 Float_t e = mom.E();
1322 Float_t pt = mom.Pt();
1323 Float_t eta = mom.Eta();
1324 Float_t phi = mom.Phi();
1325 if(phi < 0) phi +=TMath::TwoPi();
1329 fhECharged ->Fill(e);
1330 fhPtCharged ->Fill(pt);
1331 fhPhiCharged ->Fill(phi);
1332 fhEtaCharged ->Fill(eta);
1335 //Study the track and matched cluster if track exists.
1337 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
1341 Double_t tpt = track->Pt();
1342 Double_t tmom = track->P();
1343 Double_t dedx = track->GetTPCsignal();
1344 Int_t nITS = track->GetNcls(0);
1345 Int_t nTPC = track->GetNcls(1);
1348 Float_t deta = clus->GetTrackDz();
1349 Float_t dphi = clus->GetTrackDx();
1350 Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
1352 Double_t eOverP = e/tmom;
1354 fh1EOverP->Fill(tpt, eOverP);
1355 if(dR < 0.02) fh1EOverPR02->Fill(tpt,eOverP);
1358 fh2MatchdEdx->Fill(tmom,dedx);
1360 if(IsDataMC() && okPrimary)
1362 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1364 if(TMath::Abs(pdg) == 11)
1366 fhMCEle1EOverP->Fill(tpt,eOverP);
1367 fhMCEle1dR->Fill(dR);
1368 fhMCEle2MatchdEdx->Fill(tmom,dedx);
1369 if(dR < 0.02) fhMCEle1EOverPR02->Fill(tpt,eOverP);
1373 fhMCChHad1EOverP->Fill(tpt,eOverP);
1374 fhMCChHad1dR->Fill(dR);
1375 fhMCChHad2MatchdEdx->Fill(tmom,dedx);
1376 if(dR < 0.02) fhMCChHad1EOverPR02->Fill(tpt,eOverP);
1378 else if(charge == 0)
1380 fhMCNeutral1EOverP->Fill(tpt,eOverP);
1381 fhMCNeutral1dR->Fill(dR);
1382 fhMCNeutral2MatchdEdx->Fill(tmom,dedx);
1383 if(dR < 0.02) fhMCNeutral1EOverPR02->Fill(tpt,eOverP);
1387 if(dR < 0.02 && eOverP > 0.6 && eOverP< 1.2
1388 && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20)
1390 fh2EledEdx->Fill(tmom,dedx);
1395 //___________________________________
1396 void AliAnaCalorimeterQA::Correlate()
1398 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
1401 TObjArray * caloClustersEMCAL = GetEMCALClusters();
1402 TObjArray * caloClustersPHOS = GetPHOSClusters();
1404 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
1405 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
1407 Float_t sumClusterEnergyEMCAL = 0;
1408 Float_t sumClusterEnergyPHOS = 0;
1410 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1411 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
1412 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1413 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
1418 AliVCaloCells * cellsEMCAL = GetEMCALCells();
1419 AliVCaloCells * cellsPHOS = GetPHOSCells();
1421 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
1422 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
1424 Float_t sumCellEnergyEMCAL = 0;
1425 Float_t sumCellEnergyPHOS = 0;
1427 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1428 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1429 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1430 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1434 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
1435 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1436 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
1437 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1439 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
1440 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
1441 Int_t trM = GetTrackMultiplicity();
1442 if(fCalorimeter=="PHOS"){
1443 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
1444 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
1445 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
1446 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
1448 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
1449 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
1450 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
1451 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
1453 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
1454 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
1455 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
1456 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
1459 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
1460 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
1461 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
1462 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
1464 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
1465 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
1466 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
1467 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
1469 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
1470 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
1471 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
1472 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
1477 printf("AliAnaCalorimeterQA::Correlate(): \n");
1478 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1479 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1480 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1481 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
1482 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
1487 //__________________________________________________
1488 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
1490 //Save parameters used for analysis
1491 TString parList ; //this will be list of parameters used for this analysis.
1492 const Int_t buffersize = 255;
1493 char onePar[buffersize] ;
1495 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
1497 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1499 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
1501 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
1503 //Get parameters set in base class.
1504 //parList += GetBaseParametersList() ;
1506 //Get parameters set in FiducialCut class (not available yet)
1507 //parlist += GetFidCut()->GetFidCutParametersList()
1509 return new TObjString(parList) ;
1512 //___________________________________________________________________________________
1513 void AliAnaCalorimeterQA::ExoticHistograms(const Int_t absIdMax, const Float_t ampMax,
1514 AliVCluster *clus, AliVCaloCells* cells)
1516 // Calculate weights
1520 printf("AliAnaCalorimeterQA::ExoticHistograms()- Low amplitude energy %f\n",ampMax);
1524 Float_t l0 = clus->GetM02();
1525 Float_t en = clus->E();
1526 Int_t nc = clus->GetNCells();
1528 Double_t tmax = cells->GetCellTime(absIdMax);
1529 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1531 for(Int_t ie = 0; ie < fExoNECrossCuts; ie++)
1533 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1535 Float_t eCrossFrac = 1-GetECross(absIdMax,cells, fExoDTimeCuts[idt])/ampMax;
1537 if(eCrossFrac > fExoECrossCuts[ie])
1540 fhExoL0 [ie][idt]->Fill(en,l0 );
1541 fhExoTime [ie][idt]->Fill(en,tmax);
1543 // Diff time, do for one cut in e cross
1546 for (Int_t icell = 0; icell < clus->GetNCells(); icell++)
1548 Int_t absId = clus->GetCellsAbsId()[icell];
1549 Double_t time = cells->GetCellTime(absId);
1550 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1552 Float_t diff = (tmax-time)*1e9;
1553 fhExoDTime[idt]->Fill(en, diff);
1559 fhExoECross[ie][idt]->Fill(en,eCrossFrac);
1560 fhExoNCell[ie][idt]->Fill(en,nc);
1562 } // D time cut loop
1563 } // e cross cut loop
1566 //____________________________________________________
1567 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
1569 // Create histograms to be saved in output file and
1570 // store them in outputContainer
1572 TList * outputContainer = new TList() ;
1573 outputContainer->SetName("QAHistos") ;
1576 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1577 Int_t nfineptbins = GetHistogramRanges()->GetHistoFinePtBins(); Float_t ptfinemax = GetHistogramRanges()->GetHistoFinePtMax(); Float_t ptfinemin = GetHistogramRanges()->GetHistoFinePtMin();
1578 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1579 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1580 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins(); Float_t massmax = GetHistogramRanges()->GetHistoMassMax(); Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
1581 Int_t nasymbins = GetHistogramRanges()->GetHistoAsymmetryBins(); Float_t asymmax = GetHistogramRanges()->GetHistoAsymmetryMax(); Float_t asymmin = GetHistogramRanges()->GetHistoAsymmetryMin();
1582 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins(); Float_t EOverPmax = GetHistogramRanges()->GetHistoPOverEMax(); Float_t EOverPmin = GetHistogramRanges()->GetHistoPOverEMin();
1583 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins(); Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax(); Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1584 Int_t ndRbins = GetHistogramRanges()->GetHistodRBins(); Float_t dRmax = GetHistogramRanges()->GetHistodRMax(); Float_t dRmin = GetHistogramRanges()->GetHistodRMin();
1585 Int_t ntimebins = GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1586 Int_t nclbins = GetHistogramRanges()->GetHistoNClustersBins(); Int_t nclmax = GetHistogramRanges()->GetHistoNClustersMax(); Int_t nclmin = GetHistogramRanges()->GetHistoNClustersMin();
1587 Int_t ncebins = GetHistogramRanges()->GetHistoNCellsBins(); Int_t ncemax = GetHistogramRanges()->GetHistoNCellsMax(); Int_t ncemin = GetHistogramRanges()->GetHistoNCellsMin();
1588 Int_t nceclbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nceclmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nceclmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1589 Int_t nvdistbins = GetHistogramRanges()->GetHistoVertexDistBins(); Float_t vdistmax = GetHistogramRanges()->GetHistoVertexDistMax(); Float_t vdistmin = GetHistogramRanges()->GetHistoVertexDistMin();
1590 Int_t rbins = GetHistogramRanges()->GetHistoRBins(); Float_t rmax = GetHistogramRanges()->GetHistoRMax(); Float_t rmin = GetHistogramRanges()->GetHistoRMin();
1591 Int_t xbins = GetHistogramRanges()->GetHistoXBins(); Float_t xmax = GetHistogramRanges()->GetHistoXMax(); Float_t xmin = GetHistogramRanges()->GetHistoXMin();
1592 Int_t ybins = GetHistogramRanges()->GetHistoYBins(); Float_t ymax = GetHistogramRanges()->GetHistoYMax(); Float_t ymin = GetHistogramRanges()->GetHistoYMin();
1593 Int_t zbins = GetHistogramRanges()->GetHistoZBins(); Float_t zmax = GetHistogramRanges()->GetHistoZMax(); Float_t zmin = GetHistogramRanges()->GetHistoZMin();
1594 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1595 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
1597 Int_t nv0sbins = GetHistogramRanges()->GetHistoV0SignalBins(); Int_t nv0smax = GetHistogramRanges()->GetHistoV0SignalMax(); Int_t nv0smin = GetHistogramRanges()->GetHistoV0SignalMin();
1598 Int_t nv0mbins = GetHistogramRanges()->GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistogramRanges()->GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistogramRanges()->GetHistoV0MultiplicityMin();
1599 Int_t ntrmbins = GetHistogramRanges()->GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistogramRanges()->GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistogramRanges()->GetHistoTrackMultiplicityMin();
1606 if(fCalorimeter=="PHOS")
1613 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
1614 fhE->SetXTitle("E (GeV)");
1615 outputContainer->Add(fhE);
1619 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
1620 fhPt->SetXTitle("p_{T} (GeV/c)");
1621 outputContainer->Add(fhPt);
1623 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
1624 fhPhi->SetXTitle("#phi (rad)");
1625 outputContainer->Add(fhPhi);
1627 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
1628 fhEta->SetXTitle("#eta ");
1629 outputContainer->Add(fhEta);
1634 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
1635 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1636 fhEtaPhiE->SetXTitle("#eta ");
1637 fhEtaPhiE->SetYTitle("#phi (rad)");
1638 fhEtaPhiE->SetZTitle("E (GeV) ");
1639 outputContainer->Add(fhEtaPhiE);
1642 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
1643 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1644 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
1645 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
1646 outputContainer->Add(fhClusterTimeEnergy);
1648 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
1649 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1650 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
1651 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1652 outputContainer->Add(fhClusterPairDiffTimeE);
1654 fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
1655 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1656 fhLambda0->SetXTitle("E_{cluster}");
1657 fhLambda0->SetYTitle("#lambda^{2}_{0}");
1658 outputContainer->Add(fhLambda0);
1660 fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E for bad cluster ",
1661 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1662 fhLambda1->SetXTitle("E_{cluster}");
1663 fhLambda1->SetYTitle("#lambda^{2}_{1}");
1664 outputContainer->Add(fhLambda1);
1666 fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
1667 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1668 fhDispersion->SetXTitle("E_{cluster}");
1669 fhDispersion->SetYTitle("Dispersion");
1670 outputContainer->Add(fhDispersion);
1672 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1673 nptbins,ptmin,ptmax, 100,0,1.);
1674 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1675 fhClusterMaxCellCloseCellRatio->SetYTitle("E_{cell i}/E_{cell max}");
1676 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
1678 fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1679 nptbins,ptmin,ptmax, 500,0,100.);
1680 fhClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1681 fhClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max}-E_{cell i} (GeV)");
1682 outputContainer->Add(fhClusterMaxCellCloseCellDiff);
1684 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1685 nptbins,ptmin,ptmax, 500,0,1.);
1686 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1687 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1688 outputContainer->Add(fhClusterMaxCellDiff);
1690 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
1691 nptbins,ptmin,ptmax, 500,0,1.);
1692 fhClusterMaxCellDiffNoCut->SetXTitle("E_{cluster} (GeV) ");
1693 fhClusterMaxCellDiffNoCut->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1694 outputContainer->Add(fhClusterMaxCellDiffNoCut);
1696 fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
1697 nptbins,ptmin,ptmax, 400,-1,1.);
1698 fhClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1699 fhClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1700 outputContainer->Add(fhClusterMaxCellECross);
1702 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
1703 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1704 fhNCellsPerClusterNoCut->SetXTitle("E (GeV)");
1705 fhNCellsPerClusterNoCut->SetYTitle("n cells");
1706 outputContainer->Add(fhNCellsPerClusterNoCut);
1708 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1709 fhNCellsPerCluster->SetXTitle("E (GeV)");
1710 fhNCellsPerCluster->SetYTitle("n cells");
1711 outputContainer->Add(fhNCellsPerCluster);
1713 fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
1714 fhNClusters->SetXTitle("number of clusters");
1715 outputContainer->Add(fhNClusters);
1717 if(fStudyBadClusters)
1719 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
1720 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
1721 outputContainer->Add(fhBadClusterEnergy);
1723 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
1724 nptbins,ptmin,ptmax, 100,0,1.);
1725 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1726 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
1727 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
1729 fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
1730 nptbins,ptmin,ptmax, 500,0,100);
1731 fhBadClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1732 fhBadClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max} - E_{cell i} (GeV)");
1733 outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
1735 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
1736 nptbins,ptmin,ptmax, 500,0,1.);
1737 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1738 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster}");
1739 outputContainer->Add(fhBadClusterMaxCellDiff);
1741 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
1742 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1743 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
1744 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
1745 outputContainer->Add(fhBadClusterTimeEnergy);
1747 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1748 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
1749 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1750 outputContainer->Add(fhBadClusterPairDiffTimeE);
1752 fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, bad clusters",
1753 nptbins,ptmin,ptmax, 400,-1,1.);
1754 fhBadClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1755 fhBadClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1756 outputContainer->Add(fhBadClusterMaxCellECross);
1758 if(fFillAllCellTimeHisto)
1760 fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1761 fhBadCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
1762 fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max - i} (ns)");
1763 outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
1765 fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1766 fhBadClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
1767 fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
1768 outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
1770 fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1771 fhBadClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
1772 fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
1773 outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
1781 for(Int_t ie = 0; ie <fExoNECrossCuts; ie++)
1784 fhExoDTime[ie] = new TH2F(Form("hExoDTime_ECross%d",ie),
1785 Form("#Delta time = t_{max}-t_{cells} vs E_{cluster} for exotic, 1-E_{+}/E_{max} < %2.2f",fExoECrossCuts[ie]),
1786 nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
1787 fhExoDTime[ie] ->SetYTitle("#Delta t (ns)");
1788 fhExoDTime[ie] ->SetXTitle("E (GeV)");
1789 outputContainer->Add(fhExoDTime[ie]) ;
1791 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1793 fhExoNCell[ie][idt] = new TH2F(Form("hExoNCell_ECross%d_DT%d",ie,idt),
1794 Form("N cells per cluster vs E cluster, 1-E_{+}/E_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1795 nptbins,ptmin,ptmax,nceclbins,nceclmin,nceclmax);
1796 fhExoNCell[ie][idt] ->SetYTitle("N cells");
1797 fhExoNCell[ie][idt] ->SetXTitle("E (GeV)");
1798 outputContainer->Add(fhExoNCell[ie][idt]) ;
1800 fhExoL0 [ie][idt] = new TH2F(Form("hExoL0_ECross%d_DT%d",ie,idt),
1801 Form("M02 vs E cluster for exotic, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1802 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1803 fhExoL0 [ie][idt] ->SetYTitle("#lambda^{2}_{0}");
1804 fhExoL0 [ie][idt] ->SetXTitle("E (GeV)");
1805 outputContainer->Add(fhExoL0[ie][idt]) ;
1807 fhExoECross[ie][idt] = new TH2F(Form("hExoECross_ECross%d_DT%d",ie,idt),
1808 Form("E cross for cells vs E cell, 1-E_{+}/E_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1809 nptbins,ptmin,ptmax,400,0,1);
1810 fhExoECross[ie][idt] ->SetYTitle("1-E_{+}/E_{cell max}");
1811 fhExoECross[ie][idt] ->SetXTitle("E_{cell} (GeV)");
1812 outputContainer->Add(fhExoECross[ie][idt]) ;
1814 fhExoTime [ie][idt] = new TH2F(Form("hExoTime_ECross%d_DT%d",ie,idt),
1815 Form("Time of cluster (max cell) vs E cluster for exotic, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1816 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
1817 fhExoTime [ie][idt] ->SetYTitle("time_{max} (ns)");
1818 fhExoTime [ie][idt] ->SetXTitle("E (GeV)");
1819 outputContainer->Add(fhExoTime[ie][idt]) ;
1825 // Cluster size in terms of cells
1826 if(fStudyClustersAsymmetry)
1828 fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1830 fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
1831 fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
1832 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
1834 fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1836 fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
1837 fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
1838 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
1840 fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1842 fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
1843 fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
1844 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
1846 fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
1847 nptbins,ptmin,ptmax,21,-1.05,1.05);
1848 fhDeltaIA[0]->SetXTitle("E_{cluster}");
1849 fhDeltaIA[0]->SetYTitle("A_{cell in cluster}");
1850 outputContainer->Add(fhDeltaIA[0]);
1852 fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
1853 ssbins,ssmin,ssmax,21,-1.05,1.05);
1854 fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
1855 fhDeltaIAL0[0]->SetYTitle("A_{cell in cluster}");
1856 outputContainer->Add(fhDeltaIAL0[0]);
1858 fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
1859 ssbins,ssmin,ssmax,21,-1.05,1.05);
1860 fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
1861 fhDeltaIAL1[0]->SetYTitle("A_{cell in cluster}");
1862 outputContainer->Add(fhDeltaIAL1[0]);
1864 fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
1865 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1866 fhDeltaIANCells[0]->SetXTitle("N_{cell in cluster}");
1867 fhDeltaIANCells[0]->SetYTitle("A_{cell in cluster}");
1868 outputContainer->Add(fhDeltaIANCells[0]);
1871 fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3, matched with track",
1873 fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
1874 fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
1875 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
1877 fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3, matched with track",
1879 fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
1880 fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
1881 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
1883 fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3, matched with track",
1885 fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
1886 fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
1887 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
1889 fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
1890 nptbins,ptmin,ptmax,21,-1.05,1.05);
1891 fhDeltaIA[1]->SetXTitle("E_{cluster}");
1892 fhDeltaIA[1]->SetYTitle("A_{cell in cluster}");
1893 outputContainer->Add(fhDeltaIA[1]);
1895 fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
1896 ssbins,ssmin,ssmax,21,-1.05,1.05);
1897 fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
1898 fhDeltaIAL0[1]->SetYTitle("A_{cell in cluster}");
1899 outputContainer->Add(fhDeltaIAL0[1]);
1901 fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
1902 ssbins,ssmin,ssmax,21,-1.05,1.05);
1903 fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
1904 fhDeltaIAL1[1]->SetYTitle("A_{cell in cluster}");
1905 outputContainer->Add(fhDeltaIAL1[1]);
1907 fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
1908 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1909 fhDeltaIANCells[1]->SetXTitle("N_{cell in cluster}");
1910 fhDeltaIANCells[1]->SetYTitle("A_{cell in cluster}");
1911 outputContainer->Add(fhDeltaIANCells[1]);
1914 TString particle[]={"Photon","Electron","Conversion","Hadron"};
1915 for (Int_t iPart = 0; iPart < 4; iPart++) {
1917 fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
1918 nptbins,ptmin,ptmax,21,-1.05,1.05);
1919 fhDeltaIAMC[iPart]->SetXTitle("E_{cluster}");
1920 fhDeltaIAMC[iPart]->SetYTitle("A_{cell in cluster}");
1921 outputContainer->Add(fhDeltaIAMC[iPart]);
1925 if(fStudyBadClusters)
1927 fhBadClusterDeltaIEtaDeltaIPhiE0 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1929 fhBadClusterDeltaIEtaDeltaIPhiE0->SetXTitle("#Delta Column");
1930 fhBadClusterDeltaIEtaDeltaIPhiE0->SetYTitle("#Delta Row");
1931 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE0);
1933 fhBadClusterDeltaIEtaDeltaIPhiE2 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1935 fhBadClusterDeltaIEtaDeltaIPhiE2->SetXTitle("#Delta Column");
1936 fhBadClusterDeltaIEtaDeltaIPhiE2->SetYTitle("#Delta Row");
1937 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE2);
1939 fhBadClusterDeltaIEtaDeltaIPhiE6 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1941 fhBadClusterDeltaIEtaDeltaIPhiE6->SetXTitle("#Delta Column");
1942 fhBadClusterDeltaIEtaDeltaIPhiE6->SetYTitle("#Delta Row");
1943 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE6);
1945 fhBadClusterDeltaIA = new TH2F ("hBadClusterDeltaIA"," Cluster *asymmetry* in cell units vs E",
1946 nptbins,ptmin,ptmax,21,-1.05,1.05);
1947 fhBadClusterDeltaIA->SetXTitle("E_{cluster}");
1948 fhBadClusterDeltaIA->SetYTitle("A_{cell in cluster}");
1949 outputContainer->Add(fhBadClusterDeltaIA);
1955 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy",
1956 nptbins,ptmin,ptmax, 100,0,1.);
1957 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1958 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
1959 outputContainer->Add(fhECellClusterRatio);
1961 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy",
1962 nptbins,ptmin,ptmax, 100,-10,0);
1963 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1964 fhECellClusterLogRatio->SetYTitle("Log(E_{cell i}/E_{cluster})");
1965 outputContainer->Add(fhECellClusterLogRatio);
1967 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy",
1968 nptbins,ptmin,ptmax, 100,0,1.);
1969 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1970 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
1971 outputContainer->Add(fhEMaxCellClusterRatio);
1973 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy",
1974 nptbins,ptmin,ptmax, 100,-10,0);
1975 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1976 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1977 outputContainer->Add(fhEMaxCellClusterLogRatio);
1979 for(Int_t iw = 0; iw < 14; iw++){
1980 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f",1+0.5*iw),
1981 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1982 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
1983 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
1984 outputContainer->Add(fhLambda0ForW0[iw]);
1986 // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f",1+0.5*iw),
1987 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1988 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
1989 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
1990 // outputContainer->Add(fhLambda1ForW0[iw]);
1993 TString mcnames[] = {"Photon", "Electron","Conversion","Pi0","Hadron"};
1994 for(Int_t imc = 0; imc < 5; imc++){
1995 fhLambda0ForW0MC[iw][imc] = new TH2F (Form("hLambda0ForW0%d_MC%s",iw,mcnames[imc].Data()),
1996 Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
1997 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1998 fhLambda0ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
1999 fhLambda0ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{0}");
2000 outputContainer->Add(fhLambda0ForW0MC[iw][imc]);
2002 // fhLambda1ForW0MC[iw][imc] = new TH2F (Form("hLambda1ForW0%d_MC%s",iw,mcnames[imc].Data()),
2003 // Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
2004 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2005 // fhLambda1ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
2006 // fhLambda1ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{1}");
2007 // outputContainer->Add(fhLambda1ForW0MC[iw][imc]);
2018 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2019 fhECharged->SetXTitle("E (GeV)");
2020 outputContainer->Add(fhECharged);
2022 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2023 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
2024 outputContainer->Add(fhPtCharged);
2026 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
2027 fhPhiCharged->SetXTitle("#phi (rad)");
2028 outputContainer->Add(fhPhiCharged);
2030 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
2031 fhEtaCharged->SetXTitle("#eta ");
2032 outputContainer->Add(fhEtaCharged);
2035 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
2036 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2037 fhEtaPhiECharged->SetXTitle("#eta ");
2038 fhEtaPhiECharged->SetYTitle("#phi ");
2039 fhEtaPhiECharged->SetZTitle("E (GeV) ");
2040 outputContainer->Add(fhEtaPhiECharged);
2043 fh1EOverP = new TH2F("h1EOverP","TRACK matches E/p",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2044 fh1EOverP->SetYTitle("E/p");
2045 fh1EOverP->SetXTitle("p_{T} (GeV/c)");
2046 outputContainer->Add(fh1EOverP);
2048 fh2dR = new TH2F("h2dR","TRACK matches dR",nptbins,ptmin,ptmax,ndRbins,dRmin,dRmax);
2049 fh2dR->SetXTitle("#Delta R (rad)");
2050 fh2dR->SetXTitle("E cluster (GeV)");
2051 outputContainer->Add(fh2dR) ;
2053 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2054 fh2MatchdEdx->SetXTitle("p (GeV/c)");
2055 fh2MatchdEdx->SetYTitle("<dE/dx>");
2056 outputContainer->Add(fh2MatchdEdx);
2058 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2059 fh2EledEdx->SetXTitle("p (GeV/c)");
2060 fh2EledEdx->SetYTitle("<dE/dx>");
2061 outputContainer->Add(fh2EledEdx) ;
2063 fh1EOverPR02 = new TH2F("h1EOverPR02","TRACK matches E/p, all",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2064 fh1EOverPR02->SetYTitle("E/p");
2065 fh1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2066 outputContainer->Add(fh1EOverPR02);
2069 if(fFillAllPi0Histo)
2071 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy, ncell > 1",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2072 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
2073 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
2074 outputContainer->Add(fhIM);
2076 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
2077 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
2078 fhAsym->SetYTitle("Asymmetry");
2079 outputContainer->Add(fhAsym);
2083 if(fFillAllPosHisto2)
2087 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2088 fhXYZ->SetXTitle("x (cm)");
2089 fhXYZ->SetYTitle("y (cm)");
2090 fhXYZ->SetZTitle("z (cm) ");
2091 outputContainer->Add(fhXYZ);
2094 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
2095 fhXNCells->SetXTitle("x (cm)");
2096 fhXNCells->SetYTitle("N cells per cluster");
2097 outputContainer->Add(fhXNCells);
2099 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
2100 fhZNCells->SetXTitle("z (cm)");
2101 fhZNCells->SetYTitle("N cells per cluster");
2102 outputContainer->Add(fhZNCells);
2104 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2105 fhXE->SetXTitle("x (cm)");
2106 fhXE->SetYTitle("E (GeV)");
2107 outputContainer->Add(fhXE);
2109 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2110 fhZE->SetXTitle("z (cm)");
2111 fhZE->SetYTitle("E (GeV)");
2112 outputContainer->Add(fhZE);
2114 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
2115 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2116 fhRNCells->SetYTitle("N cells per cluster");
2117 outputContainer->Add(fhRNCells);
2120 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
2121 fhYNCells->SetXTitle("y (cm)");
2122 fhYNCells->SetYTitle("N cells per cluster");
2123 outputContainer->Add(fhYNCells);
2125 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2126 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2127 fhRE->SetYTitle("E (GeV)");
2128 outputContainer->Add(fhRE);
2130 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2131 fhYE->SetXTitle("y (cm)");
2132 fhYE->SetYTitle("E (GeV)");
2133 outputContainer->Add(fhYE);
2136 if(fFillAllPosHisto)
2138 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2139 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2140 fhRCellE->SetYTitle("E (GeV)");
2141 outputContainer->Add(fhRCellE);
2143 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2144 fhXCellE->SetXTitle("x (cm)");
2145 fhXCellE->SetYTitle("E (GeV)");
2146 outputContainer->Add(fhXCellE);
2148 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2149 fhYCellE->SetXTitle("y (cm)");
2150 fhYCellE->SetYTitle("E (GeV)");
2151 outputContainer->Add(fhYCellE);
2153 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2154 fhZCellE->SetXTitle("z (cm)");
2155 fhZCellE->SetYTitle("E (GeV)");
2156 outputContainer->Add(fhZCellE);
2158 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2159 fhXYZCell->SetXTitle("x (cm)");
2160 fhXYZCell->SetYTitle("y (cm)");
2161 fhXYZCell->SetZTitle("z (cm)");
2162 outputContainer->Add(fhXYZCell);
2165 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
2166 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
2167 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
2168 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
2170 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
2171 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2172 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
2173 outputContainer->Add(fhDeltaCellClusterRNCells);
2175 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
2176 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
2177 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
2178 outputContainer->Add(fhDeltaCellClusterXNCells);
2180 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
2181 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
2182 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
2183 outputContainer->Add(fhDeltaCellClusterYNCells);
2185 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
2186 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
2187 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
2188 outputContainer->Add(fhDeltaCellClusterZNCells);
2190 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
2191 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2192 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
2193 outputContainer->Add(fhDeltaCellClusterRE);
2195 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
2196 fhDeltaCellClusterXE->SetXTitle("x (cm)");
2197 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
2198 outputContainer->Add(fhDeltaCellClusterXE);
2200 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
2201 fhDeltaCellClusterYE->SetXTitle("y (cm)");
2202 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
2203 outputContainer->Add(fhDeltaCellClusterYE);
2205 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
2206 fhDeltaCellClusterZE->SetXTitle("z (cm)");
2207 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
2208 outputContainer->Add(fhDeltaCellClusterZE);
2210 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2211 fhEtaPhiAmp->SetXTitle("#eta ");
2212 fhEtaPhiAmp->SetYTitle("#phi (rad)");
2213 fhEtaPhiAmp->SetZTitle("E (GeV) ");
2214 outputContainer->Add(fhEtaPhiAmp);
2219 fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin+0.5,ncemax);
2220 fhNCells->SetXTitle("n cells");
2221 outputContainer->Add(fhNCells);
2223 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
2224 fhAmplitude->SetXTitle("Cell Energy (GeV)");
2225 outputContainer->Add(fhAmplitude);
2227 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2228 fhAmpId->SetXTitle("Cell Energy (GeV)");
2229 outputContainer->Add(fhAmpId);
2231 if(fFillAllCellTimeHisto)
2233 fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
2234 fhCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
2235 fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max-i} (ns)");
2236 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
2238 fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2239 fhClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
2240 fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
2241 outputContainer->Add(fhClusterMaxCellDiffAverageTime);
2243 fhClusterMaxCellDiffWeightedTime = new TH2F ("hClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2244 fhClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
2245 fhClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
2246 outputContainer->Add(fhClusterMaxCellDiffWeightedTime);
2248 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
2249 fNMaxCols*fNMaxRows*fNModules,0,fNMaxCols*fNMaxRows*fNModules);
2250 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
2251 outputContainer->Add(fhCellIdCellLargeTimeSpread);
2253 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
2254 fhTime->SetXTitle("Cell Time (ns)");
2255 outputContainer->Add(fhTime);
2257 fhTimeVz = new TH2F ("hTimeVz","Cell Time vs vertex, amplitude > 0.5 GeV",100, 0, 50,ntimebins,timemin,timemax);
2258 fhTimeVz->SetXTitle("|v_{z}| (cm)");
2259 fhTimeVz->SetYTitle("Cell Time (ns)");
2260 outputContainer->Add(fhTimeVz);
2262 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",
2263 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2264 fhTimeId->SetXTitle("Cell Time (ns)");
2265 fhTimeId->SetYTitle("Cell Absolute Id");
2266 outputContainer->Add(fhTimeId);
2268 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
2269 fhTimeAmp->SetYTitle("Cell Time (ns)");
2270 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
2271 outputContainer->Add(fhTimeAmp);
2275 fhCellECross = new TH2F ("hCellECross","1 - Energy in cross around cell / cell energy",
2276 nptbins,ptmin,ptmax, 400,-1,1.);
2277 fhCellECross->SetXTitle("E_{cell} (GeV) ");
2278 fhCellECross->SetYTitle("1- E_{cross}/E_{cell}");
2279 outputContainer->Add(fhCellECross);
2285 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2286 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
2287 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
2288 outputContainer->Add(fhCaloCorrNClusters);
2290 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2291 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
2292 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
2293 outputContainer->Add(fhCaloCorrEClusters);
2295 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2296 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
2297 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
2298 outputContainer->Add(fhCaloCorrNCells);
2300 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
2301 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
2302 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
2303 outputContainer->Add(fhCaloCorrECells);
2305 //Calorimeter VS V0 signal
2306 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
2307 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
2308 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2309 outputContainer->Add(fhCaloV0SCorrNClusters);
2311 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2312 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
2313 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2314 outputContainer->Add(fhCaloV0SCorrEClusters);
2316 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
2317 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
2318 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2319 outputContainer->Add(fhCaloV0SCorrNCells);
2321 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2322 fhCaloV0SCorrECells->SetXTitle("V0 signal");
2323 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2324 outputContainer->Add(fhCaloV0SCorrECells);
2326 //Calorimeter VS V0 multiplicity
2327 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
2328 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
2329 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2330 outputContainer->Add(fhCaloV0MCorrNClusters);
2332 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2333 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
2334 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2335 outputContainer->Add(fhCaloV0MCorrEClusters);
2337 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
2338 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
2339 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2340 outputContainer->Add(fhCaloV0MCorrNCells);
2342 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2343 fhCaloV0MCorrECells->SetXTitle("V0 signal");
2344 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2345 outputContainer->Add(fhCaloV0MCorrECells);
2347 //Calorimeter VS Track multiplicity
2348 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
2349 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
2350 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2351 outputContainer->Add(fhCaloTrackMCorrNClusters);
2353 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2354 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
2355 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2356 outputContainer->Add(fhCaloTrackMCorrEClusters);
2358 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
2359 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
2360 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2361 outputContainer->Add(fhCaloTrackMCorrNCells);
2363 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2364 fhCaloTrackMCorrECells->SetXTitle("# tracks");
2365 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2366 outputContainer->Add(fhCaloTrackMCorrECells);
2369 }//correlate calorimeters
2373 fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2374 fhEMod->SetXTitle("E (GeV)");
2375 fhEMod->SetYTitle("Module");
2376 outputContainer->Add(fhEMod);
2378 fhAmpMod = new TH2F ("hAmp_Mod","Cell energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2379 fhAmpMod->SetXTitle("E (GeV)");
2380 fhAmpMod->SetYTitle("Module");
2381 outputContainer->Add(fhAmpMod);
2383 if(fFillAllCellTimeHisto)
2385 fhTimeMod = new TH2F ("hTime_Mod","Cell time in each present Module",ntimebins,timemin,timemax,fNModules,0,fNModules);
2386 fhTimeMod->SetXTitle("t (ns)");
2387 fhTimeMod->SetYTitle("Module");
2388 outputContainer->Add(fhTimeMod);
2391 fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin+0.5,nclmax,fNModules,0,fNModules);
2392 fhNClustersMod->SetXTitle("number of clusters");
2393 fhNClustersMod->SetYTitle("Module");
2394 outputContainer->Add(fhNClustersMod);
2396 fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", ncebins,ncemin+0.5,ncemax,fNModules,0,fNModules);
2397 fhNCellsMod->SetXTitle("n cells");
2398 fhNCellsMod->SetYTitle("Module");
2399 outputContainer->Add(fhNCellsMod);
2401 Int_t colmaxs = fNMaxCols;
2402 Int_t rowmaxs = fNMaxRows;
2403 if(fCalorimeter=="EMCAL")
2405 colmaxs=2*fNMaxCols;
2406 rowmaxs=Int_t(fNModules/2)*fNMaxRows;
2410 rowmaxs=fNModules*fNMaxRows;
2413 fhGridCells = new TH2F ("hGridCells",Form("Entries in grid of cells"),
2414 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2415 fhGridCells->SetYTitle("row (phi direction)");
2416 fhGridCells->SetXTitle("column (eta direction)");
2417 outputContainer->Add(fhGridCells);
2419 fhGridCellsE = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
2420 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2421 fhGridCellsE->SetYTitle("row (phi direction)");
2422 fhGridCellsE->SetXTitle("column (eta direction)");
2423 outputContainer->Add(fhGridCellsE);
2425 if(fFillAllCellTimeHisto)
2427 fhGridCellsTime = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
2428 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2429 fhGridCellsTime->SetYTitle("row (phi direction)");
2430 fhGridCellsTime->SetXTitle("column (eta direction)");
2431 outputContainer->Add(fhGridCellsTime);
2434 fhNCellsPerClusterMod = new TH2F*[fNModules];
2435 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
2436 fhIMMod = new TH2F*[fNModules];
2437 if(fFillAllCellTimeHisto) fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2439 for(Int_t imod = 0; imod < fNModules; imod++)
2441 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
2442 Form("# cells per cluster vs cluster energy in Module %d",imod),
2443 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2444 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
2445 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
2446 outputContainer->Add(fhNCellsPerClusterMod[imod]);
2448 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
2449 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
2450 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2451 fhNCellsPerClusterModNoCut[imod]->SetXTitle("E (GeV)");
2452 fhNCellsPerClusterModNoCut[imod]->SetYTitle("n cells");
2453 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
2455 if(fFillAllCellTimeHisto)
2457 for(Int_t ircu = 0; ircu < fNRCU; ircu++)
2459 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
2460 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
2461 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2462 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
2463 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
2464 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
2469 if(fFillAllPi0Histo)
2471 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
2472 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
2473 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2474 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
2475 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
2476 outputContainer->Add(fhIMMod[imod]);
2481 // Monte Carlo Histograms
2483 TString particleName[] = { "Photon", "Pi0", "Eta", "Electron", "NeutralHadron", "ChargedHadron" };
2487 for(Int_t iPart = 0; iPart < 6; iPart++)
2489 for(Int_t iCh = 0; iCh < 2; iCh++)
2491 fhRecoMCRatioE[iPart][iCh] = new TH2F (Form("hRecoMCRatioE_%s_Match%d",particleName[iPart].Data(),iCh),
2492 Form("Reco/Gen E, %s, Matched %d",particleName[iPart].Data(),iCh),
2493 nptbins, ptmin, ptmax, 200,0,2);
2494 fhRecoMCRatioE[iPart][iCh]->SetXTitle("E_{reconstructed}/E_{generated}");
2495 outputContainer->Add(fhRecoMCRatioE[iPart][iCh]);
2498 fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
2499 Form("MC - Reco E, %s, Matched %d",particleName[iPart].Data(),iCh),
2500 nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
2501 fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#Delta E (GeV)");
2502 outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
2504 fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2505 Form("MC - Reco #phi, %s, Matched %d",particleName[iPart].Data(),iCh),
2506 nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
2507 fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#Delta #phi (rad)");
2508 outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
2510 fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
2511 Form("MC- Reco #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
2512 nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
2513 fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#Delta #eta ");
2514 outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
2516 fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
2517 Form("E distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2518 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2519 fhRecoMCE[iPart][iCh]->SetXTitle("E_{rec} (GeV)");
2520 fhRecoMCE[iPart][iCh]->SetYTitle("E_{gen} (GeV)");
2521 outputContainer->Add(fhRecoMCE[iPart][iCh]);
2523 fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2524 Form("#phi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2525 nphibins,phimin,phimax, nphibins,phimin,phimax);
2526 fhRecoMCPhi[iPart][iCh]->SetXTitle("#phi_{rec} (rad)");
2527 fhRecoMCPhi[iPart][iCh]->SetYTitle("#phi_{gen} (rad)");
2528 outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
2530 fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
2531 Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2532 netabins,etamin,etamax,netabins,etamin,etamax);
2533 fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{rec} ");
2534 fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{gen} ");
2535 outputContainer->Add(fhRecoMCEta[iPart][iCh]);
2540 for(Int_t iPart = 0; iPart < 4; iPart++)
2542 fhGenMCE[iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
2543 Form("p_{T} of generated %s",particleName[iPart].Data()),
2544 nptbins,ptmin,ptmax);
2545 fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
2546 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2547 netabins,etamin,etamax,nphibins,phimin,phimax);
2549 fhGenMCE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2550 fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
2551 fhGenMCEtaPhi[iPart]->SetYTitle("#phi (rad)");
2553 outputContainer->Add(fhGenMCE[iPart]);
2554 outputContainer->Add(fhGenMCEtaPhi[iPart]);
2557 fhGenMCAccE[iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
2558 Form("p_{T} of generated %s",particleName[iPart].Data()),
2559 nptbins,ptmin,ptmax);
2560 fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
2561 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2562 netabins,etamin,etamax,nphibins,phimin,phimax);
2564 fhGenMCAccE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2565 fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
2566 fhGenMCAccEtaPhi[iPart]->SetYTitle("#phi (rad)");
2568 outputContainer->Add(fhGenMCAccE[iPart]);
2569 outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
2573 //Vertex of generated particles
2575 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2576 fhEMVxyz->SetXTitle("v_{x}");
2577 fhEMVxyz->SetYTitle("v_{y}");
2578 //fhEMVxyz->SetZTitle("v_{z}");
2579 outputContainer->Add(fhEMVxyz);
2581 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2582 fhHaVxyz->SetXTitle("v_{x}");
2583 fhHaVxyz->SetYTitle("v_{y}");
2584 //fhHaVxyz->SetZTitle("v_{z}");
2585 outputContainer->Add(fhHaVxyz);
2587 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2588 fhEMR->SetXTitle("E (GeV)");
2589 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2590 outputContainer->Add(fhEMR);
2592 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2593 fhHaR->SetXTitle("E (GeV)");
2594 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2595 outputContainer->Add(fhHaR);
2600 fhMCEle1EOverP = new TH2F("hMCEle1EOverP","TRACK matches E/p, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2601 fhMCEle1EOverP->SetYTitle("E/p");
2602 fhMCEle1EOverP->SetXTitle("p_{T} (GeV/c)");
2603 outputContainer->Add(fhMCEle1EOverP);
2605 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
2606 fhMCEle1dR->SetXTitle("#Delta R (rad)");
2607 outputContainer->Add(fhMCEle1dR) ;
2609 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2610 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
2611 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
2612 outputContainer->Add(fhMCEle2MatchdEdx);
2614 fhMCChHad1EOverP = new TH2F("hMCChHad1EOverP","TRACK matches E/p, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2615 fhMCChHad1EOverP->SetYTitle("E/p");
2616 fhMCChHad1EOverP->SetXTitle("p_{T} (GeV/c)");
2617 outputContainer->Add(fhMCChHad1EOverP);
2619 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
2620 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
2621 outputContainer->Add(fhMCChHad1dR) ;
2623 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2624 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
2625 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
2626 outputContainer->Add(fhMCChHad2MatchdEdx);
2628 fhMCNeutral1EOverP = new TH2F("hMCNeutral1EOverP","TRACK matches E/p, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2629 fhMCNeutral1EOverP->SetYTitle("E/p");
2630 fhMCNeutral1EOverP->SetXTitle("p_{T} (GeV/c)");
2631 outputContainer->Add(fhMCNeutral1EOverP);
2633 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
2634 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
2635 outputContainer->Add(fhMCNeutral1dR) ;
2637 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2638 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
2639 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
2640 outputContainer->Add(fhMCNeutral2MatchdEdx);
2642 fhMCEle1EOverPR02 = new TH2F("hMCEle1EOverPR02","TRACK matches E/p, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2643 fhMCEle1EOverPR02->SetYTitle("E/p");
2644 fhMCEle1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2645 outputContainer->Add(fhMCEle1EOverPR02);
2647 fhMCChHad1EOverPR02 = new TH2F("hMCChHad1EOverPR02","TRACK matches E/p, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2648 fhMCChHad1EOverPR02->SetYTitle("E/p");
2649 fhMCChHad1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2650 outputContainer->Add(fhMCChHad1EOverPR02);
2652 fhMCNeutral1EOverPR02 = new TH2F("hMCNeutral1EOverPR02","TRACK matches E/p, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,EOverPmin,EOverPmax);
2653 fhMCNeutral1EOverPR02->SetYTitle("E/p");
2654 fhMCNeutral1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2655 outputContainer->Add(fhMCNeutral1EOverPR02);
2658 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
2659 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
2661 return outputContainer;
2664 //__________________________________________________________________________________________________
2665 Float_t AliAnaCalorimeterQA::GetECross(const Int_t absID, AliVCaloCells* cells, const Float_t dtcut)
2667 // Get energy in cross axis around maximum cell, for EMCAL only
2669 Int_t icol =-1, irow=-1,iRCU = -1;
2670 Int_t imod = GetModuleNumberCellIndexes(absID, fCalorimeter, icol, irow, iRCU);
2672 if(fCalorimeter=="EMCAL")
2674 //Get close cells index, energy and time, not in corners
2679 if( irow < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow+1, icol);
2680 if( irow > 0 ) absID2 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow-1, icol);
2682 // In case of cell in eta = 0 border, depending on SM shift the cross cell index
2686 if ( icol == AliEMCALGeoParams::fgkEMCALCols - 1 && !(imod%2) )
2688 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod+1, irow, 0);
2689 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol-1);
2691 else if( icol == 0 && imod%2 )
2693 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol+1);
2694 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod-1, irow, AliEMCALGeoParams::fgkEMCALCols-1);
2698 if( icol < AliEMCALGeoParams::fgkEMCALCols-1 )
2699 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol+1);
2701 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol-1);
2704 //Recalibrate cell energy if needed
2705 //Float_t ecell = cells->GetCellAmplitude(absID);
2706 //GetCaloUtils()->RecalibrateCellAmplitude(ecell,fCalorimeter, absID);
2707 Double_t tcell = cells->GetCellTime(absID);
2708 GetCaloUtils()->RecalibrateCellTime(tcell, fCalorimeter, absID,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2710 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2711 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
2715 ecell1 = cells->GetCellAmplitude(absID1);
2716 GetCaloUtils()->RecalibrateCellAmplitude(ecell1, fCalorimeter, absID1);
2717 tcell1 = cells->GetCellTime(absID1);
2718 GetCaloUtils()->RecalibrateCellTime (tcell1, fCalorimeter, absID1,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2722 ecell2 = cells->GetCellAmplitude(absID2);
2723 GetCaloUtils()->RecalibrateCellAmplitude(ecell2, fCalorimeter, absID2);
2724 tcell2 = cells->GetCellTime(absID2);
2725 GetCaloUtils()->RecalibrateCellTime (tcell2, fCalorimeter, absID2, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2729 ecell3 = cells->GetCellAmplitude(absID3);
2730 GetCaloUtils()->RecalibrateCellAmplitude(ecell3, fCalorimeter, absID3);
2731 tcell3 = cells->GetCellTime(absID3);
2732 GetCaloUtils()->RecalibrateCellTime (tcell3, fCalorimeter, absID3, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2736 ecell4 = cells->GetCellAmplitude(absID4);
2737 GetCaloUtils()->RecalibrateCellAmplitude(ecell4, fCalorimeter, absID4);
2738 tcell4 = cells->GetCellTime(absID4);
2739 GetCaloUtils()->RecalibrateCellTime (tcell4, fCalorimeter, absID4, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2742 if(TMath::Abs(tcell-tcell1)*1.e9 > dtcut) ecell1 = 0 ;
2743 if(TMath::Abs(tcell-tcell2)*1.e9 > dtcut) ecell2 = 0 ;
2744 if(TMath::Abs(tcell-tcell3)*1.e9 > dtcut) ecell3 = 0 ;
2745 if(TMath::Abs(tcell-tcell4)*1.e9 > dtcut) ecell4 = 0 ;
2747 return ecell1+ecell2+ecell3+ecell4;
2752 Int_t absId1 = -1, absId2 = -1, absId3 = -1, absId4 = -1;
2754 Int_t relId1[] = { imod+1, 0, irow+1, icol };
2755 Int_t relId2[] = { imod+1, 0, irow-1, icol };
2756 Int_t relId3[] = { imod+1, 0, irow , icol+1 };
2757 Int_t relId4[] = { imod+1, 0, irow , icol-1 };
2759 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId1, absId1);
2760 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId2, absId2);
2761 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId3, absId3);
2762 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId4, absId4);
2764 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2766 if(absId1 > 0 ) ecell1 = cells->GetCellAmplitude(absId1);
2767 if(absId2 > 0 ) ecell2 = cells->GetCellAmplitude(absId2);
2768 if(absId3 > 0 ) ecell3 = cells->GetCellAmplitude(absId3);
2769 if(absId4 > 0 ) ecell4 = cells->GetCellAmplitude(absId4);
2771 return ecell1+ecell2+ecell3+ecell4;
2777 //__________________________________________________________________________________________________
2778 void AliAnaCalorimeterQA::InvariantMassHistograms(const Int_t iclus, const TLorentzVector mom,
2779 const Int_t nModule, const TObjArray* caloClusters,
2780 AliVCaloCells * cells)
2782 // Fill Invariant mass histograms
2784 if(GetDebug()>1) printf("AliAnaCalorimeterQA::InvariantMassHistograms() - Start \n");
2786 //Get vertex for photon momentum calculation and event selection
2787 Double_t v[3] = {0,0,0}; //vertex ;
2788 //GetReader()->GetVertex(v);
2790 Int_t nModule2 = -1;
2791 TLorentzVector mom2 ;
2792 Int_t nCaloClusters = caloClusters->GetEntriesFast();
2794 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++)
2796 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
2798 Float_t maxCellFraction = 0.;
2799 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction);
2801 // Try to rediuce background with a mild shower shape cut and no more than 1 maxima
2802 // in cluster and remove low energy clusters
2803 if( clus2->GetNCells() <= 1 || !IsGoodCluster(absIdMax,cells) ||
2804 GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1 ||
2805 clus2->GetM02() > 0.5 || clus2->E() < 0.3) continue;
2807 //Get cluster kinematics
2808 clus2->GetMomentum(mom2,v);
2810 //Check only certain regions
2812 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
2815 //Get module of cluster
2816 nModule2 = GetModuleNumber(clus2);
2821 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
2824 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
2825 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
2828 //Asymetry histograms
2829 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
2831 }// 2nd cluster loop
2835 //______________________________
2836 void AliAnaCalorimeterQA::Init()
2838 //Check if the data or settings are ok
2840 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
2841 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
2843 if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
2844 AliFatal("Analysis of reconstructed data, MC reader not aplicable");
2848 //________________________________________
2849 void AliAnaCalorimeterQA::InitParameters()
2851 //Initialize the parameters of the analysis.
2852 AddToHistogramsName("AnaCaloQA_");
2854 fCalorimeter = "EMCAL"; //or PHOS
2855 fNModules = 12; // set maximum to maximum number of EMCAL modules
2856 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
2857 fTimeCutMin = -9999999;
2858 fTimeCutMax = 9999999;
2859 fEMCALCellAmpMin = 0.2;
2860 fPHOSCellAmpMin = 0.2;
2863 fExoNECrossCuts = 10 ;
2864 fExoNDTimeCuts = 4 ;
2866 fExoDTimeCuts [0] = 1.e4 ; fExoDTimeCuts [1] = 50.0 ; fExoDTimeCuts [2] = 25.0 ; fExoDTimeCuts [3] = 10.0 ;
2867 fExoECrossCuts[0] = 0.80 ; fExoECrossCuts[1] = 0.85 ; fExoECrossCuts[2] = 0.90 ; fExoECrossCuts[3] = 0.92 ; fExoECrossCuts[4] = 0.94 ;
2868 fExoECrossCuts[5] = 0.95 ; fExoECrossCuts[6] = 0.96 ; fExoECrossCuts[7] = 0.97 ; fExoECrossCuts[8] = 0.98 ; fExoECrossCuts[9] = 0.99 ;
2872 //___________________________________________________________________________________
2873 Bool_t AliAnaCalorimeterQA::IsGoodCluster(const Int_t absIdMax, AliVCaloCells* cells)
2875 //Identify cluster as exotic or not
2877 if(!fStudyBadClusters) return kTRUE;
2879 if(fCalorimeter=="EMCAL")
2881 if(!GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster())
2883 return !( GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(absIdMax,cells,(GetReader()->GetInputEvent())->GetBunchCrossNumber()) );
2892 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
2893 GetCaloUtils()->RecalibrateCellAmplitude(ampMax, fCalorimeter, absIdMax);
2895 if(ampMax < 0.01) return kFALSE;
2897 if(1-GetECross(absIdMax,cells)/ampMax > 0.95) return kFALSE;
2903 //_________________________________________________________
2904 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
2906 //Print some relevant parameters set for the analysis
2910 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2911 AliAnaCaloTrackCorrBaseClass::Print(" ");
2913 printf("Select Calorimeter %s \n",fCalorimeter.Data());
2914 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2915 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
2916 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
2920 //_____________________________________________________
2921 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
2923 //Fill Calorimeter QA histograms
2925 //Play with the MC stack if available
2926 if(IsDataMC()) MCHistograms();
2928 //Get List with CaloClusters
2929 TObjArray * caloClusters = NULL;
2930 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
2931 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
2933 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
2935 // Do not do anything if there are no clusters
2936 if(caloClusters->GetEntriesFast() == 0) return;
2938 //Get List with CaloCells
2939 AliVCaloCells * cells = 0x0;
2940 if(fCalorimeter == "PHOS") cells = GetPHOSCells();
2941 else cells = GetEMCALCells();
2943 if(!caloClusters || !cells) {
2944 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters or CaloCells available\n"));
2945 return; // trick coverity
2948 //printf("QA: N cells %d, N clusters %d \n",cells->GetNumberOfCells(),caloClusters->GetEntriesFast());
2950 // Correlate Calorimeters and V0 and track Multiplicity
2951 if(fCorrelate) Correlate();
2954 ClusterLoopHistograms(caloClusters,cells);
2957 CellHistograms(cells);
2960 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
2964 //______________________________________
2965 void AliAnaCalorimeterQA::MCHistograms()
2967 //Get the MC arrays and do some checks before filling MC histograms
2969 TLorentzVector mom ;
2971 if(GetReader()->ReadStack()){
2974 AliFatal("Stack not available, is the MC handler called?\n");
2976 //Fill some pure MC histograms, only primaries.
2977 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++)
2978 {//Only primary particles, for all MC transport put GetNtrack()
2979 TParticle *primary = GetMCStack()->Particle(i) ;
2981 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
2982 primary->Momentum(mom);
2983 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
2986 else if(GetReader()->ReadAODMCParticles()){
2988 if(!GetReader()->GetAODMCParticles(0))
2989 AliFatal("AODMCParticles not available!");
2991 //Fill some pure MC histograms, only primaries.
2992 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++)
2994 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
2996 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
2998 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
2999 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
3005 //_______________________________________________________________________________
3006 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg)
3008 //Fill pure monte carlo related histograms
3010 Float_t eMC = mom.E();
3011 Float_t phiMC = mom.Phi();
3013 phiMC += TMath::TwoPi();
3014 Float_t etaMC = mom.Eta();
3016 if (TMath::Abs(etaMC) > 1) return;
3020 //Rough stimate of acceptance for pi0, Eta and electrons
3021 if(fCalorimeter == "PHOS")
3023 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
3025 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
3028 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
3030 if(GetEMCALGeometry())
3033 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(mom.Eta(),mom.Phi(),absID);
3038 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s Real acceptance? %d\n",fCalorimeter.Data(),in);
3042 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
3044 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
3050 fhGenMCE[kmcPhoton] ->Fill(eMC);
3051 if(eMC > 0.5) fhGenMCEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
3054 fhGenMCAccE[kmcPhoton] ->Fill(eMC);
3055 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
3060 fhGenMCE[kmcPi0] ->Fill(eMC);
3061 if(eMC > 0.5) fhGenMCEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
3064 fhGenMCAccE[kmcPi0] ->Fill(eMC);
3065 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
3070 fhGenMCE[kmcEta] ->Fill(eMC);
3071 if(eMC > 0.5) fhGenMCEtaPhi[kmcEta]->Fill(etaMC,phiMC);
3074 fhGenMCAccE[kmcEta] ->Fill(eMC);
3075 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcEta]->Fill(etaMC,phiMC);
3078 else if (TMath::Abs(pdg)==11)
3080 fhGenMCE[kmcElectron] ->Fill(eMC);
3081 if(eMC > 0.5) fhGenMCEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3084 fhGenMCAccE[kmcElectron] ->Fill(eMC);
3085 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3090 //_________________________________________________________________________________
3091 void AliAnaCalorimeterQA::WeightHistograms(AliVCluster *clus, AliVCaloCells* cells)
3093 // Calculate weights
3095 // First recalculate energy in case non linearity was applied
3098 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3100 Int_t id = clus->GetCellsAbsId()[ipos];
3102 //Recalibrate cell energy if needed
3103 Float_t amp = cells->GetCellAmplitude(id);
3104 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3115 printf("AliAnaCalorimeterQA::WeightHistograms()- Wrong calculated energy %f\n",energy);
3119 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
3120 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
3122 //Get the ratio and log ratio to all cells in cluster
3123 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3125 Int_t id = clus->GetCellsAbsId()[ipos];
3127 //Recalibrate cell energy if needed
3128 Float_t amp = cells->GetCellAmplitude(id);
3129 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3131 fhECellClusterRatio ->Fill(energy,amp/energy);
3132 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
3135 //Recalculate shower shape for different W0
3136 if(fCalorimeter=="EMCAL")
3138 Float_t l0org = clus->GetM02();
3139 Float_t l1org = clus->GetM20();
3140 Float_t dorg = clus->GetDispersion();
3142 for(Int_t iw = 0; iw < 14; iw++){
3143 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
3144 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
3146 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
3147 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
3151 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(clus->GetLabels(),clus->GetNLabels(), GetReader(),0);
3153 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
3154 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
3155 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3156 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3157 fhLambda0ForW0MC[iw][0]->Fill(energy,clus->GetM02());
3158 //fhLambda1ForW0MC[iw][0]->Fill(energy,clus->GetM20());
3160 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
3161 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3162 fhLambda0ForW0MC[iw][1]->Fill(energy,clus->GetM02());
3163 //fhLambda1ForW0MC[iw][1]->Fill(energy,clus->GetM20());
3165 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3166 fhLambda0ForW0MC[iw][2]->Fill(energy,clus->GetM02());
3167 //fhLambda1ForW0MC[iw][2]->Fill(energy,clus->GetM20());
3169 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ){
3170 fhLambda0ForW0MC[iw][3]->Fill(energy,clus->GetM02());
3171 //fhLambda1ForW0MC[iw][3]->Fill(energy,clus->GetM20());
3173 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3174 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) ){
3175 fhLambda0ForW0MC[iw][4]->Fill(energy,clus->GetM02());
3176 //fhLambda1ForW0MC[iw][4]->Fill(energy,clus->GetM20());
3182 // Set the original values back
3183 clus->SetM02(l0org);
3184 clus->SetM20(l1org);
3185 clus->SetDispersion(dorg);