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),
143 fhExoL0ECross(0), fhExoL1ECross(0),
146 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
147 fhRecoMCDeltaE(), fhRecoMCRatioE(),
148 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
151 fhGenMCE(), fhGenMCEtaPhi(),
152 fhGenMCAccE(), fhGenMCAccEtaPhi(),
155 fhEMVxyz(0), fhEMR(0),
156 fhHaVxyz(0), fhHaR(0),
157 fh1EOverP(0), fh2dR(0),
158 fh2EledEdx(0), fh2MatchdEdx(0),
159 fhMCEle1EOverP(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
160 fhMCChHad1EOverP(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
161 fhMCNeutral1EOverP(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0), fh1EOverPR02(0),
162 fhMCEle1EOverPR02(0), fhMCChHad1EOverPR02(0), fhMCNeutral1EOverPR02(0)
167 for(Int_t i =0; i < 14; i++){
168 fhLambda0ForW0[i] = 0;
169 //fhLambda1ForW0[i] = 0;
171 for(Int_t j = 0; j < 5; j++){
172 fhLambda0ForW0MC[i][j] = 0;
173 //fhLambda1ForW0MC[i][j] = 0;
179 fhDeltaIEtaDeltaIPhiE0[0] = 0 ; fhDeltaIEtaDeltaIPhiE2[0] = 0; fhDeltaIEtaDeltaIPhiE6[0] = 0;
180 fhDeltaIEtaDeltaIPhiE0[1] = 0 ; fhDeltaIEtaDeltaIPhiE2[1] = 0; fhDeltaIEtaDeltaIPhiE6[1] = 0;
181 fhDeltaIA[0] = 0 ; fhDeltaIAL0[0] = 0; fhDeltaIAL1[0] = 0;
182 fhDeltaIA[1] = 0 ; fhDeltaIAL0[1] = 0; fhDeltaIAL1[1] = 0;
183 fhDeltaIANCells[0] = 0 ; fhDeltaIANCells[1] = 0;
184 fhDeltaIAMC[0] = 0 ; fhDeltaIAMC[1] = 0;
185 fhDeltaIAMC[2] = 0 ; fhDeltaIAMC[3] = 0;
188 for (Int_t ie = 0; ie < 10 ; ie++)
191 for (Int_t idt = 0; idt < 5 ; idt++)
193 fhExoNCell [ie][idt] = 0;
194 fhExoL0 [ie][idt] = 0;
195 fhExoL1 [ie][idt] = 0;
196 fhExoECross [ie][idt] = 0;
197 fhExoTime [ie][idt] = 0;
198 fhExoL0NCell [ie][idt] = 0;
199 fhExoL1NCell [ie][idt] = 0;
205 for(Int_t i = 0; i < 6; i++){
207 fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
208 fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
209 fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
210 fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
211 fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
212 fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
213 fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
217 //Initialize parameters
221 //____________________________________________________________________________________________________________________________
222 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
223 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
224 const Double_t tmax, Double_t timeAverages[2]
227 //Bad cluster histograms
229 // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
230 // GetReader()->GetEventNumber(), fCalorimeter.Data(),
231 // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
233 fhBadClusterEnergy ->Fill(clus->E());
234 Double_t tof = clus->GetTOF()*1.e9;
235 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
236 fhBadClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
237 fhBadClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
239 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kFALSE);
241 //Clusters in event time differencem bad minus good
243 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
245 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
247 if(clus->GetID()==clus2->GetID()) continue;
249 Float_t maxCellFraction2 = 0.;
250 Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
251 if(IsGoodCluster(absIdMax2,cells)){
252 Double_t tof2 = clus2->GetTOF()*1.e9;
253 fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2));
258 // Max cell compared to other cells in cluster
259 if(fFillAllCellTimeHisto)
261 fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
262 fhBadClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
265 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
267 Int_t absId = clus->GetCellsAbsId()[ipos];
268 if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
270 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
272 fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
273 fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
275 if(fFillAllCellTimeHisto)
277 Double_t time = cells->GetCellTime(absId);
278 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
280 Float_t diff = (tmax-time*1e9);
281 fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
289 //______________________________________________________________________
290 void AliAnaCalorimeterQA::CalculateAverageTime(AliVCluster *clus,
291 AliVCaloCells* cells,
292 Double_t timeAverages[2])
294 // Calculate time averages and weights
296 // First recalculate energy in case non linearity was applied
298 Float_t ampMax = 0, amp = 0;
300 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
302 Int_t id = clus->GetCellsAbsId()[ipos];
304 //Recalibrate cell energy if needed
305 amp = cells->GetCellAmplitude(id);
306 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
318 // Calculate average time of cells in cluster and weighted average
325 Int_t ncells = clus->GetNCells();
326 for (Int_t ipos = 0; ipos < ncells; ipos++)
328 id = clus ->GetCellsAbsId()[ipos];
329 amp = cells->GetCellAmplitude(id);
330 time = cells->GetCellTime(id);
332 //Recalibrate energy and time
333 GetCaloUtils()->RecalibrateCellAmplitude(amp , fCalorimeter, id);
334 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
336 w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
338 wTime += time*1e9 * w;
343 if(ncells > 0) aTime /= ncells;
346 if(wTot > 0) wTime /= wTot;
349 timeAverages[0] = aTime;
350 timeAverages[1] = wTime;
354 //____________________________________________________________
355 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
357 // Plot histograms related to cells only
359 Int_t ncells = cells->GetNumberOfCells();
362 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", fCalorimeter.Data(), ncells );
364 //Init arrays and used variables
365 Int_t *nCellsInModule = new Int_t[fNModules];
366 for(Int_t imod = 0; imod < fNModules; imod++ ) nCellsInModule[imod] = 0;
375 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
377 for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++) {
379 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell));
380 Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),fCalorimeter, icol, irow, iRCU);
382 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
384 if(nModule < fNModules)
386 //Check if the cell is a bad channel
387 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn()){
388 if(fCalorimeter=="EMCAL")
390 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
394 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
396 } // use bad channel map
398 amp = cells->GetAmplitude(iCell)*recalF;
399 time = cells->GetTime(iCell);
400 id = cells->GetCellNumber(iCell);
402 // Amplitude recalibration if set
403 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
405 // Time recalibration if set
406 GetCaloUtils()->RecalibrateCellTime (time, fCalorimeter, id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
408 //Transform time to ns
411 if(time < fTimeCutMin || time > fTimeCutMax)
414 printf("AliAnaCalorimeterQA - Remove cell with Time %f\n",time);
418 // Remove exotic cells, defined only for EMCAL
419 if(fCalorimeter=="EMCAL" &&
420 GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
423 fhAmplitude->Fill(amp);
424 fhAmpId ->Fill(amp,id);
425 fhAmpMod ->Fill(amp,nModule);
427 if ((fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ||
428 (fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin ) )
431 //E cross for exotic cells
432 if(amp > 0.01) fhCellECross->Fill(amp,1-GetECross(id,cells)/amp);
434 nCellsInModule[nModule]++ ;
439 if(fCalorimeter=="EMCAL")
441 icols = (nModule % 2) ? icol + fNMaxCols : icol;
443 irows = irow + fNMaxRows * Int_t(nModule / 2);
445 irows = irow + (fNMaxRows / 3) * Int_t(nModule / 2);
449 irows = irow + fNMaxRows * nModule;
452 fhGridCells ->Fill(icols,irows);
453 fhGridCellsE->Fill(icols,irows,amp);
455 if(fFillAllCellTimeHisto)
457 //printf("%s: time %g\n",fCalorimeter.Data(), time);
459 Double_t v[3] = {0,0,0}; //vertex ;
460 GetReader()->GetVertex(v);
461 if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]),time);
464 fhTimeId ->Fill(time,id);
465 fhTimeAmp ->Fill(amp,time);
466 fhGridCellsTime->Fill(icols,irows,time);
467 fhTimeMod ->Fill(time,nModule);
468 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
473 //Get Eta-Phi position of Cell
476 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
477 Float_t celleta = 0.;
478 Float_t cellphi = 0.;
479 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
481 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
482 Double_t cellpos[] = {0, 0, 0};
483 GetEMCALGeometry()->GetGlobal(id, cellpos);
484 fhXCellE->Fill(cellpos[0],amp) ;
485 fhYCellE->Fill(cellpos[1],amp) ;
486 fhZCellE->Fill(cellpos[2],amp) ;
487 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
488 fhRCellE->Fill(rcell,amp) ;
489 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
491 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
493 Int_t relId[4], module;
494 Float_t xCell, zCell;
496 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
498 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
499 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
500 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
501 fhXCellE ->Fill(xyz.X(),amp) ;
502 fhYCellE ->Fill(xyz.Y(),amp) ;
503 fhZCellE ->Fill(xyz.Z(),amp) ;
504 fhRCellE ->Fill(rcell ,amp) ;
505 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
507 }//fill cell position histograms
509 if (fCalorimeter=="EMCAL" && amp > fEMCALCellAmpMin) ncells ++ ;
510 else if(fCalorimeter=="PHOS" && amp > fPHOSCellAmpMin) ncells ++ ;
512 // printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - no %s CELLS passed the analysis cut\n",fCalorimeter.Data());
516 if(ncells > 0 )fhNCells->Fill(ncells) ; //fill the cells after the cut
518 //Number of cells per module
519 for(Int_t imod = 0; imod < fNModules; imod++ ) {
522 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, fCalorimeter.Data(), nCellsInModule[imod]);
524 fhNCellsMod->Fill(nCellsInModule[imod],imod) ;
528 delete [] nCellsInModule;
532 //__________________________________________________________________________
533 void AliAnaCalorimeterQA::CellInClusterPositionHistograms(AliVCluster* clus)
535 // Fill histograms releated to cell position
538 Int_t nCaloCellsPerCluster = clus->GetNCells();
539 UShort_t * indexList = clus->GetCellsAbsId();
541 clus->GetPosition(pos);
542 Float_t clEnergy = clus->E();
544 //Loop on cluster cells
545 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++) {
547 // printf("Index %d\n",ipos);
548 Int_t absId = indexList[ipos];
550 //Get position of cell compare to cluster
552 if(fCalorimeter=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
554 Double_t cellpos[] = {0, 0, 0};
555 GetEMCALGeometry()->GetGlobal(absId, cellpos);
557 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
558 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
559 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
561 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],clEnergy) ;
562 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],clEnergy) ;
563 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],clEnergy) ;
565 Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
566 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
568 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
569 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
571 }//EMCAL and its matrices are available
572 else if(fCalorimeter=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
574 Int_t relId[4], module;
575 Float_t xCell, zCell;
577 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
579 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
580 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
582 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
583 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
584 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
586 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),clEnergy) ;
587 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),clEnergy) ;
588 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),clEnergy) ;
590 Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
591 Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
593 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
594 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
596 }//PHOS and its matrices are available
597 }// cluster cell loop
600 //___________________________________________________________________________________________
601 void AliAnaCalorimeterQA::ClusterAsymmetryHistograms(AliVCluster* clus, const Int_t absIdMax,
602 const Bool_t goodCluster)
604 // Study the shape of the cluster in cell units terms
606 //No use to study clusters with less than 4 cells
607 if(clus->GetNCells() <=3 ) return;
612 Int_t ietaMax=-1; Int_t iphiMax = 0; Int_t rcuMax = 0;
613 Int_t smMax = GetModuleNumberCellIndexes(absIdMax,fCalorimeter, ietaMax, iphiMax, rcuMax);
615 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++) {
617 Int_t absId = clus->GetCellsAbsId()[ipos];
619 Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
620 Int_t sm = GetModuleNumberCellIndexes(absId,fCalorimeter, ieta, iphi, rcu);
622 if(dIphi < TMath::Abs(iphi-iphiMax)) dIphi = TMath::Abs(iphi-iphiMax);
625 if(dIeta < TMath::Abs(ieta-ietaMax)) dIeta = TMath::Abs(ieta-ietaMax);
628 Int_t ietaShift = ieta;
629 Int_t ietaMaxShift = ietaMax;
630 if (ieta > ietaMax) ietaMaxShift+=48;
632 if(dIeta < TMath::Abs(ietaShift-ietaMaxShift)) dIeta = TMath::Abs(ietaShift-ietaMaxShift);
635 }// fill cell-cluster histogram loop
638 Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
643 // Was cluster matched?
644 Bool_t matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(),GetReader()->GetInputEvent());
646 if (clus->E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta,dIphi);
647 else if(clus->E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta,dIphi);
648 else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta,dIphi);
650 fhDeltaIA[matched]->Fill(clus->E(),dIA);
654 fhDeltaIAL0[matched] ->Fill(clus->GetM02(),dIA);
655 fhDeltaIAL1[matched] ->Fill(clus->GetM20(),dIA);
656 fhDeltaIANCells[matched]->Fill(clus->GetNCells(),dIA);
660 // Origin of clusters
661 Int_t nLabel = clus->GetNLabels();
662 Int_t* labels = clus->GetLabels();
664 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),0);
665 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
666 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
667 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
668 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
669 fhDeltaIAMC[0]->Fill(clus->E(),dIA);//Pure Photon
671 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
672 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
673 fhDeltaIAMC[1]->Fill(clus->E(),dIA);//Pure electron
675 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
676 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
677 fhDeltaIAMC[2]->Fill(clus->E(),dIA);//Converted cluster
679 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
680 fhDeltaIAMC[3]->Fill(clus->E(),dIA);//Hadrons
687 if (clus->E() < 2 ) fhBadClusterDeltaIEtaDeltaIPhiE0->Fill(dIeta,dIphi);
688 else if(clus->E() < 6 ) fhBadClusterDeltaIEtaDeltaIPhiE2->Fill(dIeta,dIphi);
689 else fhBadClusterDeltaIEtaDeltaIPhiE6->Fill(dIeta,dIphi);
691 fhBadClusterDeltaIA->Fill(clus->E(),dIA);
696 //_________________________________________________________________________________________________________________________
697 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus,const TObjArray *caloClusters, AliVCaloCells * cells,
698 const Int_t absIdMax, const Double_t maxCellFraction, const Float_t eCrossFrac,
699 const Double_t tmax, Double_t timeAverages[2])
701 //Fill CaloCluster related histograms
703 Double_t tof = clus->GetTOF()*1.e9;
705 fhLambda0 ->Fill(clus->E(),clus->GetM02());
706 fhLambda1 ->Fill(clus->E(),clus->GetM20());
707 fhDispersion ->Fill(clus->E(),clus->GetDispersion());
709 fhClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
710 fhClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
711 fhClusterTimeEnergy ->Fill(clus->E(),tof);
713 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kTRUE);
715 //Clusters in event time difference
716 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ ){
718 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
720 if(clus->GetID()==clus2->GetID()) continue;
722 if(clus->GetM02() > 0.01 && clus2->GetM02() > 0.01)
724 Double_t tof2 = clus2->GetTOF()*1.e9;
725 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2);
729 Int_t nModule = GetModuleNumber(clus);
730 Int_t nCaloCellsPerCluster = clus->GetNCells();
732 if(nCaloCellsPerCluster > 1){
734 // check time of cells respect to max energy cell
736 if(fFillAllCellTimeHisto)
738 fhClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
739 fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
742 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
744 Int_t absId = clus->GetCellsAbsId()[ipos];
745 if(absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01) continue;
747 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
748 fhClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
749 fhClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
751 if(fFillAllCellTimeHisto)
753 Double_t time = cells->GetCellTime(absId);
754 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
756 Float_t diff = (tmax-time*1.0e9);
757 fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
758 if(TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId);
761 }// fill cell-cluster histogram loop
763 }//check time and energy of cells respect to max energy cell if cluster of more than 1 cell
766 // Get vertex for photon momentum calculation and event selection
767 Double_t v[3] = {0,0,0}; //vertex ;
768 //GetReader()->GetVertex(v); //
771 clus->GetMomentum(mom,v);
774 Float_t pt = mom.Pt();
775 Float_t eta = mom.Eta();
776 Float_t phi = mom.Phi();
777 if(phi < 0) phi +=TMath::TwoPi();
780 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
784 if(nModule >=0 && nModule < fNModules) fhEMod->Fill(e,nModule);
792 fhEtaPhiE->Fill(eta,phi,e);
795 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
798 if(fFillAllPosHisto2){
801 clus->GetPosition(pos);
803 fhXE ->Fill(pos[0],e);
804 fhYE ->Fill(pos[1],e);
805 fhZE ->Fill(pos[2],e);
807 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
809 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
810 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
811 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
812 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
814 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
817 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
821 //____________________________________________________________________________
822 void AliAnaCalorimeterQA::ClusterLoopHistograms(const TObjArray *caloClusters,
823 AliVCaloCells* cells)
825 // Fill clusters related histograms
830 Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
831 Int_t nCaloClustersAccepted = 0 ;
832 Int_t nCaloCellsPerCluster = 0 ;
833 Bool_t matched = kFALSE;
836 // Get vertex for photon momentum calculation and event selection
837 Double_t v[3] = {0,0,0}; //vertex ;
838 //GetReader()->GetVertex(v);
840 Int_t *nClustersInModule = new Int_t[fNModules];
841 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
844 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", fCalorimeter.Data(), nCaloClusters);
846 // Loop over CaloClusters
847 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++){
850 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
851 iclus+1,nCaloClusters,GetReader()->GetDataType());
853 AliVCluster* clus = (AliVCluster*)caloClusters->At(iclus);
855 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
856 Float_t maxCellFraction = 0.;
857 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
859 //Cut on time of clusters
860 Double_t tof = clus->GetTOF()*1.e9;
861 if(tof < fTimeCutMin || tof > fTimeCutMax)
863 if(GetDebug() > 0 )printf("AliAnaCalorimeterQA - Remove cluster with TOF %f\n",tof);
867 // Get cluster kinematics
868 clus->GetMomentum(mom,v);
870 // Check only certain regions
872 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
876 nLabel = clus->GetNLabels();
877 labels = clus->GetLabels();
879 // SuperModule number of cluster
880 nModule = GetModuleNumber(clus);
883 nCaloCellsPerCluster = clus->GetNCells();
885 // Cluster mathed with track?
886 matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
888 // Get some time averages
889 Double_t averTime[4] = {0.,0.,0.,0.};
890 CalculateAverageTime(clus, cells, averTime);
892 //Get time of max cell
893 Double_t tmax = cells->GetCellTime(absIdMax);
894 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
897 // Fill histograms related to single cluster
900 // Fill some histograms before applying the exotic cell / bad map cut
901 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
902 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
904 fhClusterMaxCellDiffNoCut->Fill(clus->E(),maxCellFraction);
906 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
907 GetCaloUtils()->RecalibrateCellAmplitude(ampMax,fCalorimeter, absIdMax);
909 if(fStudyExotic) ExoticHistograms(absIdMax, ampMax, clus, cells);
911 //Check bad clusters if requested and rejection was not on
912 Bool_t goodCluster = IsGoodCluster(absIdMax, cells);
914 Float_t eCrossFrac = 0;
915 if(ampMax > 0.01) eCrossFrac = 1-GetECross(absIdMax,cells)/ampMax;
919 BadClusterHistograms(clus, caloClusters, cells, absIdMax,
920 maxCellFraction, eCrossFrac, tmax, averTime);
924 ClusterHistograms(clus, caloClusters, cells, absIdMax,
925 maxCellFraction, eCrossFrac, tmax, averTime);
927 nCaloClustersAccepted++;
928 nModule = GetModuleNumber(clus);
929 if(nModule >=0 && nModule < fNModules)
931 if (fCalorimeter=="EMCAL" && mom.E() > 2*fEMCALCellAmpMin) nClustersInModule[nModule]++;
932 else if(fCalorimeter=="PHOS" && mom.E() > 2*fPHOSCellAmpMin ) nClustersInModule[nModule]++;
936 if(fStudyWeight) WeightHistograms(clus, cells);
938 // Cells in cluster position
939 if(fFillAllPosHisto) CellInClusterPositionHistograms(clus);
941 // Fill histograms related to single cluster, mc vs data
944 if(IsDataMC() && nLabel > 0 && labels)
945 mcOK = ClusterMCHistograms(mom, matched, labels, nLabel, pdg);
947 // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
948 if( matched && fFillAllTMHisto)
949 ClusterMatchedWithTrackHistograms(clus,mom,mcOK,pdg);
952 // Try to reduce background with a mild shower shape cut and no more than 1 maxima
953 // in cluster and remove low energy clusters
954 if(fFillAllPi0Histo && nCaloClusters > 1 && nCaloCellsPerCluster > 1 &&
955 GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1 &&
956 clus->GetM02() < 0.5 && clus->E() > 0.3)
957 InvariantMassHistograms(iclus, mom, nModule, caloClusters,cells);
961 // Number of clusters histograms
962 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
964 // Number of clusters per module
965 for(Int_t imod = 0; imod < fNModules; imod++ )
968 printf("AliAnaCalorimeterQA::ClusterLoopHistograms() - module %d calo %s clusters %d\n", imod, fCalorimeter.Data(), nClustersInModule[imod]);
969 fhNClustersMod->Fill(nClustersInModule[imod],imod);
972 delete [] nClustersInModule;
976 //______________________________________________________________________________________________________
977 Bool_t AliAnaCalorimeterQA::ClusterMCHistograms(const TLorentzVector mom, const Bool_t matched,
978 const Int_t * labels, const Int_t nLabels, Int_t & pdg )
981 //Fill histograms only possible when simulation
983 if(!labels || nLabels<=0)
985 if(GetDebug() > 1) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Strange, labels array %p, n labels %d \n", labels,nLabels);
991 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Primaries: nlabels %d\n",nLabels);
995 Float_t eta = mom.Eta();
996 Float_t phi = mom.Phi();
997 if(phi < 0) phi +=TMath::TwoPi();
999 AliAODMCParticle * aodprimary = 0x0;
1000 TParticle * primary = 0x0;
1002 //Play with the MC stack if available
1003 Int_t label = labels[0];
1007 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** bad label ***: label %d \n", label);
1011 Int_t pdg0 =-1;Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1012 Float_t vxMC= 0; Float_t vyMC = 0;
1013 Float_t eMC = 0; Float_t ptMC= 0; Float_t phiMC =0; Float_t etaMC = 0;
1017 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),0);
1019 if ( GetReader()->ReadStack() &&
1020 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1021 { //it MC stack and known tag
1023 if( label >= GetMCStack()->GetNtrack())
1025 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1029 primary = GetMCStack()->Particle(label);
1031 pdg0 = TMath::Abs(primary->GetPdgCode());
1033 status = primary->GetStatusCode();
1034 vxMC = primary->Vx();
1035 vyMC = primary->Vy();
1036 iParent = primary->GetFirstMother();
1040 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Cluster most contributing mother: \n");
1041 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1044 //Get final particle, no conversion products
1045 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1048 primary = GetMCStack()->Particle(iParent);
1049 pdg = TMath::Abs(primary->GetPdgCode());
1051 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Converted cluster!. Find before conversion: \n");
1053 while((pdg == 22 || pdg == 11) && status != 1)
1055 Int_t iMotherOrg = iMother;
1057 primary = GetMCStack()->Particle(iMother);
1058 status = primary->GetStatusCode();
1059 pdg = TMath::Abs(primary->GetPdgCode());
1060 iParent = primary->GetFirstMother();
1062 // If gone too back and non stable, assign the decay photon/electron
1063 // there are other possible decays, ignore them for the moment
1064 if(pdg==111 || pdg==221)
1066 primary = GetMCStack()->Particle(iMotherOrg);
1077 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1082 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1083 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1088 //Overlapped pi0 (or eta, there will be very few), get the meson
1089 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1090 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1092 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1094 while(pdg != 111 && pdg != 221)
1096 //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMCStack()->Particle(iParent)->GetPdgCode());
1098 primary = GetMCStack()->Particle(iMother);
1099 status = primary->GetStatusCode();
1100 pdg = TMath::Abs(primary->GetPdgCode());
1101 iParent = primary->GetFirstMother();
1103 if( iParent < 0 )break;
1105 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1109 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1114 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1115 primary->GetName(),iMother);
1118 eMC = primary->Energy();
1119 ptMC = primary->Pt();
1120 phiMC = primary->Phi();
1121 etaMC = primary->Eta();
1122 pdg = TMath::Abs(primary->GetPdgCode());
1123 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1126 else if( GetReader()->ReadAODMCParticles() &&
1127 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1128 {//it MC AOD and known tag
1129 //Get the list of MC particles
1130 if(!GetReader()->GetAODMCParticles(0))
1131 AliFatal("MCParticles not available!");
1133 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(label);
1135 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1137 status = aodprimary->IsPrimary();
1138 vxMC = aodprimary->Xv();
1139 vyMC = aodprimary->Yv();
1140 iParent = aodprimary->GetMother();
1144 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1145 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1146 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1149 //Get final particle, no conversion products
1150 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1153 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1155 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iParent);
1156 pdg = TMath::Abs(aodprimary->GetPdgCode());
1157 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary())
1159 Int_t iMotherOrg = iMother;
1161 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1162 status = aodprimary->IsPrimary();
1163 iParent = aodprimary->GetMother();
1164 pdg = TMath::Abs(aodprimary->GetPdgCode());
1166 // If gone too back and non stable, assign the decay photon/electron
1167 // there are other possible decays, ignore them for the moment
1168 if(pdg==111 || pdg==221)
1170 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMotherOrg);
1181 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1182 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1187 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1188 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1189 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1194 //Overlapped pi0 (or eta, there will be very few), get the meson
1195 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1196 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1198 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1199 while(pdg != 111 && pdg != 221)
1202 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles(0))->At(iMother);
1203 status = aodprimary->IsPrimary();
1204 iParent = aodprimary->GetMother();
1205 pdg = TMath::Abs(aodprimary->GetPdgCode());
1207 if(iParent < 0 ) break;
1209 if(GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1213 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1218 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1219 aodprimary->GetName(),iMother);
1222 status = aodprimary->IsPrimary();
1223 eMC = aodprimary->E();
1224 ptMC = aodprimary->Pt();
1225 phiMC = aodprimary->Phi();
1226 etaMC = aodprimary->Eta();
1227 pdg = TMath::Abs(aodprimary->GetPdgCode());
1228 charge = aodprimary->Charge();
1232 //Float_t vz = primary->Vz();
1233 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1234 if((pdg == 22 || TMath::Abs(pdg)==11) && status!=1)
1236 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1237 fhEMR ->Fill(e,rVMC);
1240 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1241 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1242 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1244 //Overlapped pi0 (or eta, there will be very few)
1245 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0))
1247 fhRecoMCE [kmcPi0][matched] ->Fill(e,eMC);
1248 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPi0][(matched)]->Fill(eta,etaMC);
1249 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPi0][(matched)]->Fill(phi,phiMC);
1250 if(eMC > 0) fhRecoMCRatioE [kmcPi0][(matched)]->Fill(e,e/eMC);
1251 fhRecoMCDeltaE [kmcPi0][(matched)]->Fill(e,eMC-e);
1252 fhRecoMCDeltaPhi[kmcPi0][(matched)]->Fill(e,phiMC-phi);
1253 fhRecoMCDeltaEta[kmcPi0][(matched)]->Fill(e,etaMC-eta);
1254 }//Overlapped pizero decay
1255 else if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1257 fhRecoMCE [kmcEta][(matched)] ->Fill(e,eMC);
1258 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcEta][(matched)]->Fill(eta,etaMC);
1259 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcEta][(matched)]->Fill(phi,phiMC);
1260 if(eMC > 0) fhRecoMCRatioE [kmcEta][(matched)]->Fill(e,e/eMC);
1261 fhRecoMCDeltaE [kmcEta][(matched)]->Fill(e,eMC-e);
1262 fhRecoMCDeltaPhi[kmcEta][(matched)]->Fill(e,phiMC-phi);
1263 fhRecoMCDeltaEta[kmcEta][(matched)]->Fill(e,etaMC-eta);
1264 }//Overlapped eta decay
1265 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
1266 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1268 fhRecoMCE [kmcPhoton][(matched)] ->Fill(e,eMC);
1269 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcPhoton][(matched)]->Fill(eta,etaMC);
1270 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcPhoton][(matched)]->Fill(phi,phiMC);
1271 if(eMC > 0) fhRecoMCRatioE [kmcPhoton][(matched)]->Fill(e,e/eMC);
1273 fhRecoMCDeltaE [kmcPhoton][(matched)]->Fill(e,eMC-e);
1274 fhRecoMCDeltaPhi[kmcPhoton][(matched)]->Fill(e,phiMC-phi);
1275 fhRecoMCDeltaEta[kmcPhoton][(matched)]->Fill(e,etaMC-eta);
1277 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
1278 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1280 fhRecoMCE [kmcElectron][(matched)] ->Fill(e,eMC);
1281 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcElectron][(matched)]->Fill(eta,etaMC);
1282 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcElectron][(matched)]->Fill(phi,phiMC);
1283 if(eMC > 0) fhRecoMCRatioE [kmcElectron][(matched)]->Fill(e,e/eMC);
1284 fhRecoMCDeltaE [kmcElectron][(matched)]->Fill(e,eMC-e);
1285 fhRecoMCDeltaPhi[kmcElectron][(matched)]->Fill(e,phiMC-phi);
1286 fhRecoMCDeltaEta[kmcElectron][(matched)]->Fill(e,etaMC-eta);
1287 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1288 fhEMR ->Fill(e,rVMC);
1290 else if(charge == 0)
1292 fhRecoMCE [kmcNeHadron][(matched)] ->Fill(e,eMC);
1293 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcNeHadron][(matched)]->Fill(eta,etaMC);
1294 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcNeHadron][(matched)]->Fill(phi,phiMC);
1295 if(eMC > 0) fhRecoMCRatioE [kmcNeHadron][(matched)]->Fill(e,e/eMC);
1296 fhRecoMCDeltaE [kmcNeHadron][(matched)]->Fill(e,eMC-e);
1297 fhRecoMCDeltaPhi[kmcNeHadron][(matched)]->Fill(e,phiMC-phi);
1298 fhRecoMCDeltaEta[kmcNeHadron][(matched)]->Fill(e,etaMC-eta);
1299 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1300 fhHaR ->Fill(e,rVMC);
1304 fhRecoMCE [kmcChHadron][(matched)] ->Fill(e,eMC);
1305 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[kmcChHadron][(matched)]->Fill(eta,etaMC);
1306 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[kmcChHadron][(matched)]->Fill(phi,phiMC);
1307 if(eMC > 0) fhRecoMCRatioE [kmcChHadron][(matched)]->Fill(e,e/eMC);
1308 fhRecoMCDeltaE [kmcChHadron][(matched)]->Fill(e,eMC-e);
1309 fhRecoMCDeltaPhi[kmcChHadron][(matched)]->Fill(e,phiMC-phi);
1310 fhRecoMCDeltaEta[kmcChHadron][(matched)]->Fill(e,etaMC-eta);
1311 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1312 fhHaR ->Fill(e,rVMC);
1315 if(primary || aodprimary) return kTRUE ;
1320 //________________________________________________________________________________________________
1321 void AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(AliVCluster *clus, TLorentzVector mom,
1322 const Bool_t okPrimary, const Int_t pdg)
1324 //Histograms for clusters matched with tracks
1326 Float_t e = mom.E();
1327 Float_t pt = mom.Pt();
1328 Float_t eta = mom.Eta();
1329 Float_t phi = mom.Phi();
1330 if(phi < 0) phi +=TMath::TwoPi();
1334 fhECharged ->Fill(e);
1335 fhPtCharged ->Fill(pt);
1336 fhPhiCharged ->Fill(phi);
1337 fhEtaCharged ->Fill(eta);
1340 //Study the track and matched cluster if track exists.
1342 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
1346 Double_t tpt = track->Pt();
1347 Double_t tmom = track->P();
1348 Double_t dedx = track->GetTPCsignal();
1349 Int_t nITS = track->GetNcls(0);
1350 Int_t nTPC = track->GetNcls(1);
1353 Float_t deta = clus->GetTrackDz();
1354 Float_t dphi = clus->GetTrackDx();
1355 Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
1357 Double_t eOverP = e/tmom;
1359 fh1EOverP->Fill(tpt, eOverP);
1360 if(dR < 0.02) fh1EOverPR02->Fill(tpt,eOverP);
1363 fh2MatchdEdx->Fill(tmom,dedx);
1365 if(IsDataMC() && okPrimary)
1367 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1369 if(TMath::Abs(pdg) == 11)
1371 fhMCEle1EOverP->Fill(tpt,eOverP);
1372 fhMCEle1dR->Fill(dR);
1373 fhMCEle2MatchdEdx->Fill(tmom,dedx);
1374 if(dR < 0.02) fhMCEle1EOverPR02->Fill(tpt,eOverP);
1378 fhMCChHad1EOverP->Fill(tpt,eOverP);
1379 fhMCChHad1dR->Fill(dR);
1380 fhMCChHad2MatchdEdx->Fill(tmom,dedx);
1381 if(dR < 0.02) fhMCChHad1EOverPR02->Fill(tpt,eOverP);
1383 else if(charge == 0)
1385 fhMCNeutral1EOverP->Fill(tpt,eOverP);
1386 fhMCNeutral1dR->Fill(dR);
1387 fhMCNeutral2MatchdEdx->Fill(tmom,dedx);
1388 if(dR < 0.02) fhMCNeutral1EOverPR02->Fill(tpt,eOverP);
1392 if(dR < 0.02 && eOverP > 0.6 && eOverP< 1.2
1393 && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20)
1395 fh2EledEdx->Fill(tmom,dedx);
1400 //___________________________________
1401 void AliAnaCalorimeterQA::Correlate()
1403 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
1406 TObjArray * caloClustersEMCAL = GetEMCALClusters();
1407 TObjArray * caloClustersPHOS = GetPHOSClusters();
1409 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
1410 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
1412 Float_t sumClusterEnergyEMCAL = 0;
1413 Float_t sumClusterEnergyPHOS = 0;
1415 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1416 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
1417 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1418 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
1423 AliVCaloCells * cellsEMCAL = GetEMCALCells();
1424 AliVCaloCells * cellsPHOS = GetPHOSCells();
1426 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
1427 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
1429 Float_t sumCellEnergyEMCAL = 0;
1430 Float_t sumCellEnergyPHOS = 0;
1432 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1433 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1434 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1435 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1439 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
1440 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1441 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
1442 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1444 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
1445 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
1446 Int_t trM = GetTrackMultiplicity();
1447 if(fCalorimeter=="PHOS"){
1448 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
1449 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
1450 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
1451 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
1453 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
1454 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
1455 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
1456 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
1458 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
1459 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
1460 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
1461 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
1464 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
1465 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
1466 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
1467 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
1469 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
1470 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
1471 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
1472 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
1474 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
1475 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
1476 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
1477 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
1482 printf("AliAnaCalorimeterQA::Correlate(): \n");
1483 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1484 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1485 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1486 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
1487 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
1492 //__________________________________________________
1493 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
1495 //Save parameters used for analysis
1496 TString parList ; //this will be list of parameters used for this analysis.
1497 const Int_t buffersize = 255;
1498 char onePar[buffersize] ;
1500 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
1502 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1504 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
1506 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
1508 //Get parameters set in base class.
1509 //parList += GetBaseParametersList() ;
1511 //Get parameters set in FiducialCut class (not available yet)
1512 //parlist += GetFidCut()->GetFidCutParametersList()
1514 return new TObjString(parList) ;
1517 //___________________________________________________________________________________
1518 void AliAnaCalorimeterQA::ExoticHistograms(const Int_t absIdMax, const Float_t ampMax,
1519 AliVCluster *clus, AliVCaloCells* cells)
1521 // Calculate weights
1525 printf("AliAnaCalorimeterQA::ExoticHistograms()- Low amplitude energy %f\n",ampMax);
1529 Float_t l0 = clus->GetM02();
1530 Float_t l1 = clus->GetM20();
1531 Float_t en = clus->E();
1532 Int_t nc = clus->GetNCells();
1533 Double_t tmax = clus->GetTOF()*1.e9; // recalibrated elsewhere
1535 Float_t eCrossFrac = 1-GetECross(absIdMax,cells, 10000000)/ampMax;
1539 fhExoL0ECross->Fill(eCrossFrac,l0);
1540 fhExoL1ECross->Fill(eCrossFrac,l1);
1543 for(Int_t ie = 0; ie < fExoNECrossCuts; ie++)
1545 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1547 eCrossFrac = 1-GetECross(absIdMax,cells, fExoDTimeCuts[idt])/ampMax;
1549 if(eCrossFrac > fExoECrossCuts[ie])
1552 fhExoL0 [ie][idt]->Fill(en,l0 );
1553 fhExoL1 [ie][idt]->Fill(en,l1 );
1554 fhExoTime [ie][idt]->Fill(en,tmax);
1558 fhExoL0NCell[ie][idt]->Fill(nc,l0);
1559 fhExoL1NCell[ie][idt]->Fill(nc,l1);
1562 // Diff time, do for one cut in e cross
1565 for (Int_t icell = 0; icell < clus->GetNCells(); icell++)
1567 Int_t absId = clus->GetCellsAbsId()[icell];
1568 Double_t time = cells->GetCellTime(absId);
1569 GetCaloUtils()->RecalibrateCellTime(time, fCalorimeter, absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1571 Float_t diff = (tmax-time)*1e9;
1572 fhExoDTime[idt]->Fill(en, diff);
1578 fhExoECross[ie][idt]->Fill(en,eCrossFrac);
1579 fhExoNCell [ie][idt]->Fill(en,nc);
1581 } // D time cut loop
1582 } // e cross cut loop
1585 //____________________________________________________
1586 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
1588 // Create histograms to be saved in output file and
1589 // store them in outputContainer
1591 TList * outputContainer = new TList() ;
1592 outputContainer->SetName("QAHistos") ;
1595 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1596 Int_t nfineptbins = GetHistogramRanges()->GetHistoFinePtBins(); Float_t ptfinemax = GetHistogramRanges()->GetHistoFinePtMax(); Float_t ptfinemin = GetHistogramRanges()->GetHistoFinePtMin();
1597 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1598 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1599 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins(); Float_t massmax = GetHistogramRanges()->GetHistoMassMax(); Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
1600 Int_t nasymbins = GetHistogramRanges()->GetHistoAsymmetryBins(); Float_t asymmax = GetHistogramRanges()->GetHistoAsymmetryMax(); Float_t asymmin = GetHistogramRanges()->GetHistoAsymmetryMin();
1601 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins(); Float_t eOverPmax = GetHistogramRanges()->GetHistoPOverEMax(); Float_t eOverPmin = GetHistogramRanges()->GetHistoPOverEMin();
1602 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins(); Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax(); Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1603 Int_t ndRbins = GetHistogramRanges()->GetHistodRBins(); Float_t dRmax = GetHistogramRanges()->GetHistodRMax(); Float_t dRmin = GetHistogramRanges()->GetHistodRMin();
1604 Int_t ntimebins = GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1605 Int_t nclbins = GetHistogramRanges()->GetHistoNClustersBins(); Int_t nclmax = GetHistogramRanges()->GetHistoNClustersMax(); Int_t nclmin = GetHistogramRanges()->GetHistoNClustersMin();
1606 Int_t ncebins = GetHistogramRanges()->GetHistoNCellsBins(); Int_t ncemax = GetHistogramRanges()->GetHistoNCellsMax(); Int_t ncemin = GetHistogramRanges()->GetHistoNCellsMin();
1607 Int_t nceclbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nceclmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nceclmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1608 Int_t nvdistbins = GetHistogramRanges()->GetHistoVertexDistBins(); Float_t vdistmax = GetHistogramRanges()->GetHistoVertexDistMax(); Float_t vdistmin = GetHistogramRanges()->GetHistoVertexDistMin();
1609 Int_t rbins = GetHistogramRanges()->GetHistoRBins(); Float_t rmax = GetHistogramRanges()->GetHistoRMax(); Float_t rmin = GetHistogramRanges()->GetHistoRMin();
1610 Int_t xbins = GetHistogramRanges()->GetHistoXBins(); Float_t xmax = GetHistogramRanges()->GetHistoXMax(); Float_t xmin = GetHistogramRanges()->GetHistoXMin();
1611 Int_t ybins = GetHistogramRanges()->GetHistoYBins(); Float_t ymax = GetHistogramRanges()->GetHistoYMax(); Float_t ymin = GetHistogramRanges()->GetHistoYMin();
1612 Int_t zbins = GetHistogramRanges()->GetHistoZBins(); Float_t zmax = GetHistogramRanges()->GetHistoZMax(); Float_t zmin = GetHistogramRanges()->GetHistoZMin();
1613 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1614 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
1616 Int_t nv0sbins = GetHistogramRanges()->GetHistoV0SignalBins(); Int_t nv0smax = GetHistogramRanges()->GetHistoV0SignalMax(); Int_t nv0smin = GetHistogramRanges()->GetHistoV0SignalMin();
1617 Int_t nv0mbins = GetHistogramRanges()->GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistogramRanges()->GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistogramRanges()->GetHistoV0MultiplicityMin();
1618 Int_t ntrmbins = GetHistogramRanges()->GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistogramRanges()->GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistogramRanges()->GetHistoTrackMultiplicityMin();
1625 if(fCalorimeter=="PHOS")
1632 fhE = new TH1F ("hE","E reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
1633 fhE->SetXTitle("E (GeV)");
1634 outputContainer->Add(fhE);
1638 fhPt = new TH1F ("hPt","p_{T} reconstructed clusters", nptbins,ptmin,ptmax);
1639 fhPt->SetXTitle("p_{T} (GeV/c)");
1640 outputContainer->Add(fhPt);
1642 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
1643 fhPhi->SetXTitle("#phi (rad)");
1644 outputContainer->Add(fhPhi);
1646 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
1647 fhEta->SetXTitle("#eta ");
1648 outputContainer->Add(fhEta);
1653 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
1654 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1655 fhEtaPhiE->SetXTitle("#eta ");
1656 fhEtaPhiE->SetYTitle("#phi (rad)");
1657 fhEtaPhiE->SetZTitle("E (GeV) ");
1658 outputContainer->Add(fhEtaPhiE);
1661 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
1662 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1663 fhClusterTimeEnergy->SetXTitle("E (GeV) ");
1664 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
1665 outputContainer->Add(fhClusterTimeEnergy);
1667 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
1668 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1669 fhClusterPairDiffTimeE->SetXTitle("E_{cluster} (GeV)");
1670 fhClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1671 outputContainer->Add(fhClusterPairDiffTimeE);
1673 fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
1674 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1675 fhLambda0->SetXTitle("E_{cluster}");
1676 fhLambda0->SetYTitle("#lambda^{2}_{0}");
1677 outputContainer->Add(fhLambda0);
1679 fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E for bad cluster ",
1680 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1681 fhLambda1->SetXTitle("E_{cluster}");
1682 fhLambda1->SetYTitle("#lambda^{2}_{1}");
1683 outputContainer->Add(fhLambda1);
1685 fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
1686 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1687 fhDispersion->SetXTitle("E_{cluster}");
1688 fhDispersion->SetYTitle("Dispersion");
1689 outputContainer->Add(fhDispersion);
1691 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1692 nptbins,ptmin,ptmax, 100,0,1.);
1693 fhClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1694 fhClusterMaxCellCloseCellRatio->SetYTitle("E_{cell i}/E_{cell max}");
1695 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
1697 fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1698 nptbins,ptmin,ptmax, 500,0,100.);
1699 fhClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1700 fhClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max}-E_{cell i} (GeV)");
1701 outputContainer->Add(fhClusterMaxCellCloseCellDiff);
1703 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1704 nptbins,ptmin,ptmax, 500,0,1.);
1705 fhClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1706 fhClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1707 outputContainer->Add(fhClusterMaxCellDiff);
1709 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
1710 nptbins,ptmin,ptmax, 500,0,1.);
1711 fhClusterMaxCellDiffNoCut->SetXTitle("E_{cluster} (GeV) ");
1712 fhClusterMaxCellDiffNoCut->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1713 outputContainer->Add(fhClusterMaxCellDiffNoCut);
1715 fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
1716 nptbins,ptmin,ptmax, 400,-1,1.);
1717 fhClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1718 fhClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1719 outputContainer->Add(fhClusterMaxCellECross);
1721 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
1722 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1723 fhNCellsPerClusterNoCut->SetXTitle("E (GeV)");
1724 fhNCellsPerClusterNoCut->SetYTitle("n cells");
1725 outputContainer->Add(fhNCellsPerClusterNoCut);
1727 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1728 fhNCellsPerCluster->SetXTitle("E (GeV)");
1729 fhNCellsPerCluster->SetYTitle("n cells");
1730 outputContainer->Add(fhNCellsPerCluster);
1732 fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
1733 fhNClusters->SetXTitle("number of clusters");
1734 outputContainer->Add(fhNClusters);
1736 if(fStudyBadClusters)
1738 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
1739 fhBadClusterEnergy->SetXTitle("E_{cluster} (GeV) ");
1740 outputContainer->Add(fhBadClusterEnergy);
1742 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
1743 nptbins,ptmin,ptmax, 100,0,1.);
1744 fhBadClusterMaxCellCloseCellRatio->SetXTitle("E_{cluster} (GeV) ");
1745 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
1746 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
1748 fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
1749 nptbins,ptmin,ptmax, 500,0,100);
1750 fhBadClusterMaxCellCloseCellDiff->SetXTitle("E_{cluster} (GeV) ");
1751 fhBadClusterMaxCellCloseCellDiff->SetYTitle("E_{cell max} - E_{cell i} (GeV)");
1752 outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
1754 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
1755 nptbins,ptmin,ptmax, 500,0,1.);
1756 fhBadClusterMaxCellDiff->SetXTitle("E_{cluster} (GeV) ");
1757 fhBadClusterMaxCellDiff->SetYTitle("(E_{cluster} - E_{cell max}) / E_{cluster}");
1758 outputContainer->Add(fhBadClusterMaxCellDiff);
1760 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
1761 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1762 fhBadClusterTimeEnergy->SetXTitle("E_{cluster} (GeV) ");
1763 fhBadClusterTimeEnergy->SetYTitle("TOF (ns)");
1764 outputContainer->Add(fhBadClusterTimeEnergy);
1766 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1767 fhBadClusterPairDiffTimeE->SetXTitle("E_{bad cluster} (GeV)");
1768 fhBadClusterPairDiffTimeE->SetYTitle("#Delta t (ns)");
1769 outputContainer->Add(fhBadClusterPairDiffTimeE);
1771 fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, bad clusters",
1772 nptbins,ptmin,ptmax, 400,-1,1.);
1773 fhBadClusterMaxCellECross->SetXTitle("E_{cluster} (GeV) ");
1774 fhBadClusterMaxCellECross->SetYTitle("1- E_{cross}/E_{cell max}");
1775 outputContainer->Add(fhBadClusterMaxCellECross);
1777 if(fFillAllCellTimeHisto)
1779 fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1780 fhBadCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
1781 fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max - i} (ns)");
1782 outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
1784 fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1785 fhBadClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
1786 fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
1787 outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
1789 fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1790 fhBadClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
1791 fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
1792 outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
1800 fhExoL0ECross = new TH2F("hExoL0_ECross",
1801 "#lambda^{2}_{0} vs 1-E_{+}/E_{max} for E > 5 GeV",
1802 400,0,1,ssbins,ssmin,ssmax);
1803 fhExoL0ECross ->SetXTitle("1-E_{+}/E_{cell max}");
1804 fhExoL0ECross ->SetYTitle("#lambda^{2}_{0}");
1805 outputContainer->Add(fhExoL0ECross) ;
1807 fhExoL1ECross = new TH2F("hExoL1_ECross",
1808 "#lambda^{2}_{1} vs 1-E_{+}/E_{max} for E > 5 GeV",
1809 400,0,1,ssbins,ssmin,ssmax);
1810 fhExoL1ECross ->SetXTitle("1-E_{+}/E_{cell max}");
1811 fhExoL1ECross ->SetYTitle("#lambda^{2}_{1}");
1812 outputContainer->Add(fhExoL1ECross) ;
1814 for(Int_t ie = 0; ie <fExoNECrossCuts; ie++)
1817 fhExoDTime[ie] = new TH2F(Form("hExoDTime_ECross%d",ie),
1818 Form("#Delta time = t_{max}-t_{cells} vs E_{cluster} for exotic, 1-E_{+}/E_{max} < %2.2f",fExoECrossCuts[ie]),
1819 nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
1820 fhExoDTime[ie] ->SetYTitle("#Delta t (ns)");
1821 fhExoDTime[ie] ->SetXTitle("E (GeV)");
1822 outputContainer->Add(fhExoDTime[ie]) ;
1824 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1826 fhExoNCell[ie][idt] = new TH2F(Form("hExoNCell_ECross%d_DT%d",ie,idt),
1827 Form("N cells per cluster vs E cluster, 1-E_{+}/E_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1828 nptbins,ptmin,ptmax,nceclbins,nceclmin,nceclmax);
1829 fhExoNCell[ie][idt] ->SetYTitle("N cells");
1830 fhExoNCell[ie][idt] ->SetXTitle("E (GeV)");
1831 outputContainer->Add(fhExoNCell[ie][idt]) ;
1833 fhExoL0 [ie][idt] = new TH2F(Form("hExoL0_ECross%d_DT%d",ie,idt),
1834 Form("#lambda^{2}_{0} vs E cluster for exotic, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1835 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1836 fhExoL0 [ie][idt] ->SetYTitle("#lambda^{2}_{0}");
1837 fhExoL0 [ie][idt] ->SetXTitle("E (GeV)");
1838 outputContainer->Add(fhExoL0[ie][idt]) ;
1840 fhExoL1 [ie][idt] = new TH2F(Form("hExoL1_ECross%d_DT%d",ie,idt),
1841 Form("#lambda^{2}_{1} vs E cluster for exotic, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1842 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1843 fhExoL1 [ie][idt] ->SetYTitle("#lambda^{2}_{1}");
1844 fhExoL1 [ie][idt] ->SetXTitle("E (GeV)");
1845 outputContainer->Add(fhExoL1[ie][idt]) ;
1847 fhExoECross[ie][idt] = new TH2F(Form("hExoECross_ECross%d_DT%d",ie,idt),
1848 Form("E cross for cells vs E cell, 1-E_{+}/E_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1849 nptbins,ptmin,ptmax,400,0,1);
1850 fhExoECross[ie][idt] ->SetYTitle("1-E_{+}/E_{cell max}");
1851 fhExoECross[ie][idt] ->SetXTitle("E_{cell} (GeV)");
1852 outputContainer->Add(fhExoECross[ie][idt]) ;
1854 fhExoTime [ie][idt] = new TH2F(Form("hExoTime_ECross%d_DT%d",ie,idt),
1855 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]),
1856 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
1857 fhExoTime [ie][idt] ->SetYTitle("time_{max} (ns)");
1858 fhExoTime [ie][idt] ->SetXTitle("E (GeV)");
1859 outputContainer->Add(fhExoTime[ie][idt]) ;
1861 fhExoL0NCell[ie][idt] = new TH2F(Form("hExoL0_NCell%d_DT%d",ie,idt),
1862 Form("#lambda^{2}_{0} vs N cells per clusters for E > 5 GeV, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1863 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
1864 fhExoL0NCell[ie][idt] ->SetYTitle("N cells");
1865 fhExoL0NCell[ie][idt] ->SetXTitle("#lambda^{2}_{0}");
1866 outputContainer->Add(fhExoL0NCell[ie][idt]) ;
1868 fhExoL1NCell[ie][idt] = new TH2F(Form("hExoL1_NCell%d_DT%d",ie,idt),
1869 Form("#lambda^{2}_{1} vs N cells per clusters for E > 5 GeV, 1-E_{+}/E_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1870 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
1871 fhExoL1NCell[ie][idt] ->SetYTitle("N cells");
1872 fhExoL1NCell[ie][idt] ->SetXTitle("#lambda^{2}_{1}");
1873 outputContainer->Add(fhExoL1NCell[ie][idt]) ;
1879 // Cluster size in terms of cells
1880 if(fStudyClustersAsymmetry)
1882 fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1884 fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
1885 fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
1886 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
1888 fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1890 fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
1891 fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
1892 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
1894 fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1896 fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
1897 fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
1898 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
1900 fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
1901 nptbins,ptmin,ptmax,21,-1.05,1.05);
1902 fhDeltaIA[0]->SetXTitle("E_{cluster}");
1903 fhDeltaIA[0]->SetYTitle("A_{cell in cluster}");
1904 outputContainer->Add(fhDeltaIA[0]);
1906 fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
1907 ssbins,ssmin,ssmax,21,-1.05,1.05);
1908 fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
1909 fhDeltaIAL0[0]->SetYTitle("A_{cell in cluster}");
1910 outputContainer->Add(fhDeltaIAL0[0]);
1912 fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
1913 ssbins,ssmin,ssmax,21,-1.05,1.05);
1914 fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
1915 fhDeltaIAL1[0]->SetYTitle("A_{cell in cluster}");
1916 outputContainer->Add(fhDeltaIAL1[0]);
1918 fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
1919 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1920 fhDeltaIANCells[0]->SetXTitle("N_{cell in cluster}");
1921 fhDeltaIANCells[0]->SetYTitle("A_{cell in cluster}");
1922 outputContainer->Add(fhDeltaIANCells[0]);
1925 fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3, matched with track",
1927 fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
1928 fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
1929 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
1931 fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3, matched with track",
1933 fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
1934 fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
1935 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
1937 fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3, matched with track",
1939 fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
1940 fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
1941 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
1943 fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
1944 nptbins,ptmin,ptmax,21,-1.05,1.05);
1945 fhDeltaIA[1]->SetXTitle("E_{cluster}");
1946 fhDeltaIA[1]->SetYTitle("A_{cell in cluster}");
1947 outputContainer->Add(fhDeltaIA[1]);
1949 fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
1950 ssbins,ssmin,ssmax,21,-1.05,1.05);
1951 fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
1952 fhDeltaIAL0[1]->SetYTitle("A_{cell in cluster}");
1953 outputContainer->Add(fhDeltaIAL0[1]);
1955 fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
1956 ssbins,ssmin,ssmax,21,-1.05,1.05);
1957 fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
1958 fhDeltaIAL1[1]->SetYTitle("A_{cell in cluster}");
1959 outputContainer->Add(fhDeltaIAL1[1]);
1961 fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
1962 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
1963 fhDeltaIANCells[1]->SetXTitle("N_{cell in cluster}");
1964 fhDeltaIANCells[1]->SetYTitle("A_{cell in cluster}");
1965 outputContainer->Add(fhDeltaIANCells[1]);
1968 TString particle[]={"Photon","Electron","Conversion","Hadron"};
1969 for (Int_t iPart = 0; iPart < 4; iPart++) {
1971 fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
1972 nptbins,ptmin,ptmax,21,-1.05,1.05);
1973 fhDeltaIAMC[iPart]->SetXTitle("E_{cluster}");
1974 fhDeltaIAMC[iPart]->SetYTitle("A_{cell in cluster}");
1975 outputContainer->Add(fhDeltaIAMC[iPart]);
1979 if(fStudyBadClusters)
1981 fhBadClusterDeltaIEtaDeltaIPhiE0 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, n cells > 3",
1983 fhBadClusterDeltaIEtaDeltaIPhiE0->SetXTitle("#Delta Column");
1984 fhBadClusterDeltaIEtaDeltaIPhiE0->SetYTitle("#Delta Row");
1985 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE0);
1987 fhBadClusterDeltaIEtaDeltaIPhiE2 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, n cells > 3",
1989 fhBadClusterDeltaIEtaDeltaIPhiE2->SetXTitle("#Delta Column");
1990 fhBadClusterDeltaIEtaDeltaIPhiE2->SetYTitle("#Delta Row");
1991 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE2);
1993 fhBadClusterDeltaIEtaDeltaIPhiE6 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, n cells > 3",
1995 fhBadClusterDeltaIEtaDeltaIPhiE6->SetXTitle("#Delta Column");
1996 fhBadClusterDeltaIEtaDeltaIPhiE6->SetYTitle("#Delta Row");
1997 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE6);
1999 fhBadClusterDeltaIA = new TH2F ("hBadClusterDeltaIA"," Cluster *asymmetry* in cell units vs E",
2000 nptbins,ptmin,ptmax,21,-1.05,1.05);
2001 fhBadClusterDeltaIA->SetXTitle("E_{cluster}");
2002 fhBadClusterDeltaIA->SetYTitle("A_{cell in cluster}");
2003 outputContainer->Add(fhBadClusterDeltaIA);
2009 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy",
2010 nptbins,ptmin,ptmax, 100,0,1.);
2011 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
2012 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
2013 outputContainer->Add(fhECellClusterRatio);
2015 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy",
2016 nptbins,ptmin,ptmax, 100,-10,0);
2017 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
2018 fhECellClusterLogRatio->SetYTitle("Log(E_{cell i}/E_{cluster})");
2019 outputContainer->Add(fhECellClusterLogRatio);
2021 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy",
2022 nptbins,ptmin,ptmax, 100,0,1.);
2023 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
2024 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
2025 outputContainer->Add(fhEMaxCellClusterRatio);
2027 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy",
2028 nptbins,ptmin,ptmax, 100,-10,0);
2029 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
2030 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
2031 outputContainer->Add(fhEMaxCellClusterLogRatio);
2033 for(Int_t iw = 0; iw < 14; iw++){
2034 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f",1+0.5*iw),
2035 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2036 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
2037 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
2038 outputContainer->Add(fhLambda0ForW0[iw]);
2040 // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f",1+0.5*iw),
2041 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2042 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
2043 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
2044 // outputContainer->Add(fhLambda1ForW0[iw]);
2047 TString mcnames[] = {"Photon", "Electron","Conversion","Pi0","Hadron"};
2048 for(Int_t imc = 0; imc < 5; imc++){
2049 fhLambda0ForW0MC[iw][imc] = new TH2F (Form("hLambda0ForW0%d_MC%s",iw,mcnames[imc].Data()),
2050 Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
2051 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2052 fhLambda0ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
2053 fhLambda0ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{0}");
2054 outputContainer->Add(fhLambda0ForW0MC[iw][imc]);
2056 // fhLambda1ForW0MC[iw][imc] = new TH2F (Form("hLambda1ForW0%d_MC%s",iw,mcnames[imc].Data()),
2057 // Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for MC %s",1+0.5*iw,mcnames[imc].Data()),
2058 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2059 // fhLambda1ForW0MC[iw][imc]->SetXTitle("E_{cluster}");
2060 // fhLambda1ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{1}");
2061 // outputContainer->Add(fhLambda1ForW0MC[iw][imc]);
2072 fhECharged = new TH1F ("hECharged","E reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2073 fhECharged->SetXTitle("E (GeV)");
2074 outputContainer->Add(fhECharged);
2076 fhPtCharged = new TH1F ("hPtCharged","p_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2077 fhPtCharged->SetXTitle("p_{T} (GeV/c)");
2078 outputContainer->Add(fhPtCharged);
2080 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
2081 fhPhiCharged->SetXTitle("#phi (rad)");
2082 outputContainer->Add(fhPhiCharged);
2084 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
2085 fhEtaCharged->SetXTitle("#eta ");
2086 outputContainer->Add(fhEtaCharged);
2089 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
2090 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2091 fhEtaPhiECharged->SetXTitle("#eta ");
2092 fhEtaPhiECharged->SetYTitle("#phi ");
2093 fhEtaPhiECharged->SetZTitle("E (GeV) ");
2094 outputContainer->Add(fhEtaPhiECharged);
2097 fh1EOverP = new TH2F("h1EOverP","TRACK matches E/p",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2098 fh1EOverP->SetYTitle("E/p");
2099 fh1EOverP->SetXTitle("p_{T} (GeV/c)");
2100 outputContainer->Add(fh1EOverP);
2102 fh2dR = new TH2F("h2dR","TRACK matches dR",nptbins,ptmin,ptmax,ndRbins,dRmin,dRmax);
2103 fh2dR->SetXTitle("#Delta R (rad)");
2104 fh2dR->SetXTitle("E cluster (GeV)");
2105 outputContainer->Add(fh2dR) ;
2107 fh2MatchdEdx = new TH2F("h2MatchdEdx","dE/dx vs. p for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2108 fh2MatchdEdx->SetXTitle("p (GeV/c)");
2109 fh2MatchdEdx->SetYTitle("<dE/dx>");
2110 outputContainer->Add(fh2MatchdEdx);
2112 fh2EledEdx = new TH2F("h2EledEdx","dE/dx vs. p for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2113 fh2EledEdx->SetXTitle("p (GeV/c)");
2114 fh2EledEdx->SetYTitle("<dE/dx>");
2115 outputContainer->Add(fh2EledEdx) ;
2117 fh1EOverPR02 = new TH2F("h1EOverPR02","TRACK matches E/p, all",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2118 fh1EOverPR02->SetYTitle("E/p");
2119 fh1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2120 outputContainer->Add(fh1EOverPR02);
2123 if(fFillAllPi0Histo)
2125 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy, ncell > 1",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2126 fhIM->SetXTitle("p_{T, cluster pairs} (GeV) ");
2127 fhIM->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
2128 outputContainer->Add(fhIM);
2130 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
2131 fhAsym->SetXTitle("p_{T, cluster pairs} (GeV) ");
2132 fhAsym->SetYTitle("Asymmetry");
2133 outputContainer->Add(fhAsym);
2137 if(fFillAllPosHisto2)
2141 fhXYZ = new TH3F ("hXYZ","Cluster: x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2142 fhXYZ->SetXTitle("x (cm)");
2143 fhXYZ->SetYTitle("y (cm)");
2144 fhXYZ->SetZTitle("z (cm) ");
2145 outputContainer->Add(fhXYZ);
2148 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
2149 fhXNCells->SetXTitle("x (cm)");
2150 fhXNCells->SetYTitle("N cells per cluster");
2151 outputContainer->Add(fhXNCells);
2153 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
2154 fhZNCells->SetXTitle("z (cm)");
2155 fhZNCells->SetYTitle("N cells per cluster");
2156 outputContainer->Add(fhZNCells);
2158 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2159 fhXE->SetXTitle("x (cm)");
2160 fhXE->SetYTitle("E (GeV)");
2161 outputContainer->Add(fhXE);
2163 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2164 fhZE->SetXTitle("z (cm)");
2165 fhZE->SetYTitle("E (GeV)");
2166 outputContainer->Add(fhZE);
2168 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
2169 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2170 fhRNCells->SetYTitle("N cells per cluster");
2171 outputContainer->Add(fhRNCells);
2174 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
2175 fhYNCells->SetXTitle("y (cm)");
2176 fhYNCells->SetYTitle("N cells per cluster");
2177 outputContainer->Add(fhYNCells);
2179 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2180 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2181 fhRE->SetYTitle("E (GeV)");
2182 outputContainer->Add(fhRE);
2184 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2185 fhYE->SetXTitle("y (cm)");
2186 fhYE->SetYTitle("E (GeV)");
2187 outputContainer->Add(fhYE);
2190 if(fFillAllPosHisto)
2192 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2193 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2194 fhRCellE->SetYTitle("E (GeV)");
2195 outputContainer->Add(fhRCellE);
2197 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2198 fhXCellE->SetXTitle("x (cm)");
2199 fhXCellE->SetYTitle("E (GeV)");
2200 outputContainer->Add(fhXCellE);
2202 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2203 fhYCellE->SetXTitle("y (cm)");
2204 fhYCellE->SetYTitle("E (GeV)");
2205 outputContainer->Add(fhYCellE);
2207 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2208 fhZCellE->SetXTitle("z (cm)");
2209 fhZCellE->SetYTitle("E (GeV)");
2210 outputContainer->Add(fhZCellE);
2212 fhXYZCell = new TH3F ("hXYZCell","Cell : x vs y vs z",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2213 fhXYZCell->SetXTitle("x (cm)");
2214 fhXYZCell->SetYTitle("y (cm)");
2215 fhXYZCell->SetZTitle("z (cm)");
2216 outputContainer->Add(fhXYZCell);
2219 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
2220 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
2221 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
2222 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
2224 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
2225 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2226 fhDeltaCellClusterRNCells->SetYTitle("N cells per cluster");
2227 outputContainer->Add(fhDeltaCellClusterRNCells);
2229 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
2230 fhDeltaCellClusterXNCells->SetXTitle("x (cm)");
2231 fhDeltaCellClusterXNCells->SetYTitle("N cells per cluster");
2232 outputContainer->Add(fhDeltaCellClusterXNCells);
2234 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
2235 fhDeltaCellClusterYNCells->SetXTitle("y (cm)");
2236 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
2237 outputContainer->Add(fhDeltaCellClusterYNCells);
2239 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
2240 fhDeltaCellClusterZNCells->SetXTitle("z (cm)");
2241 fhDeltaCellClusterZNCells->SetYTitle("N cells per cluster");
2242 outputContainer->Add(fhDeltaCellClusterZNCells);
2244 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
2245 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2246 fhDeltaCellClusterRE->SetYTitle("E (GeV)");
2247 outputContainer->Add(fhDeltaCellClusterRE);
2249 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
2250 fhDeltaCellClusterXE->SetXTitle("x (cm)");
2251 fhDeltaCellClusterXE->SetYTitle("E (GeV)");
2252 outputContainer->Add(fhDeltaCellClusterXE);
2254 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
2255 fhDeltaCellClusterYE->SetXTitle("y (cm)");
2256 fhDeltaCellClusterYE->SetYTitle("E (GeV)");
2257 outputContainer->Add(fhDeltaCellClusterYE);
2259 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
2260 fhDeltaCellClusterZE->SetXTitle("z (cm)");
2261 fhDeltaCellClusterZE->SetYTitle("E (GeV)");
2262 outputContainer->Add(fhDeltaCellClusterZE);
2264 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2265 fhEtaPhiAmp->SetXTitle("#eta ");
2266 fhEtaPhiAmp->SetYTitle("#phi (rad)");
2267 fhEtaPhiAmp->SetZTitle("E (GeV) ");
2268 outputContainer->Add(fhEtaPhiAmp);
2273 fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin+0.5,ncemax);
2274 fhNCells->SetXTitle("n cells");
2275 outputContainer->Add(fhNCells);
2277 fhAmplitude = new TH1F ("hAmplitude","Cell Energy", nptbins*2,ptmin,ptmax);
2278 fhAmplitude->SetXTitle("Cell Energy (GeV)");
2279 outputContainer->Add(fhAmplitude);
2281 fhAmpId = new TH2F ("hAmpId","Cell Energy", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2282 fhAmpId->SetXTitle("Cell Energy (GeV)");
2283 outputContainer->Add(fhAmpId);
2285 if(fFillAllCellTimeHisto)
2287 fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
2288 fhCellTimeSpreadRespectToCellMax->SetXTitle("E (GeV)");
2289 fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta t_{cell max-i} (ns)");
2290 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
2292 fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2293 fhClusterMaxCellDiffAverageTime->SetXTitle("E (GeV)");
2294 fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta t_{cell max - average} (ns)");
2295 outputContainer->Add(fhClusterMaxCellDiffAverageTime);
2297 fhClusterMaxCellDiffWeightedTime = new TH2F ("hClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2298 fhClusterMaxCellDiffWeightedTime->SetXTitle("E (GeV)");
2299 fhClusterMaxCellDiffWeightedTime->SetYTitle("#Delta t_{cell max - weighted} (ns)");
2300 outputContainer->Add(fhClusterMaxCellDiffWeightedTime);
2302 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
2303 fNMaxCols*fNMaxRows*fNModules,0,fNMaxCols*fNMaxRows*fNModules);
2304 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
2305 outputContainer->Add(fhCellIdCellLargeTimeSpread);
2307 fhTime = new TH1F ("hTime","Cell Time",ntimebins,timemin,timemax);
2308 fhTime->SetXTitle("Cell Time (ns)");
2309 outputContainer->Add(fhTime);
2311 fhTimeVz = new TH2F ("hTimeVz","Cell Time vs vertex, amplitude > 0.5 GeV",100, 0, 50,ntimebins,timemin,timemax);
2312 fhTimeVz->SetXTitle("|v_{z}| (cm)");
2313 fhTimeVz->SetYTitle("Cell Time (ns)");
2314 outputContainer->Add(fhTimeVz);
2316 fhTimeId = new TH2F ("hTimeId","Cell Time vs Absolute Id",
2317 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2318 fhTimeId->SetXTitle("Cell Time (ns)");
2319 fhTimeId->SetYTitle("Cell Absolute Id");
2320 outputContainer->Add(fhTimeId);
2322 fhTimeAmp = new TH2F ("hTimeAmp","Cell Time vs Cell Energy",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
2323 fhTimeAmp->SetYTitle("Cell Time (ns)");
2324 fhTimeAmp->SetXTitle("Cell Energy (GeV)");
2325 outputContainer->Add(fhTimeAmp);
2329 fhCellECross = new TH2F ("hCellECross","1 - Energy in cross around cell / cell energy",
2330 nptbins,ptmin,ptmax, 400,-1,1.);
2331 fhCellECross->SetXTitle("E_{cell} (GeV) ");
2332 fhCellECross->SetYTitle("1- E_{cross}/E_{cell}");
2333 outputContainer->Add(fhCellECross);
2339 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2340 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
2341 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
2342 outputContainer->Add(fhCaloCorrNClusters);
2344 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2345 fhCaloCorrEClusters->SetXTitle("#Sigma E of clusters in EMCAL (GeV)");
2346 fhCaloCorrEClusters->SetYTitle("#Sigma E of clusters in PHOS (GeV)");
2347 outputContainer->Add(fhCaloCorrEClusters);
2349 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2350 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
2351 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
2352 outputContainer->Add(fhCaloCorrNCells);
2354 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*2,nptbins*2,ptmin,ptmax*2);
2355 fhCaloCorrECells->SetXTitle("#Sigma E of Cells in EMCAL (GeV)");
2356 fhCaloCorrECells->SetYTitle("#Sigma E of Cells in PHOS (GeV)");
2357 outputContainer->Add(fhCaloCorrECells);
2359 //Calorimeter VS V0 signal
2360 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
2361 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
2362 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2363 outputContainer->Add(fhCaloV0SCorrNClusters);
2365 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2366 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
2367 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2368 outputContainer->Add(fhCaloV0SCorrEClusters);
2370 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
2371 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
2372 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2373 outputContainer->Add(fhCaloV0SCorrNCells);
2375 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax);
2376 fhCaloV0SCorrECells->SetXTitle("V0 signal");
2377 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2378 outputContainer->Add(fhCaloV0SCorrECells);
2380 //Calorimeter VS V0 multiplicity
2381 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
2382 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
2383 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2384 outputContainer->Add(fhCaloV0MCorrNClusters);
2386 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2387 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
2388 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2389 outputContainer->Add(fhCaloV0MCorrEClusters);
2391 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
2392 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
2393 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2394 outputContainer->Add(fhCaloV0MCorrNCells);
2396 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",fCalorimeter.Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax);
2397 fhCaloV0MCorrECells->SetXTitle("V0 signal");
2398 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2399 outputContainer->Add(fhCaloV0MCorrECells);
2401 //Calorimeter VS Track multiplicity
2402 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
2403 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
2404 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",fCalorimeter.Data()));
2405 outputContainer->Add(fhCaloTrackMCorrNClusters);
2407 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2408 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
2409 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma E of clusters in %s (GeV)",fCalorimeter.Data()));
2410 outputContainer->Add(fhCaloTrackMCorrEClusters);
2412 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
2413 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
2414 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",fCalorimeter.Data()));
2415 outputContainer->Add(fhCaloTrackMCorrNCells);
2417 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",fCalorimeter.Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax);
2418 fhCaloTrackMCorrECells->SetXTitle("# tracks");
2419 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma E of Cells in %s (GeV)",fCalorimeter.Data()));
2420 outputContainer->Add(fhCaloTrackMCorrECells);
2423 }//correlate calorimeters
2427 fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2428 fhEMod->SetXTitle("E (GeV)");
2429 fhEMod->SetYTitle("Module");
2430 outputContainer->Add(fhEMod);
2432 fhAmpMod = new TH2F ("hAmp_Mod","Cell energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2433 fhAmpMod->SetXTitle("E (GeV)");
2434 fhAmpMod->SetYTitle("Module");
2435 outputContainer->Add(fhAmpMod);
2437 if(fFillAllCellTimeHisto)
2439 fhTimeMod = new TH2F ("hTime_Mod","Cell time in each present Module",ntimebins,timemin,timemax,fNModules,0,fNModules);
2440 fhTimeMod->SetXTitle("t (ns)");
2441 fhTimeMod->SetYTitle("Module");
2442 outputContainer->Add(fhTimeMod);
2445 fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin+0.5,nclmax,fNModules,0,fNModules);
2446 fhNClustersMod->SetXTitle("number of clusters");
2447 fhNClustersMod->SetYTitle("Module");
2448 outputContainer->Add(fhNClustersMod);
2450 fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", ncebins,ncemin+0.5,ncemax,fNModules,0,fNModules);
2451 fhNCellsMod->SetXTitle("n cells");
2452 fhNCellsMod->SetYTitle("Module");
2453 outputContainer->Add(fhNCellsMod);
2455 Int_t colmaxs = fNMaxCols;
2456 Int_t rowmaxs = fNMaxRows;
2457 if(fCalorimeter=="EMCAL")
2459 colmaxs=2*fNMaxCols;
2460 rowmaxs=Int_t(fNModules/2)*fNMaxRows;
2464 rowmaxs=fNModules*fNMaxRows;
2467 fhGridCells = new TH2F ("hGridCells",Form("Entries in grid of cells"),
2468 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2469 fhGridCells->SetYTitle("row (phi direction)");
2470 fhGridCells->SetXTitle("column (eta direction)");
2471 outputContainer->Add(fhGridCells);
2473 fhGridCellsE = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
2474 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2475 fhGridCellsE->SetYTitle("row (phi direction)");
2476 fhGridCellsE->SetXTitle("column (eta direction)");
2477 outputContainer->Add(fhGridCellsE);
2479 if(fFillAllCellTimeHisto)
2481 fhGridCellsTime = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
2482 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2483 fhGridCellsTime->SetYTitle("row (phi direction)");
2484 fhGridCellsTime->SetXTitle("column (eta direction)");
2485 outputContainer->Add(fhGridCellsTime);
2488 fhNCellsPerClusterMod = new TH2F*[fNModules];
2489 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
2490 fhIMMod = new TH2F*[fNModules];
2491 if(fFillAllCellTimeHisto) fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2493 for(Int_t imod = 0; imod < fNModules; imod++)
2495 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
2496 Form("# cells per cluster vs cluster energy in Module %d",imod),
2497 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2498 fhNCellsPerClusterMod[imod]->SetXTitle("E (GeV)");
2499 fhNCellsPerClusterMod[imod]->SetYTitle("n cells");
2500 outputContainer->Add(fhNCellsPerClusterMod[imod]);
2502 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
2503 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
2504 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2505 fhNCellsPerClusterModNoCut[imod]->SetXTitle("E (GeV)");
2506 fhNCellsPerClusterModNoCut[imod]->SetYTitle("n cells");
2507 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
2509 if(fFillAllCellTimeHisto)
2511 for(Int_t ircu = 0; ircu < fNRCU; ircu++)
2513 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
2514 Form("Cell Energy vs Cell Time in Module %d, RCU %d ",imod,ircu),
2515 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2516 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("E (GeV)");
2517 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("time (ns)");
2518 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
2523 if(fFillAllPi0Histo)
2525 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
2526 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
2527 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2528 fhIMMod[imod]->SetXTitle("p_{T, cluster pairs} (GeV) ");
2529 fhIMMod[imod]->SetYTitle("M_{cluster pairs} (GeV/c^{2})");
2530 outputContainer->Add(fhIMMod[imod]);
2535 // Monte Carlo Histograms
2537 TString particleName[] = { "Photon", "Pi0", "Eta", "Electron", "NeutralHadron", "ChargedHadron" };
2541 for(Int_t iPart = 0; iPart < 6; iPart++)
2543 for(Int_t iCh = 0; iCh < 2; iCh++)
2545 fhRecoMCRatioE[iPart][iCh] = new TH2F (Form("hRecoMCRatioE_%s_Match%d",particleName[iPart].Data(),iCh),
2546 Form("Reco/Gen E, %s, Matched %d",particleName[iPart].Data(),iCh),
2547 nptbins, ptmin, ptmax, 200,0,2);
2548 fhRecoMCRatioE[iPart][iCh]->SetXTitle("E_{reconstructed}/E_{generated}");
2549 outputContainer->Add(fhRecoMCRatioE[iPart][iCh]);
2552 fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
2553 Form("MC - Reco E, %s, Matched %d",particleName[iPart].Data(),iCh),
2554 nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
2555 fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#Delta E (GeV)");
2556 outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
2558 fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2559 Form("MC - Reco #phi, %s, Matched %d",particleName[iPart].Data(),iCh),
2560 nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
2561 fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#Delta #phi (rad)");
2562 outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
2564 fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
2565 Form("MC- Reco #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
2566 nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
2567 fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#Delta #eta ");
2568 outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
2570 fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
2571 Form("E distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2572 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2573 fhRecoMCE[iPart][iCh]->SetXTitle("E_{rec} (GeV)");
2574 fhRecoMCE[iPart][iCh]->SetYTitle("E_{gen} (GeV)");
2575 outputContainer->Add(fhRecoMCE[iPart][iCh]);
2577 fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2578 Form("#phi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2579 nphibins,phimin,phimax, nphibins,phimin,phimax);
2580 fhRecoMCPhi[iPart][iCh]->SetXTitle("#phi_{rec} (rad)");
2581 fhRecoMCPhi[iPart][iCh]->SetYTitle("#phi_{gen} (rad)");
2582 outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
2584 fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
2585 Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2586 netabins,etamin,etamax,netabins,etamin,etamax);
2587 fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{rec} ");
2588 fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{gen} ");
2589 outputContainer->Add(fhRecoMCEta[iPart][iCh]);
2594 for(Int_t iPart = 0; iPart < 4; iPart++)
2596 fhGenMCE[iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
2597 Form("p_{T} of generated %s",particleName[iPart].Data()),
2598 nptbins,ptmin,ptmax);
2599 fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
2600 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2601 netabins,etamin,etamax,nphibins,phimin,phimax);
2603 fhGenMCE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2604 fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
2605 fhGenMCEtaPhi[iPart]->SetYTitle("#phi (rad)");
2607 outputContainer->Add(fhGenMCE[iPart]);
2608 outputContainer->Add(fhGenMCEtaPhi[iPart]);
2611 fhGenMCAccE[iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
2612 Form("p_{T} of generated %s",particleName[iPart].Data()),
2613 nptbins,ptmin,ptmax);
2614 fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
2615 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2616 netabins,etamin,etamax,nphibins,phimin,phimax);
2618 fhGenMCAccE[iPart] ->SetXTitle("p_{T} (GeV/c)");
2619 fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
2620 fhGenMCAccEtaPhi[iPart]->SetYTitle("#phi (rad)");
2622 outputContainer->Add(fhGenMCAccE[iPart]);
2623 outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
2627 //Vertex of generated particles
2629 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2630 fhEMVxyz->SetXTitle("v_{x}");
2631 fhEMVxyz->SetYTitle("v_{y}");
2632 //fhEMVxyz->SetZTitle("v_{z}");
2633 outputContainer->Add(fhEMVxyz);
2635 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2636 fhHaVxyz->SetXTitle("v_{x}");
2637 fhHaVxyz->SetYTitle("v_{y}");
2638 //fhHaVxyz->SetZTitle("v_{z}");
2639 outputContainer->Add(fhHaVxyz);
2641 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2642 fhEMR->SetXTitle("E (GeV)");
2643 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2644 outputContainer->Add(fhEMR);
2646 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2647 fhHaR->SetXTitle("E (GeV)");
2648 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2649 outputContainer->Add(fhHaR);
2654 fhMCEle1EOverP = new TH2F("hMCEle1EOverP","TRACK matches E/p, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2655 fhMCEle1EOverP->SetYTitle("E/p");
2656 fhMCEle1EOverP->SetXTitle("p_{T} (GeV/c)");
2657 outputContainer->Add(fhMCEle1EOverP);
2659 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
2660 fhMCEle1dR->SetXTitle("#Delta R (rad)");
2661 outputContainer->Add(fhMCEle1dR) ;
2663 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","dE/dx vs. p for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2664 fhMCEle2MatchdEdx->SetXTitle("p (GeV/c)");
2665 fhMCEle2MatchdEdx->SetYTitle("<dE/dx>");
2666 outputContainer->Add(fhMCEle2MatchdEdx);
2668 fhMCChHad1EOverP = new TH2F("hMCChHad1EOverP","TRACK matches E/p, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2669 fhMCChHad1EOverP->SetYTitle("E/p");
2670 fhMCChHad1EOverP->SetXTitle("p_{T} (GeV/c)");
2671 outputContainer->Add(fhMCChHad1EOverP);
2673 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
2674 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
2675 outputContainer->Add(fhMCChHad1dR) ;
2677 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","dE/dx vs. p for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2678 fhMCChHad2MatchdEdx->SetXTitle("p (GeV/c)");
2679 fhMCChHad2MatchdEdx->SetYTitle("<dE/dx>");
2680 outputContainer->Add(fhMCChHad2MatchdEdx);
2682 fhMCNeutral1EOverP = new TH2F("hMCNeutral1EOverP","TRACK matches E/p, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2683 fhMCNeutral1EOverP->SetYTitle("E/p");
2684 fhMCNeutral1EOverP->SetXTitle("p_{T} (GeV/c)");
2685 outputContainer->Add(fhMCNeutral1EOverP);
2687 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
2688 fhMCNeutral1dR->SetXTitle("#Delta R (rad)");
2689 outputContainer->Add(fhMCNeutral1dR) ;
2691 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","dE/dx vs. p for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2692 fhMCNeutral2MatchdEdx->SetXTitle("p (GeV/c)");
2693 fhMCNeutral2MatchdEdx->SetYTitle("<dE/dx>");
2694 outputContainer->Add(fhMCNeutral2MatchdEdx);
2696 fhMCEle1EOverPR02 = new TH2F("hMCEle1EOverPR02","TRACK matches E/p, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2697 fhMCEle1EOverPR02->SetYTitle("E/p");
2698 fhMCEle1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2699 outputContainer->Add(fhMCEle1EOverPR02);
2701 fhMCChHad1EOverPR02 = new TH2F("hMCChHad1EOverPR02","TRACK matches E/p, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2702 fhMCChHad1EOverPR02->SetYTitle("E/p");
2703 fhMCChHad1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2704 outputContainer->Add(fhMCChHad1EOverPR02);
2706 fhMCNeutral1EOverPR02 = new TH2F("hMCNeutral1EOverPR02","TRACK matches E/p, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2707 fhMCNeutral1EOverPR02->SetYTitle("E/p");
2708 fhMCNeutral1EOverPR02->SetXTitle("p_{T} (GeV/c)");
2709 outputContainer->Add(fhMCNeutral1EOverPR02);
2712 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
2713 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
2715 return outputContainer;
2718 //__________________________________________________________________________________________________
2719 Float_t AliAnaCalorimeterQA::GetECross(const Int_t absID, AliVCaloCells* cells, const Float_t dtcut)
2721 // Get energy in cross axis around maximum cell, for EMCAL only
2723 Int_t icol =-1, irow=-1,iRCU = -1;
2724 Int_t imod = GetModuleNumberCellIndexes(absID, fCalorimeter, icol, irow, iRCU);
2726 if(fCalorimeter=="EMCAL")
2728 //Get close cells index, energy and time, not in corners
2733 if( irow < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow+1, icol);
2734 if( irow > 0 ) absID2 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow-1, icol);
2736 // In case of cell in eta = 0 border, depending on SM shift the cross cell index
2740 if ( icol == AliEMCALGeoParams::fgkEMCALCols - 1 && !(imod%2) )
2742 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod+1, irow, 0);
2743 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol-1);
2745 else if( icol == 0 && imod%2 )
2747 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol+1);
2748 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod-1, irow, AliEMCALGeoParams::fgkEMCALCols-1);
2752 if( icol < AliEMCALGeoParams::fgkEMCALCols-1 )
2753 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol+1);
2755 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol-1);
2758 //Recalibrate cell energy if needed
2759 //Float_t ecell = cells->GetCellAmplitude(absID);
2760 //GetCaloUtils()->RecalibrateCellAmplitude(ecell,fCalorimeter, absID);
2761 Double_t tcell = cells->GetCellTime(absID);
2762 GetCaloUtils()->RecalibrateCellTime(tcell, fCalorimeter, absID,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2764 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2765 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
2769 ecell1 = cells->GetCellAmplitude(absID1);
2770 GetCaloUtils()->RecalibrateCellAmplitude(ecell1, fCalorimeter, absID1);
2771 tcell1 = cells->GetCellTime(absID1);
2772 GetCaloUtils()->RecalibrateCellTime (tcell1, fCalorimeter, absID1,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2776 ecell2 = cells->GetCellAmplitude(absID2);
2777 GetCaloUtils()->RecalibrateCellAmplitude(ecell2, fCalorimeter, absID2);
2778 tcell2 = cells->GetCellTime(absID2);
2779 GetCaloUtils()->RecalibrateCellTime (tcell2, fCalorimeter, absID2, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2783 ecell3 = cells->GetCellAmplitude(absID3);
2784 GetCaloUtils()->RecalibrateCellAmplitude(ecell3, fCalorimeter, absID3);
2785 tcell3 = cells->GetCellTime(absID3);
2786 GetCaloUtils()->RecalibrateCellTime (tcell3, fCalorimeter, absID3, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2790 ecell4 = cells->GetCellAmplitude(absID4);
2791 GetCaloUtils()->RecalibrateCellAmplitude(ecell4, fCalorimeter, absID4);
2792 tcell4 = cells->GetCellTime(absID4);
2793 GetCaloUtils()->RecalibrateCellTime (tcell4, fCalorimeter, absID4, GetReader()->GetInputEvent()->GetBunchCrossNumber());
2796 if(TMath::Abs(tcell-tcell1)*1.e9 > dtcut) ecell1 = 0 ;
2797 if(TMath::Abs(tcell-tcell2)*1.e9 > dtcut) ecell2 = 0 ;
2798 if(TMath::Abs(tcell-tcell3)*1.e9 > dtcut) ecell3 = 0 ;
2799 if(TMath::Abs(tcell-tcell4)*1.e9 > dtcut) ecell4 = 0 ;
2801 return ecell1+ecell2+ecell3+ecell4;
2806 Int_t absId1 = -1, absId2 = -1, absId3 = -1, absId4 = -1;
2808 Int_t relId1[] = { imod+1, 0, irow+1, icol };
2809 Int_t relId2[] = { imod+1, 0, irow-1, icol };
2810 Int_t relId3[] = { imod+1, 0, irow , icol+1 };
2811 Int_t relId4[] = { imod+1, 0, irow , icol-1 };
2813 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId1, absId1);
2814 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId2, absId2);
2815 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId3, absId3);
2816 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId4, absId4);
2818 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
2820 if(absId1 > 0 ) ecell1 = cells->GetCellAmplitude(absId1);
2821 if(absId2 > 0 ) ecell2 = cells->GetCellAmplitude(absId2);
2822 if(absId3 > 0 ) ecell3 = cells->GetCellAmplitude(absId3);
2823 if(absId4 > 0 ) ecell4 = cells->GetCellAmplitude(absId4);
2825 return ecell1+ecell2+ecell3+ecell4;
2831 //__________________________________________________________________________________________________
2832 void AliAnaCalorimeterQA::InvariantMassHistograms(const Int_t iclus, const TLorentzVector mom,
2833 const Int_t nModule, const TObjArray* caloClusters,
2834 AliVCaloCells * cells)
2836 // Fill Invariant mass histograms
2838 if(GetDebug()>1) printf("AliAnaCalorimeterQA::InvariantMassHistograms() - Start \n");
2840 //Get vertex for photon momentum calculation and event selection
2841 Double_t v[3] = {0,0,0}; //vertex ;
2842 //GetReader()->GetVertex(v);
2844 Int_t nModule2 = -1;
2845 TLorentzVector mom2 ;
2846 Int_t nCaloClusters = caloClusters->GetEntriesFast();
2848 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++)
2850 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
2852 Float_t maxCellFraction = 0.;
2853 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction);
2855 // Try to rediuce background with a mild shower shape cut and no more than 1 maxima
2856 // in cluster and remove low energy clusters
2857 if( clus2->GetNCells() <= 1 || !IsGoodCluster(absIdMax,cells) ||
2858 GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1 ||
2859 clus2->GetM02() > 0.5 || clus2->E() < 0.3) continue;
2861 //Get cluster kinematics
2862 clus2->GetMomentum(mom2,v);
2864 //Check only certain regions
2866 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,fCalorimeter) ;
2869 //Get module of cluster
2870 nModule2 = GetModuleNumber(clus2);
2875 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
2878 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
2879 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
2882 //Asymetry histograms
2883 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
2885 }// 2nd cluster loop
2889 //______________________________
2890 void AliAnaCalorimeterQA::Init()
2892 //Check if the data or settings are ok
2894 if(fCalorimeter != "PHOS" && fCalorimeter !="EMCAL")
2895 AliFatal(Form("Wrong calorimeter name <%s>", fCalorimeter.Data()));
2897 //if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
2898 // AliFatal("Analysis of reconstructed data, MC reader not aplicable");
2902 //________________________________________
2903 void AliAnaCalorimeterQA::InitParameters()
2905 //Initialize the parameters of the analysis.
2906 AddToHistogramsName("AnaCaloQA_");
2908 fCalorimeter = "EMCAL"; //or PHOS
2909 fNModules = 12; // set maximum to maximum number of EMCAL modules
2910 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
2911 fTimeCutMin = -9999999;
2912 fTimeCutMax = 9999999;
2913 fEMCALCellAmpMin = 0.2;
2914 fPHOSCellAmpMin = 0.2;
2917 fExoNECrossCuts = 10 ;
2918 fExoNDTimeCuts = 4 ;
2920 fExoDTimeCuts [0] = 1.e4 ; fExoDTimeCuts [1] = 50.0 ; fExoDTimeCuts [2] = 25.0 ; fExoDTimeCuts [3] = 10.0 ;
2921 fExoECrossCuts[0] = 0.80 ; fExoECrossCuts[1] = 0.85 ; fExoECrossCuts[2] = 0.90 ; fExoECrossCuts[3] = 0.92 ; fExoECrossCuts[4] = 0.94 ;
2922 fExoECrossCuts[5] = 0.95 ; fExoECrossCuts[6] = 0.96 ; fExoECrossCuts[7] = 0.97 ; fExoECrossCuts[8] = 0.98 ; fExoECrossCuts[9] = 0.99 ;
2926 //___________________________________________________________________________________
2927 Bool_t AliAnaCalorimeterQA::IsGoodCluster(const Int_t absIdMax, AliVCaloCells* cells)
2929 //Identify cluster as exotic or not
2931 if(!fStudyBadClusters) return kTRUE;
2933 if(fCalorimeter=="EMCAL")
2935 if(!GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster())
2937 return !( GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(absIdMax,cells,(GetReader()->GetInputEvent())->GetBunchCrossNumber()) );
2946 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
2947 GetCaloUtils()->RecalibrateCellAmplitude(ampMax, fCalorimeter, absIdMax);
2949 if(ampMax < 0.01) return kFALSE;
2951 if(1-GetECross(absIdMax,cells)/ampMax > 0.95) return kFALSE;
2957 //_________________________________________________________
2958 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
2960 //Print some relevant parameters set for the analysis
2964 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2965 AliAnaCaloTrackCorrBaseClass::Print(" ");
2967 printf("Select Calorimeter %s \n",fCalorimeter.Data());
2968 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2969 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
2970 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
2974 //_____________________________________________________
2975 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
2977 //Fill Calorimeter QA histograms
2979 //Play with the MC stack if available
2980 if(IsDataMC()) MCHistograms();
2982 //Get List with CaloClusters
2983 TObjArray * caloClusters = NULL;
2984 if (fCalorimeter == "PHOS") caloClusters = GetPHOSClusters();
2985 else if (fCalorimeter == "EMCAL") caloClusters = GetEMCALClusters();
2987 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", fCalorimeter.Data()));
2989 // Do not do anything if there are no clusters
2990 if(caloClusters->GetEntriesFast() == 0) return;
2992 //Get List with CaloCells
2993 AliVCaloCells * cells = 0x0;
2994 if(fCalorimeter == "PHOS") cells = GetPHOSCells();
2995 else cells = GetEMCALCells();
2997 if(!caloClusters || !cells) {
2998 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters or CaloCells available\n"));
2999 return; // trick coverity
3002 //printf("QA: N cells %d, N clusters %d \n",cells->GetNumberOfCells(),caloClusters->GetEntriesFast());
3004 // Correlate Calorimeters and V0 and track Multiplicity
3005 if(fCorrelate) Correlate();
3008 ClusterLoopHistograms(caloClusters,cells);
3011 CellHistograms(cells);
3014 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
3018 //______________________________________
3019 void AliAnaCalorimeterQA::MCHistograms()
3021 //Get the MC arrays and do some checks before filling MC histograms
3023 TLorentzVector mom ;
3025 if(GetReader()->ReadStack()){
3028 AliFatal("Stack not available, is the MC handler called?\n");
3030 //Fill some pure MC histograms, only primaries.
3031 for(Int_t i=0 ; i<GetMCStack()->GetNprimary(); i++)
3032 {//Only primary particles, for all MC transport put GetNtrack()
3033 TParticle *primary = GetMCStack()->Particle(i) ;
3035 if (primary->GetStatusCode() > 11) continue; //Working for PYTHIA and simple generators, check for HERWIG
3036 primary->Momentum(mom);
3037 MCHistograms(mom,TMath::Abs(primary->GetPdgCode()));
3040 else if(GetReader()->ReadAODMCParticles()){
3042 if(!GetReader()->GetAODMCParticles(0))
3043 AliFatal("AODMCParticles not available!");
3045 //Fill some pure MC histograms, only primaries.
3046 for(Int_t i=0 ; i < (GetReader()->GetAODMCParticles(0))->GetEntriesFast(); i++)
3048 AliAODMCParticle *aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles(0))->At(i) ;
3050 if (!aodprimary->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
3052 mom.SetPxPyPzE(aodprimary->Px(),aodprimary->Py(),aodprimary->Pz(),aodprimary->E());
3053 MCHistograms(mom,TMath::Abs(aodprimary->GetPdgCode()));
3059 //_______________________________________________________________________________
3060 void AliAnaCalorimeterQA::MCHistograms(const TLorentzVector mom, const Int_t pdg)
3062 //Fill pure monte carlo related histograms
3064 Float_t eMC = mom.E();
3065 Float_t phiMC = mom.Phi();
3067 phiMC += TMath::TwoPi();
3068 Float_t etaMC = mom.Eta();
3070 if (TMath::Abs(etaMC) > 1) return;
3074 //Rough stimate of acceptance for pi0, Eta and electrons
3075 if(fCalorimeter == "PHOS")
3077 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
3079 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
3082 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
3084 if(GetEMCALGeometry())
3087 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(mom.Eta(),mom.Phi(),absID);
3092 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s Real acceptance? %d\n",fCalorimeter.Data(),in);
3096 if(GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter))
3098 if(GetDebug() > 2) printf("AliAnaCalorimeterQA::MCHistograms() - In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),in);
3104 fhGenMCE[kmcPhoton] ->Fill(eMC);
3105 if(eMC > 0.5) fhGenMCEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
3108 fhGenMCAccE[kmcPhoton] ->Fill(eMC);
3109 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPhoton]->Fill(etaMC,phiMC);
3114 fhGenMCE[kmcPi0] ->Fill(eMC);
3115 if(eMC > 0.5) fhGenMCEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
3118 fhGenMCAccE[kmcPi0] ->Fill(eMC);
3119 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcPi0]->Fill(etaMC,phiMC);
3124 fhGenMCE[kmcEta] ->Fill(eMC);
3125 if(eMC > 0.5) fhGenMCEtaPhi[kmcEta]->Fill(etaMC,phiMC);
3128 fhGenMCAccE[kmcEta] ->Fill(eMC);
3129 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcEta]->Fill(etaMC,phiMC);
3132 else if (TMath::Abs(pdg)==11)
3134 fhGenMCE[kmcElectron] ->Fill(eMC);
3135 if(eMC > 0.5) fhGenMCEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3138 fhGenMCAccE[kmcElectron] ->Fill(eMC);
3139 if(eMC > 0.5) fhGenMCAccEtaPhi[kmcElectron]->Fill(etaMC,phiMC);
3144 //_________________________________________________________________________________
3145 void AliAnaCalorimeterQA::WeightHistograms(AliVCluster *clus, AliVCaloCells* cells)
3147 // Calculate weights
3149 // First recalculate energy in case non linearity was applied
3152 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3154 Int_t id = clus->GetCellsAbsId()[ipos];
3156 //Recalibrate cell energy if needed
3157 Float_t amp = cells->GetCellAmplitude(id);
3158 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3169 printf("AliAnaCalorimeterQA::WeightHistograms()- Wrong calculated energy %f\n",energy);
3173 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
3174 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
3176 //Get the ratio and log ratio to all cells in cluster
3177 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3179 Int_t id = clus->GetCellsAbsId()[ipos];
3181 //Recalibrate cell energy if needed
3182 Float_t amp = cells->GetCellAmplitude(id);
3183 GetCaloUtils()->RecalibrateCellAmplitude(amp, fCalorimeter, id);
3185 fhECellClusterRatio ->Fill(energy,amp/energy);
3186 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
3189 //Recalculate shower shape for different W0
3190 if(fCalorimeter=="EMCAL")
3192 Float_t l0org = clus->GetM02();
3193 Float_t l1org = clus->GetM20();
3194 Float_t dorg = clus->GetDispersion();
3196 for(Int_t iw = 0; iw < 14; iw++){
3197 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
3198 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
3200 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
3201 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
3205 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(clus->GetLabels(),clus->GetNLabels(), GetReader(),0);
3207 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
3208 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
3209 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3210 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3211 fhLambda0ForW0MC[iw][0]->Fill(energy,clus->GetM02());
3212 //fhLambda1ForW0MC[iw][0]->Fill(energy,clus->GetM20());
3214 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
3215 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3216 fhLambda0ForW0MC[iw][1]->Fill(energy,clus->GetM02());
3217 //fhLambda1ForW0MC[iw][1]->Fill(energy,clus->GetM20());
3219 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3220 fhLambda0ForW0MC[iw][2]->Fill(energy,clus->GetM02());
3221 //fhLambda1ForW0MC[iw][2]->Fill(energy,clus->GetM20());
3223 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ){
3224 fhLambda0ForW0MC[iw][3]->Fill(energy,clus->GetM02());
3225 //fhLambda1ForW0MC[iw][3]->Fill(energy,clus->GetM20());
3227 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3228 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) ){
3229 fhLambda0ForW0MC[iw][4]->Fill(energy,clus->GetM02());
3230 //fhLambda1ForW0MC[iw][4]->Fill(energy,clus->GetM20());
3236 // Set the original values back
3237 clus->SetM02(l0org);
3238 clus->SetM20(l1org);
3239 clus->SetDispersion(dorg);