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(),
55 fFillAllCellTimeHisto(kTRUE),
56 fFillAllPosHisto(kFALSE), fFillAllPosHisto2(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 fCellAmpMin(0), fEMCALCellAmpMin(0),
68 fPHOSCellAmpMin(0), fMinInvMassECut(0),
71 fExoNECrossCuts(0), fExoECrossCuts(),
72 fExoNDTimeCuts(0), fExoDTimeCuts(),
76 fhPhi(0), fhEta(0), fhEtaPhiE(0),
77 fhECharged(0), fhPtCharged(0),
78 fhPhiCharged(0), fhEtaCharged(0), fhEtaPhiECharged(0),
83 fhNCellsPerCluster(0), fhNCellsPerClusterNoCut(0), fhNClusters(0),
86 fhClusterTimeEnergy(0), fhCellTimeSpreadRespectToCellMax(0),
87 fhCellIdCellLargeTimeSpread(0), fhClusterPairDiffTimeE(0),
88 fhClusterMaxCellCloseCellRatio(0), fhClusterMaxCellCloseCellDiff(0),
89 fhClusterMaxCellDiff(0), fhClusterMaxCellDiffNoCut(0),
90 fhClusterMaxCellDiffAverageTime(0), fhClusterMaxCellDiffWeightedTime(0),
91 fhClusterMaxCellECross(0),
92 fhLambda0(0), fhLambda1(0), fhDispersion(0),
95 fhBadClusterEnergy(0), fhBadClusterTimeEnergy(0),
96 fhBadClusterPairDiffTimeE(0), fhBadCellTimeSpreadRespectToCellMax(0),
97 fhBadClusterMaxCellCloseCellRatio(0), fhBadClusterMaxCellCloseCellDiff(0), fhBadClusterMaxCellDiff(0),
98 fhBadClusterMaxCellDiffAverageTime(0), fhBadClusterMaxCellDiffWeightedTime(0),
99 fhBadClusterMaxCellECross(0),
100 fhBadClusterDeltaIEtaDeltaIPhiE0(0), fhBadClusterDeltaIEtaDeltaIPhiE2(0),
101 fhBadClusterDeltaIEtaDeltaIPhiE6(0), fhBadClusterDeltaIA(0),
104 fhRNCells(0), fhXNCells(0),
105 fhYNCells(0), fhZNCells(0),
109 fhRCellE(0), fhXCellE(0),
110 fhYCellE(0), fhZCellE(0),
112 fhDeltaCellClusterRNCells(0), fhDeltaCellClusterXNCells(0),
113 fhDeltaCellClusterYNCells(0), fhDeltaCellClusterZNCells(0),
114 fhDeltaCellClusterRE(0), fhDeltaCellClusterXE(0),
115 fhDeltaCellClusterYE(0), fhDeltaCellClusterZE(0),
118 fhNCells(0), fhNCellsCutAmpMin(0),
119 fhAmplitude(0), fhAmpId(0), fhEtaPhiAmp(0),
120 fhTime(0), fhTimeVz(0),
121 fhTimeId(0), fhTimeAmp(0),
122 fhAmpIdLowGain(0), fhTimeIdLowGain(0), fhTimeAmpLowGain(0),
125 fhCaloCorrNClusters(0), fhCaloCorrEClusters(0),
126 fhCaloCorrNCells(0), fhCaloCorrECells(0),
127 fhCaloV0SCorrNClusters(0), fhCaloV0SCorrEClusters(0),
128 fhCaloV0SCorrNCells(0), fhCaloV0SCorrECells(0),
129 fhCaloV0MCorrNClusters(0), fhCaloV0MCorrEClusters(0),
130 fhCaloV0MCorrNCells(0), fhCaloV0MCorrECells(0),
131 fhCaloTrackMCorrNClusters(0), fhCaloTrackMCorrEClusters(0),
132 fhCaloTrackMCorrNCells(0), fhCaloTrackMCorrECells(0),
133 fhCaloCenNClusters(0), fhCaloCenEClusters(0),
134 fhCaloCenNCells(0), fhCaloCenECells(0),
135 fhCaloEvPNClusters(0), fhCaloEvPEClusters(0),
136 fhCaloEvPNCells(0), fhCaloEvPECells(0),
137 //Super-Module dependent histgrams
138 fhEMod(0), fhAmpMod(0), fhTimeMod(0),
139 fhNClustersMod(0), fhNCellsMod(0),
140 fhNCellsPerClusterMod(0), fhNCellsPerClusterModNoCut(0),
142 fhGridCells(0), fhGridCellsE(0), fhGridCellsTime(0),
143 fhGridCellsLowGain(0), fhGridCellsELowGain(0), fhGridCellsTimeLowGain(0),
144 fhTimeAmpPerRCU(0), fhIMMod(0),
147 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
148 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
149 fhECellTotalRatio(0), fhECellTotalLogRatio(0),
150 fhECellTotalRatioMod(0), fhECellTotalLogRatioMod(0),
152 fhExoL0ECross(0), fhExoL1ECross(0),
155 fhRecoMCE(), fhRecoMCPhi(), fhRecoMCEta(),
156 fhRecoMCDeltaE(), fhRecoMCRatioE(),
157 fhRecoMCDeltaPhi(), fhRecoMCDeltaEta(),
160 fhGenMCE(), fhGenMCPt(), fhGenMCEtaPhi(),
161 fhGenMCAccE(), fhGenMCAccPt(), fhGenMCAccEtaPhi(),
164 fhEMVxyz(0), fhEMR(0),
165 fhHaVxyz(0), fhHaR(0),
166 fh1EOverP(0), fh2dR(0),
167 fh2EledEdx(0), fh2MatchdEdx(0),
168 fhMCEle1EOverP(0), fhMCEle1dR(0), fhMCEle2MatchdEdx(0),
169 fhMCChHad1EOverP(0), fhMCChHad1dR(0), fhMCChHad2MatchdEdx(0),
170 fhMCNeutral1EOverP(0), fhMCNeutral1dR(0), fhMCNeutral2MatchdEdx(0), fh1EOverPR02(0),
171 fhMCEle1EOverPR02(0), fhMCChHad1EOverPR02(0), fhMCNeutral1EOverPR02(0),
172 fh1EleEOverP(0), fhMCEle1EleEOverP(0),
173 fhMCChHad1EleEOverP(0), fhMCNeutral1EleEOverP(0),
174 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
175 fhTrackMatchedDEtaPos(0), fhTrackMatchedDPhiPos(0), fhTrackMatchedDEtaDPhiPos(0)
180 for(Int_t i =0; i < 12; i++){
181 fhLambda0ForW0[i] = 0;
182 //fhLambda1ForW0[i] = 0;
184 for(Int_t j = 0; j < 5; j++){
185 fhLambda0ForW0MC[i][j] = 0;
186 //fhLambda1ForW0MC[i][j] = 0;
192 fhDeltaIEtaDeltaIPhiE0[0] = 0 ; fhDeltaIEtaDeltaIPhiE2[0] = 0; fhDeltaIEtaDeltaIPhiE6[0] = 0;
193 fhDeltaIEtaDeltaIPhiE0[1] = 0 ; fhDeltaIEtaDeltaIPhiE2[1] = 0; fhDeltaIEtaDeltaIPhiE6[1] = 0;
194 fhDeltaIA[0] = 0 ; fhDeltaIAL0[0] = 0; fhDeltaIAL1[0] = 0;
195 fhDeltaIA[1] = 0 ; fhDeltaIAL0[1] = 0; fhDeltaIAL1[1] = 0;
196 fhDeltaIANCells[0] = 0 ; fhDeltaIANCells[1] = 0;
197 fhDeltaIAMC[0] = 0 ; fhDeltaIAMC[1] = 0;
198 fhDeltaIAMC[2] = 0 ; fhDeltaIAMC[3] = 0;
201 for (Int_t ie = 0; ie < 10 ; ie++)
204 for (Int_t idt = 0; idt < 5 ; idt++)
206 fhExoNCell [ie][idt] = 0;
207 fhExoL0 [ie][idt] = 0;
208 fhExoL1 [ie][idt] = 0;
209 fhExoECross [ie][idt] = 0;
210 fhExoTime [ie][idt] = 0;
211 fhExoL0NCell [ie][idt] = 0;
212 fhExoL1NCell [ie][idt] = 0;
218 for(Int_t i = 0; i < 7; i++)
220 fhRecoMCE[i][0] = 0; fhRecoMCE[i][1] = 0;
221 fhRecoMCPhi[i][0] = 0; fhRecoMCPhi[i][1] = 0;
222 fhRecoMCEta[i][0] = 0; fhRecoMCEta[i][1] = 0;
223 fhRecoMCDeltaE[i][0] = 0; fhRecoMCDeltaE[i][1] = 0;
224 fhRecoMCRatioE[i][0] = 0; fhRecoMCRatioE[i][1] = 0;
225 fhRecoMCDeltaPhi[i][0] = 0; fhRecoMCDeltaPhi[i][1] = 0;
226 fhRecoMCDeltaEta[i][0] = 0; fhRecoMCDeltaEta[i][1] = 0;
229 for(Int_t i = 0; i < 4; i++)
233 fhGenMCEtaPhi[i] = 0;
236 fhGenMCAccEtaPhi[i] = 0;
239 //Initialize parameters
243 //______________________________________________________________________________________________________________________
244 void AliAnaCalorimeterQA::BadClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
245 Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
248 //Bad cluster histograms
250 // printf("AliAnaCalorimeterQA::BadClusterHistograms() - Event %d - Calorimeter %s \n \t E %f, n cells %d, max cell absId %d, maxCellFrac %f\n",
251 // GetReader()->GetEventNumber(), GetCalorimeter().Data(),
252 // clus->E(),clus->GetNCells(),absIdMax,maxCellFraction);
254 fhBadClusterEnergy ->Fill(clus->E());
255 Double_t tof = clus->GetTOF()*1.e9;
256 fhBadClusterTimeEnergy ->Fill(clus->E(),tof);
257 fhBadClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
258 fhBadClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
260 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kFALSE);
262 //Clusters in event time differencem bad minus good
264 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
266 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(iclus2);
268 if(clus->GetID()==clus2->GetID()) continue;
270 Float_t maxCellFraction2 = 0.;
271 Int_t absIdMax2 = GetCaloUtils()->GetMaxEnergyCell(cells, clus2,maxCellFraction2);
272 if(IsGoodCluster(absIdMax2,cells))
274 Double_t tof2 = clus2->GetTOF()*1.e9;
275 fhBadClusterPairDiffTimeE ->Fill(clus->E(), (tof-tof2));
280 // Max cell compared to other cells in cluster
281 if(fFillAllCellTimeHisto)
283 // Get some time averages
284 Double_t timeAverages[2] = {0.,0.};
285 CalculateAverageTime(clus, cells, timeAverages);
287 fhBadClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
288 fhBadClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
291 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
293 Int_t absId = clus->GetCellsAbsId()[ipos];
294 if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
296 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
298 fhBadClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
299 fhBadClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
301 if(fFillAllCellTimeHisto)
303 Double_t time = cells->GetCellTime(absId);
304 GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
306 Float_t diff = (tmax-time*1e9);
307 fhBadCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
315 //______________________________________________________________________
316 void AliAnaCalorimeterQA::CalculateAverageTime(AliVCluster *clus,
317 AliVCaloCells* cells,
318 Double_t timeAverages[2])
320 // Calculate time averages and weights
322 // First recalculate energy in case non linearity was applied
324 Float_t ampMax = 0, amp = 0;
325 // Int_t absIdMax =-1;
326 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
328 Int_t id = clus->GetCellsAbsId()[ipos];
330 //Recalibrate cell energy if needed
331 amp = cells->GetCellAmplitude(id);
332 GetCaloUtils()->RecalibrateCellAmplitude(amp,GetCalorimeter(), id);
343 // Calculate average time of cells in cluster and weighted average
350 Int_t ncells = clus->GetNCells();
352 for (Int_t ipos = 0; ipos < ncells; ipos++)
354 id = clus ->GetCellsAbsId()[ipos];
355 amp = cells->GetCellAmplitude(id);
356 time = cells->GetCellTime(id);
358 //Recalibrate energy and time
359 GetCaloUtils()->RecalibrateCellAmplitude(amp , GetCalorimeter(), id);
360 GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
362 w = GetCaloUtils()->GetEMCALRecoUtils()->GetCellWeight(cells->GetCellAmplitude(id),energy);
364 wTime += time*1e9 * w;
369 if(ncells > 0) aTime /= ncells;
372 if(wTot > 0) wTime /= wTot;
375 timeAverages[0] = aTime;
376 timeAverages[1] = wTime;
380 //____________________________________________________________
381 void AliAnaCalorimeterQA::CellHistograms(AliVCaloCells *cells)
383 // Plot histograms related to cells only
385 Int_t ncells = cells->GetNumberOfCells();
386 if( ncells > 0 ) fhNCells->Fill(ncells) ;
389 Float_t ecellsCut = 0;
392 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - %s cell entries %d\n", GetCalorimeter().Data(), ncells );
394 //Init arrays and used variables
395 Int_t *nCellsInModule = new Int_t [fNModules];
396 Float_t *eCellsInModule = new Float_t[fNModules];
398 for(Int_t imod = 0; imod < fNModules; imod++ )
400 nCellsInModule[imod] = 0 ;
401 eCellsInModule[imod] = 0.;
410 Bool_t highG = kFALSE;
412 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
414 for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++)
417 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell));
419 Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),GetCalorimeter(), icol, irow, iRCU);
421 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
423 if(nModule < fNModules)
425 //Check if the cell is a bad channel
426 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn())
428 if(GetCalorimeter()=="EMCAL")
430 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
434 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
436 } // use bad channel map
438 amp = cells->GetAmplitude(iCell)*recalF;
439 time = cells->GetTime(iCell);
440 id = cells->GetCellNumber(iCell);
441 highG = cells->GetCellHighGain(id);
443 // Amplitude recalibration if set
444 GetCaloUtils()->RecalibrateCellAmplitude(amp, GetCalorimeter(), id);
446 // Time recalibration if set
447 GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
449 //Transform time to ns
452 if(time < fTimeCutMin || time > fTimeCutMax)
455 printf("AliAnaCalorimeterQA - Remove cell with Time %f\n",time);
459 // Remove exotic cells, defined only for EMCAL
460 if(GetCalorimeter()=="EMCAL" &&
461 GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
463 fhAmplitude->Fill(amp);
464 fhAmpId ->Fill(amp,id);
465 fhAmpMod ->Fill(amp,nModule);
466 if(!highG) fhAmpIdLowGain->Fill(amp,id);
467 //E cross for exotic cells
470 fhCellECross->Fill(amp,1-GetECross(id,cells)/amp);
472 eCellsInModule[nModule]+=amp ;
475 if ( amp > fCellAmpMin )
478 nCellsInModule[nModule]++ ;
483 if(GetCalorimeter()=="EMCAL")
485 icols = (nModule % 2) ? icol + fNMaxCols : icol;
487 irows = irow + fNMaxRows * Int_t(nModule / 2);
489 irows = irow + (fNMaxRows / 3) * Int_t(nModule / 2);
493 irows = irow + fNMaxRows * nModule;
496 fhGridCells ->Fill(icols,irows);
497 fhGridCellsE->Fill(icols,irows,amp);
501 fhGridCellsLowGain ->Fill(icols,irows);
502 fhGridCellsELowGain->Fill(icols,irows,amp);
505 if(fFillAllCellTimeHisto)
507 //printf("%s: time %g\n",GetCalorimeter().Data(), time);
509 Double_t v[3] = {0,0,0}; //vertex ;
510 GetReader()->GetVertex(v);
511 if(amp > 0.5) fhTimeVz ->Fill(TMath::Abs(v[2]),time);
514 fhTimeId ->Fill(time,id);
515 fhTimeAmp ->Fill(amp,time);
516 fhGridCellsTime->Fill(icols,irows,time);
517 if(!highG) fhGridCellsTimeLowGain->Fill(icols,irows,time);
518 fhTimeMod ->Fill(time,nModule);
519 fhTimeAmpPerRCU [nModule*fNRCU+iRCU]->Fill(amp, time);
523 fhTimeIdLowGain ->Fill(time,id);
524 fhTimeAmpLowGain->Fill(amp,time);
530 //Get Eta-Phi position of Cell
533 if(GetCalorimeter()=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
534 Float_t celleta = 0.;
535 Float_t cellphi = 0.;
536 GetEMCALGeometry()->EtaPhiFromIndex(id, celleta, cellphi);
538 fhEtaPhiAmp->Fill(celleta,cellphi,amp);
539 Double_t cellpos[] = {0, 0, 0};
540 GetEMCALGeometry()->GetGlobal(id, cellpos);
541 fhXCellE->Fill(cellpos[0],amp) ;
542 fhYCellE->Fill(cellpos[1],amp) ;
543 fhZCellE->Fill(cellpos[2],amp) ;
544 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0]+cellpos[1]*cellpos[1]);//+cellpos[2]*cellpos[2]);
545 fhRCellE->Fill(rcell,amp) ;
546 fhXYZCell->Fill(cellpos[0],cellpos[1],cellpos[2]) ;
548 else if(GetCalorimeter()=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet()){
550 Int_t relId[4], module;
551 Float_t xCell, zCell;
553 GetPHOSGeometry()->AbsToRelNumbering(id,relId);
555 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
556 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
557 Float_t rcell = TMath::Sqrt(xyz.X()*xyz.X()+xyz.Y()*xyz.Y());
558 fhXCellE ->Fill(xyz.X(),amp) ;
559 fhYCellE ->Fill(xyz.Y(),amp) ;
560 fhZCellE ->Fill(xyz.Z(),amp) ;
561 fhRCellE ->Fill(rcell ,amp) ;
562 fhXYZCell->Fill(xyz.X(),xyz.Y(),xyz.Z()) ;
564 }//fill cell position histograms
569 if( ncellsCut > 0 ) fhNCellsCutAmpMin->Fill(ncellsCut) ; //fill the cells after the cut on min amplitude and bad/exotic channels
571 //Number of cells per module
572 for(Int_t imod = 0; imod < fNModules; imod++ )
575 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - module %d calo %s cells %d\n", imod, GetCalorimeter().Data(), nCellsInModule[imod]);
577 fhNCellsMod->Fill(nCellsInModule[imod],imod) ;
580 // Check energy distribution in calorimeter for selected cells
583 for (Int_t iCell = 0; iCell < cells->GetNumberOfCells(); iCell++)
586 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Cell : amp %f, absId %d \n", cells->GetAmplitude(iCell), cells->GetCellNumber(iCell));
588 Int_t nModule = GetModuleNumberCellIndexes(cells->GetCellNumber(iCell),GetCalorimeter(), icol, irow, iRCU);
590 printf("\t module %d, column %d, row %d \n", nModule,icol,irow);
592 if(nModule < fNModules)
594 //Check if the cell is a bad channel
595 if(GetCaloUtils()->IsBadChannelsRemovalSwitchedOn())
597 if(GetCalorimeter()=="EMCAL")
599 if(GetCaloUtils()->GetEMCALChannelStatus(nModule,icol,irow)) continue;
603 if(GetCaloUtils()->GetPHOSChannelStatus(nModule,icol,irow) ) continue;
605 } // use bad channel map
607 amp = cells->GetAmplitude(iCell)*recalF;
608 time = cells->GetTime(iCell);
609 id = cells->GetCellNumber(iCell);
611 // Amplitude recalibration if set
612 GetCaloUtils()->RecalibrateCellAmplitude(amp, GetCalorimeter(), id);
614 // Time recalibration if set
615 GetCaloUtils()->RecalibrateCellTime (time, GetCalorimeter(), id, GetReader()->GetInputEvent()->GetBunchCrossNumber());
617 //Transform time to ns
620 if(time < fTimeCutMin || time > fTimeCutMax)
623 printf("AliAnaCalorimeterQA - Remove cell with Time %f\n",time);
627 // Remove exotic cells, defined only for EMCAL
628 if(GetCalorimeter()=="EMCAL" &&
629 GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(id, cells, bc)) continue;
631 //E cross for exotic cells
636 Float_t ratio = amp/ecellsCut;
637 fhECellTotalRatio ->Fill(ecellsCut, ratio );
638 fhECellTotalLogRatio ->Fill(ecellsCut,TMath::Log(ratio));
641 if(eCellsInModule[nModule] > 0)
643 Float_t ratioMod = amp/eCellsInModule[nModule];
644 fhECellTotalRatioMod [nModule]->Fill(eCellsInModule[nModule], ratioMod );
645 fhECellTotalLogRatioMod[nModule]->Fill(eCellsInModule[nModule],TMath::Log(ratioMod));
652 delete [] nCellsInModule;
653 delete [] eCellsInModule;
657 //__________________________________________________________________________
658 void AliAnaCalorimeterQA::CellInClusterPositionHistograms(AliVCluster* clus)
660 // Fill histograms releated to cell position
662 Int_t nCaloCellsPerCluster = clus->GetNCells();
663 UShort_t * indexList = clus->GetCellsAbsId();
665 clus->GetPosition(pos);
666 Float_t clEnergy = clus->E();
668 //Loop on cluster cells
669 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
671 // printf("Index %d\n",ipos);
672 Int_t absId = indexList[ipos];
674 //Get position of cell compare to cluster
676 if(GetCalorimeter()=="EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
678 Double_t cellpos[] = {0, 0, 0};
679 GetEMCALGeometry()->GetGlobal(absId, cellpos);
681 fhDeltaCellClusterXNCells->Fill(pos[0]-cellpos[0],nCaloCellsPerCluster) ;
682 fhDeltaCellClusterYNCells->Fill(pos[1]-cellpos[1],nCaloCellsPerCluster) ;
683 fhDeltaCellClusterZNCells->Fill(pos[2]-cellpos[2],nCaloCellsPerCluster) ;
685 fhDeltaCellClusterXE->Fill(pos[0]-cellpos[0],clEnergy) ;
686 fhDeltaCellClusterYE->Fill(pos[1]-cellpos[1],clEnergy) ;
687 fhDeltaCellClusterZE->Fill(pos[2]-cellpos[2],clEnergy) ;
689 Float_t r = TMath::Sqrt(pos[0] *pos[0] + pos[1] * pos[1] );
690 Float_t rcell = TMath::Sqrt(cellpos[0]*cellpos[0] + cellpos[1]* cellpos[1]);
692 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
693 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
695 }//EMCAL and its matrices are available
696 else if(GetCalorimeter()=="PHOS" && GetCaloUtils()->IsPHOSGeoMatrixSet())
699 Int_t relId[4], module;
700 Float_t xCell, zCell;
702 GetPHOSGeometry()->AbsToRelNumbering(absId,relId);
704 GetPHOSGeometry()->RelPosInModule(relId,xCell,zCell);
705 GetPHOSGeometry()->Local2Global(module,xCell,zCell,xyz);
707 fhDeltaCellClusterXNCells->Fill(pos[0]-xyz.X(),nCaloCellsPerCluster) ;
708 fhDeltaCellClusterYNCells->Fill(pos[1]-xyz.Y(),nCaloCellsPerCluster) ;
709 fhDeltaCellClusterZNCells->Fill(pos[2]-xyz.Z(),nCaloCellsPerCluster) ;
711 fhDeltaCellClusterXE->Fill(pos[0]-xyz.X(),clEnergy) ;
712 fhDeltaCellClusterYE->Fill(pos[1]-xyz.Y(),clEnergy) ;
713 fhDeltaCellClusterZE->Fill(pos[2]-xyz.Z(),clEnergy) ;
715 Float_t r = TMath::Sqrt(pos[0] * pos[0] + pos[1] * pos[1] );
716 Float_t rcell = TMath::Sqrt(xyz.X() * xyz.X() + xyz.Y() * xyz.Y());
718 fhDeltaCellClusterRNCells->Fill(r-rcell, nCaloCellsPerCluster) ;
719 fhDeltaCellClusterRE ->Fill(r-rcell, clEnergy) ;
721 }//PHOS and its matrices are available
722 }// cluster cell loop
725 //___________________________________________________________________________________________
726 void AliAnaCalorimeterQA::ClusterAsymmetryHistograms(AliVCluster* clus, Int_t absIdMax,
729 // Study the shape of the cluster in cell units terms
731 //No use to study clusters with less than 4 cells
732 if( clus->GetNCells() <= 3 ) return;
737 Int_t ietaMax=-1; Int_t iphiMax = 0; Int_t rcuMax = 0;
738 Int_t smMax = GetModuleNumberCellIndexes(absIdMax,GetCalorimeter(), ietaMax, iphiMax, rcuMax);
740 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
742 Int_t absId = clus->GetCellsAbsId()[ipos];
744 Int_t ieta=-1; Int_t iphi = 0; Int_t rcu = 0;
745 Int_t sm = GetModuleNumberCellIndexes(absId,GetCalorimeter(), ieta, iphi, rcu);
747 if(dIphi < TMath::Abs(iphi-iphiMax)) dIphi = TMath::Abs(iphi-iphiMax);
751 if(dIeta < TMath::Abs(ieta-ietaMax)) dIeta = TMath::Abs(ieta-ietaMax);
755 Int_t ietaShift = ieta;
756 Int_t ietaMaxShift = ietaMax;
757 if (ieta > ietaMax) ietaMaxShift+=48;
759 if(dIeta < TMath::Abs(ietaShift-ietaMaxShift)) dIeta = TMath::Abs(ietaShift-ietaMaxShift);
762 }// fill cell-cluster histogram loop
765 Float_t dIA = 1.*(dIphi-dIeta)/(dIeta+dIphi);
769 // Was cluster matched?
770 Bool_t matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(),GetReader()->GetInputEvent());
772 if (clus->E() < 2 ) fhDeltaIEtaDeltaIPhiE0[matched]->Fill(dIeta,dIphi);
773 else if(clus->E() < 6 ) fhDeltaIEtaDeltaIPhiE2[matched]->Fill(dIeta,dIphi);
774 else fhDeltaIEtaDeltaIPhiE6[matched]->Fill(dIeta,dIphi);
776 fhDeltaIA[matched]->Fill(clus->E(),dIA);
780 fhDeltaIAL0[matched] ->Fill(clus->GetM02(),dIA);
781 fhDeltaIAL1[matched] ->Fill(clus->GetM20(),dIA);
782 fhDeltaIANCells[matched]->Fill(clus->GetNCells(),dIA);
785 // Origin of clusters
786 Int_t nLabel = clus->GetNLabels();
787 Int_t* labels = clus->GetLabels();
791 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabel, GetReader(),GetCalorimeter());
792 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
793 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
794 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
795 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
796 fhDeltaIAMC[0]->Fill(clus->E(),dIA);//Pure Photon
798 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
799 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
800 fhDeltaIAMC[1]->Fill(clus->E(),dIA);//Pure electron
802 else if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
803 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
804 fhDeltaIAMC[2]->Fill(clus->E(),dIA);//Converted cluster
806 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton)){
807 fhDeltaIAMC[3]->Fill(clus->E(),dIA);//Hadrons
814 if (clus->E() < 2 ) fhBadClusterDeltaIEtaDeltaIPhiE0->Fill(dIeta,dIphi);
815 else if(clus->E() < 6 ) fhBadClusterDeltaIEtaDeltaIPhiE2->Fill(dIeta,dIphi);
816 else fhBadClusterDeltaIEtaDeltaIPhiE6->Fill(dIeta,dIphi);
818 fhBadClusterDeltaIA->Fill(clus->E(),dIA);
822 //__________________________________________________________________________________________________________________
823 void AliAnaCalorimeterQA::ClusterHistograms(AliVCluster* clus, const TObjArray *caloClusters, AliVCaloCells * cells,
824 Int_t absIdMax, Double_t maxCellFraction, Float_t eCrossFrac,
827 //Fill CaloCluster related histograms
829 Double_t tof = clus->GetTOF()*1.e9;
831 fhLambda0 ->Fill(clus->E(),clus->GetM02());
832 fhLambda1 ->Fill(clus->E(),clus->GetM20());
833 fhDispersion ->Fill(clus->E(),clus->GetDispersion());
835 fhClusterMaxCellDiff ->Fill(clus->E(),maxCellFraction);
836 fhClusterMaxCellECross->Fill(clus->E(),eCrossFrac);
837 fhClusterTimeEnergy ->Fill(clus->E(),tof);
839 if(fStudyClustersAsymmetry) ClusterAsymmetryHistograms(clus,absIdMax,kTRUE);
841 //Clusters in event time difference
842 for(Int_t iclus2 = 0; iclus2 < caloClusters->GetEntriesFast(); iclus2++ )
844 AliVCluster* clus2 = (AliVCluster*) caloClusters->At(iclus2);
846 if( clus->GetID() == clus2->GetID() ) continue;
848 if( clus->GetM02() > 0.01 && clus2->GetM02() > 0.01 )
850 Double_t tof2 = clus2->GetTOF()*1.e9;
851 fhClusterPairDiffTimeE ->Fill(clus->E(), tof-tof2);
855 Int_t nModule = GetModuleNumber(clus);
856 Int_t nCaloCellsPerCluster = clus->GetNCells();
858 if(nCaloCellsPerCluster > 1)
860 // check time of cells respect to max energy cell
862 if(fFillAllCellTimeHisto)
864 // Get some time averages
865 Double_t timeAverages[2] = {0.,0.};
866 CalculateAverageTime(clus, cells, timeAverages);
868 fhClusterMaxCellDiffAverageTime ->Fill(clus->E(),tmax-timeAverages[0]);
869 fhClusterMaxCellDiffWeightedTime ->Fill(clus->E(),tmax-timeAverages[1]);
872 for (Int_t ipos = 0; ipos < nCaloCellsPerCluster; ipos++)
874 Int_t absId = clus->GetCellsAbsId()[ipos];
875 if( absId == absIdMax || cells->GetCellAmplitude(absIdMax) < 0.01 ) continue;
877 Float_t frac = cells->GetCellAmplitude(absId)/cells->GetCellAmplitude(absIdMax);
878 fhClusterMaxCellCloseCellRatio->Fill(clus->E(),frac);
879 fhClusterMaxCellCloseCellDiff ->Fill(clus->E(),cells->GetCellAmplitude(absIdMax)-cells->GetCellAmplitude(absId));
881 if(fFillAllCellTimeHisto)
883 Double_t time = cells->GetCellTime(absId);
884 GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
886 Float_t diff = (tmax-time*1.0e9);
887 fhCellTimeSpreadRespectToCellMax->Fill(clus->E(), diff);
888 if(TMath::Abs(TMath::Abs(diff) > 100) && clus->E() > 1 ) fhCellIdCellLargeTimeSpread->Fill(absId);
891 }// fill cell-cluster histogram loop
893 }//check time and energy of cells respect to max energy cell if cluster of more than 1 cell
895 // Get vertex for photon momentum calculation and event selection
896 Double_t v[3] = {0,0,0}; //vertex ;
897 //GetReader()->GetVertex(v); //
900 clus->GetMomentum(mom,v);
903 Float_t pt = mom.Pt();
904 Float_t eta = mom.Eta();
905 Float_t phi = mom.Phi();
906 if(phi < 0) phi +=TMath::TwoPi();
909 printf("AliAnaCalorimeterQA::ClusterHistograms() - cluster: E %2.3f, pT %2.3f, eta %2.3f, phi %2.3f \n",e,pt,eta,phi*TMath::RadToDeg());
913 if(nModule >=0 && nModule < fNModules) fhEMod->Fill(e,nModule);
920 fhEtaPhiE->Fill(eta,phi,e);
923 fhNCellsPerCluster ->Fill(e, nCaloCellsPerCluster);
926 if(fFillAllPosHisto2)
929 clus->GetPosition(pos);
931 fhXE ->Fill(pos[0],e);
932 fhYE ->Fill(pos[1],e);
933 fhZE ->Fill(pos[2],e);
935 fhXYZ ->Fill(pos[0], pos[1],pos[2]);
937 fhXNCells->Fill(pos[0],nCaloCellsPerCluster);
938 fhYNCells->Fill(pos[1],nCaloCellsPerCluster);
939 fhZNCells->Fill(pos[2],nCaloCellsPerCluster);
940 Float_t rxyz = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]);//+pos[2]*pos[2]);
942 fhRNCells->Fill(rxyz ,nCaloCellsPerCluster);
945 if( nModule >= 0 && nModule < fNModules ) fhNCellsPerClusterMod[nModule]->Fill(e, nCaloCellsPerCluster);
949 //____________________________________________________________________________
950 void AliAnaCalorimeterQA::ClusterLoopHistograms(const TObjArray *caloClusters,
951 AliVCaloCells* cells)
953 // Fill clusters related histograms
957 Int_t nCaloClusters = caloClusters->GetEntriesFast() ;
958 Int_t nCaloClustersAccepted = 0 ;
959 Int_t nCaloCellsPerCluster = 0 ;
960 Bool_t matched = kFALSE;
963 // Get vertex for photon momentum calculation and event selection
964 Double_t v[3] = {0,0,0}; //vertex ;
965 //GetReader()->GetVertex(v);
967 Int_t *nClustersInModule = new Int_t[fNModules];
968 for(Int_t imod = 0; imod < fNModules; imod++ ) nClustersInModule[imod] = 0;
971 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - In %s there are %d clusters \n", GetCalorimeter().Data(), nCaloClusters);
973 // Loop over CaloClusters
974 for(Int_t iclus = 0; iclus < nCaloClusters; iclus++)
977 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - cluster: %d/%d, data %d \n",
978 iclus+1,nCaloClusters,GetReader()->GetDataType());
980 AliVCluster* clus = (AliVCluster*) caloClusters->At(iclus);
982 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
983 Float_t maxCellFraction = 0.;
984 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus,maxCellFraction);
986 //Cut on time of clusters
987 Double_t tof = clus->GetTOF()*1.e9;
988 if( tof < fTimeCutMin || tof > fTimeCutMax )
990 if(GetDebug() > 0 )printf("AliAnaCalorimeterQA - Remove cluster with TOF %f\n",tof);
994 // Get cluster kinematics
995 clus->GetMomentum(mom,v);
997 // Check only certain regions
999 if(IsFiducialCutOn()) in = GetFiducialCut()->IsInFiducialCut(mom,GetCalorimeter()) ;
1003 nLabel = clus->GetNLabels();
1004 labels = clus->GetLabels();
1006 // SuperModule number of cluster
1007 nModule = GetModuleNumber(clus);
1009 // Cells per cluster
1010 nCaloCellsPerCluster = clus->GetNCells();
1012 // Cluster mathed with track?
1013 matched = GetCaloPID()->IsTrackMatched(clus,GetCaloUtils(), GetReader()->GetInputEvent());
1015 //Get time of max cell
1016 Double_t tmax = cells->GetCellTime(absIdMax);
1017 GetCaloUtils()->RecalibrateCellTime(tmax, GetCalorimeter(), absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1020 // Fill histograms related to single cluster
1022 // Fill some histograms before applying the exotic cell / bad map cut
1023 fhNCellsPerClusterNoCut ->Fill(clus->E(), nCaloCellsPerCluster);
1024 if(nModule >=0 && nModule < fNModules) fhNCellsPerClusterModNoCut[nModule]->Fill(clus->E(), nCaloCellsPerCluster);
1026 fhClusterMaxCellDiffNoCut->Fill(clus->E(),maxCellFraction);
1028 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
1029 GetCaloUtils()->RecalibrateCellAmplitude(ampMax,GetCalorimeter(), absIdMax);
1031 if(fStudyExotic) ExoticHistograms(absIdMax, ampMax, clus, cells);
1033 //Check bad clusters if requested and rejection was not on
1034 Bool_t goodCluster = IsGoodCluster(absIdMax, cells);
1036 Float_t eCrossFrac = 0;
1037 if(ampMax > 0.01) eCrossFrac = 1-GetECross(absIdMax,cells)/ampMax;
1041 BadClusterHistograms(clus, caloClusters, cells, absIdMax,
1042 maxCellFraction, eCrossFrac, tmax);
1046 ClusterHistograms(clus, caloClusters, cells, absIdMax,
1047 maxCellFraction, eCrossFrac, tmax);
1049 nCaloClustersAccepted++;
1050 nModule = GetModuleNumber(clus);
1051 if(nModule >=0 && nModule < fNModules && mom.E() > 2*fCellAmpMin)
1052 nClustersInModule[nModule]++;
1055 if(fStudyWeight) WeightHistograms(clus, cells);
1057 // Cells in cluster position
1058 if(fFillAllPosHisto) CellInClusterPositionHistograms(clus);
1060 // Fill histograms related to single cluster, mc vs data
1061 Int_t mcOK = kFALSE;
1063 if(IsDataMC() && nLabel > 0 && labels)
1064 mcOK = ClusterMCHistograms(mom, matched, labels, nLabel, pdg);
1066 // Matched clusters with tracks, also do some MC comparison, needs input from ClusterMCHistograms
1067 if( matched && fFillAllTMHisto)
1068 ClusterMatchedWithTrackHistograms(clus,mom,mcOK,pdg);
1071 // Try to reduce background with a mild shower shape cut and no more than 1 maxima
1072 // in cluster and remove low energy clusters
1073 if(fFillAllPi0Histo && nCaloClusters > 1 && nCaloCellsPerCluster > 1 &&
1074 GetCaloUtils()->GetNumberOfLocalMaxima(clus,cells) == 1 &&
1075 clus->GetM02() < 0.5 && clus->E() > fMinInvMassECut)
1076 InvariantMassHistograms(iclus, mom, nModule, caloClusters,cells);
1080 // Number of clusters histograms
1081 if(nCaloClustersAccepted > 0) fhNClusters->Fill(nCaloClustersAccepted);
1083 // Number of clusters per module
1084 for(Int_t imod = 0; imod < fNModules; imod++ )
1087 printf("AliAnaCalorimeterQA::ClusterLoopHistograms() - module %d calo %s clusters %d\n", imod, GetCalorimeter().Data(), nClustersInModule[imod]);
1088 fhNClustersMod->Fill(nClustersInModule[imod],imod);
1091 delete [] nClustersInModule;
1095 //__________________________________________________________________________________________
1096 Bool_t AliAnaCalorimeterQA::ClusterMCHistograms(TLorentzVector mom, Bool_t matched,
1097 const Int_t * labels, Int_t nLabels, Int_t & pdg )
1100 //Fill histograms only possible when simulation
1102 if(!labels || nLabels<=0)
1104 if(GetDebug() > 1) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Strange, labels array %p, n labels %d \n", labels,nLabels);
1110 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Primaries: nlabels %d\n",nLabels);
1113 Float_t e = mom.E();
1114 Float_t eta = mom.Eta();
1115 Float_t phi = mom.Phi();
1116 if(phi < 0) phi +=TMath::TwoPi();
1118 AliAODMCParticle * aodprimary = 0x0;
1119 TParticle * primary = 0x0;
1121 //Play with the MC stack if available
1122 Int_t label = labels[0];
1126 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** bad label ***: label %d \n", label);
1130 Int_t pdg0 =-1; Int_t status = -1; Int_t iMother = -1; Int_t iParent = -1;
1131 Float_t vxMC = 0; Float_t vyMC = 0;
1132 Float_t eMC = 0; //Float_t ptMC= 0;
1133 Float_t phiMC = 0; Float_t etaMC = 0;
1137 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(labels,nLabels, GetReader(),GetCalorimeter());
1139 if ( GetReader()->ReadStack() &&
1140 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1141 { //it MC stack and known tag
1143 if( label >= GetMCStack()->GetNtrack())
1145 if(GetDebug() >= 0) printf("AliAnaCalorimeterQA::ClusterMCHistograms() *** large label ***: label %d, n tracks %d \n", label, GetMCStack()->GetNtrack());
1149 primary = GetMCStack()->Particle(label);
1151 pdg0 = TMath::Abs(primary->GetPdgCode());
1153 status = primary->GetStatusCode();
1154 vxMC = primary->Vx();
1155 vyMC = primary->Vy();
1156 iParent = primary->GetFirstMother();
1160 printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Cluster most contributing mother: \n");
1161 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg0, primary->GetName(),status, iParent);
1164 //Get final particle, no conversion products
1165 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1168 primary = GetMCStack()->Particle(iParent);
1169 pdg = TMath::Abs(primary->GetPdgCode());
1171 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterMCHistograms() - Converted cluster!. Find before conversion: \n");
1173 while((pdg == 22 || pdg == 11) && status != 1)
1175 Int_t iMotherOrg = iMother;
1177 primary = GetMCStack()->Particle(iMother);
1178 status = primary->GetStatusCode();
1179 pdg = TMath::Abs(primary->GetPdgCode());
1180 iParent = primary->GetFirstMother();
1182 // If gone too back and non stable, assign the decay photon/electron
1183 // there are other possible decays, ignore them for the moment
1184 if(pdg==111 || pdg==221)
1186 primary = GetMCStack()->Particle(iMotherOrg);
1196 if(GetDebug() > 1 )printf("\t pdg %d, index %d, %s, status %d \n",pdg, iMother, primary->GetName(),status);
1201 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1202 printf("\t Mother label %d, pdg %d, %s, status %d, parent %d \n",iMother, pdg, primary->GetName(), status, iParent);
1207 //Overlapped pi0 (or eta, there will be very few), get the meson
1208 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1209 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1211 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: \n");
1213 while(pdg != 111 && pdg != 221)
1215 //printf("iMother %d, pdg %d, iParent %d, pdg %d\n",iMother,pdg,iParent,GetMCStack()->Particle(iParent)->GetPdgCode());
1217 primary = GetMCStack()->Particle(iMother);
1218 status = primary->GetStatusCode();
1219 pdg = TMath::Abs(primary->GetPdgCode());
1220 iParent = primary->GetFirstMother();
1222 if( iParent < 0 )break;
1224 if(GetDebug() > 1 ) printf("\t pdg %d, %s, index %d\n",pdg, primary->GetName(),iMother);
1228 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1233 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1234 primary->GetName(),iMother);
1237 eMC = primary->Energy();
1238 //ptMC = primary->Pt();
1239 phiMC = primary->Phi();
1240 etaMC = primary->Eta();
1241 pdg = TMath::Abs(primary->GetPdgCode());
1242 charge = (Int_t) TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1245 else if( GetReader()->ReadAODMCParticles() &&
1246 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCUnknown))
1247 {//it MC AOD and known tag
1248 //Get the list of MC particles
1249 if(!GetReader()->GetAODMCParticles())
1250 AliFatal("MCParticles not available!");
1252 aodprimary = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label);
1254 pdg0 = TMath::Abs(aodprimary->GetPdgCode());
1256 status = aodprimary->IsPrimary();
1257 vxMC = aodprimary->Xv();
1258 vyMC = aodprimary->Yv();
1259 iParent = aodprimary->GetMother();
1261 if( GetDebug() > 1 )
1263 printf("AliAnaCalorimeterQA::ClusterHistograms() - Cluster most contributing mother: \n");
1264 printf("\t Mother label %d, pdg %d, Primary? %d, Physical Primary? %d, parent %d \n",
1265 iMother, pdg0, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary(), iParent);
1268 //Get final particle, no conversion products
1269 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) )
1271 if( GetDebug() > 1 )
1272 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted cluster!. Find before conversion: \n");
1274 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iParent);
1275 pdg = TMath::Abs(aodprimary->GetPdgCode());
1276 while ((pdg == 22 || pdg == 11) && !aodprimary->IsPhysicalPrimary())
1278 Int_t iMotherOrg = iMother;
1280 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMother);
1281 status = aodprimary->IsPrimary();
1282 iParent = aodprimary->GetMother();
1283 pdg = TMath::Abs(aodprimary->GetPdgCode());
1285 // If gone too back and non stable, assign the decay photon/electron
1286 // there are other possible decays, ignore them for the moment
1287 if( pdg == 111 || pdg == 221 )
1289 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMotherOrg);
1299 if( GetDebug() > 1 )
1300 printf("\t pdg %d, index %d, Primary? %d, Physical Primary? %d \n",
1301 pdg, iMother, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1304 if( GetDebug() > 1 )
1306 printf("AliAnaCalorimeterQA::ClusterHistograms() - Converted Cluster mother before conversion: \n");
1307 printf("\t Mother label %d, pdg %d, parent %d, Primary? %d, Physical Primary? %d \n",
1308 iMother, pdg, iParent, aodprimary->IsPrimary(), aodprimary->IsPhysicalPrimary());
1312 //Overlapped pi0 (or eta, there will be very few), get the meson
1313 if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ||
1314 GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta))
1316 if(GetDebug() > 1 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped Meson decay!, Find it: PDG %d, mom %d \n",pdg, iMother);
1318 while(pdg != 111 && pdg != 221)
1321 aodprimary = (AliAODMCParticle*)(GetReader()->GetAODMCParticles())->At(iMother);
1322 status = aodprimary->IsPrimary();
1323 iParent = aodprimary->GetMother();
1324 pdg = TMath::Abs(aodprimary->GetPdgCode());
1326 if( iParent < 0 ) break;
1328 if( GetDebug() > 1 ) printf("\t pdg %d, index %d\n",pdg, iMother);
1332 printf("AliAnaCalorimeterQA::ClusterHistograms() - Tagged as Overlapped photon but meson not found, why?\n");
1337 if(GetDebug() > 2 ) printf("AliAnaCalorimeterQA::ClusterHistograms() - Overlapped %s decay, label %d \n",
1338 aodprimary->GetName(),iMother);
1341 status = aodprimary->IsPrimary();
1342 eMC = aodprimary->E();
1343 //ptMC = aodprimary->Pt();
1344 phiMC = aodprimary->Phi();
1345 etaMC = aodprimary->Eta();
1346 pdg = TMath::Abs(aodprimary->GetPdgCode());
1347 charge = aodprimary->Charge();
1351 //Float_t vz = primary->Vz();
1352 Float_t rVMC = TMath::Sqrt(vxMC*vxMC + vyMC*vyMC);
1353 if( ( pdg == 22 || TMath::Abs(pdg) == 11 ) && status != 1 )
1355 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1356 fhEMR ->Fill(e,rVMC);
1359 //printf("reco e %f, pt %f, phi %f, eta %f \n", e, pt, phi, eta);
1360 //printf("prim e %f, pt %f, phi %f, eta %f \n", eMC,ptMC,phiMC ,etaMC );
1361 //printf("vertex: vx %f, vy %f, vz %f, r %f \n", vxMC, vyMC, vz, r);
1363 //Overlapped pi0 (or eta, there will be very few)
1365 if ( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0 ) )
1368 }//Overlapped pizero decay
1369 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta ) )
1372 }//Overlapped eta decay
1373 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton ) )
1375 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion))
1376 mcIndex = kmcPhotonConv ;
1378 mcIndex = kmcPhoton ;
1380 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) )
1382 mcIndex = kmcElectron;
1383 fhEMVxyz ->Fill(vxMC,vyMC);//,vz);
1384 fhEMR ->Fill(e,rVMC);
1386 else if(charge == 0)
1388 mcIndex = kmcNeHadron;
1389 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1390 fhHaR ->Fill(e,rVMC);
1394 mcIndex = kmcChHadron;
1395 fhHaVxyz ->Fill(vxMC,vyMC);//,vz);
1396 fhHaR ->Fill(e,rVMC);
1399 //printf("mc index %d\n",mcIndex);
1401 if( mcIndex >= 0 && mcIndex < 7 )
1403 fhRecoMCE [mcIndex][(matched)] ->Fill(e,eMC);
1404 if(e > 0.5 && eMC > 0.5) fhRecoMCEta[mcIndex][(matched)]->Fill(eta,etaMC);
1405 if(e > 0.5 && eMC > 0.5) fhRecoMCPhi[mcIndex][(matched)]->Fill(phi,phiMC);
1406 if(eMC > 0) fhRecoMCRatioE [mcIndex][(matched)]->Fill(e,e/eMC);
1407 fhRecoMCDeltaE [mcIndex][(matched)]->Fill(e,eMC-e);
1408 fhRecoMCDeltaPhi[mcIndex][(matched)]->Fill(e,phiMC-phi);
1409 fhRecoMCDeltaEta[mcIndex][(matched)]->Fill(e,etaMC-eta);
1412 if( primary || aodprimary ) return kTRUE ;
1417 //________________________________________________________________________________________________
1418 void AliAnaCalorimeterQA::ClusterMatchedWithTrackHistograms(AliVCluster *clus, TLorentzVector mom,
1419 Bool_t okPrimary, Int_t pdg)
1421 //Histograms for clusters matched with tracks
1423 Float_t e = mom.E();
1424 Float_t pt = mom.Pt();
1425 Float_t eta = mom.Eta();
1426 Float_t phi = mom.Phi();
1427 if(phi < 0) phi +=TMath::TwoPi();
1429 fhECharged ->Fill(e);
1430 fhPtCharged ->Fill(pt);
1431 fhPhiCharged ->Fill(phi);
1432 fhEtaCharged ->Fill(eta);
1434 //Study the track and matched cluster if track exists.
1436 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(clus, GetReader()->GetInputEvent());
1440 Double_t tpt = track->Pt();
1441 Double_t tmom = track->P();
1442 Double_t dedx = track->GetTPCsignal();
1443 Int_t nITS = track->GetNcls(0);
1444 Int_t nTPC = track->GetNcls(1);
1445 Bool_t positive = kFALSE;
1446 if(track) positive = (track->Charge()>0);
1449 Float_t deta = clus->GetTrackDz();
1450 Float_t dphi = clus->GetTrackDx();
1451 Double_t dR = TMath::Sqrt(dphi*dphi + deta*deta);
1453 if(TMath::Abs(dphi) < 999)
1455 fhTrackMatchedDEta->Fill(e,deta);
1456 fhTrackMatchedDPhi->Fill(e,dphi);
1457 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(deta,dphi);
1459 if(track && positive)
1461 fhTrackMatchedDEtaPos->Fill(e,deta);
1462 fhTrackMatchedDPhiPos->Fill(e,dphi);
1463 if(e > 0.5) fhTrackMatchedDEtaDPhiPos->Fill(deta,dphi);
1467 Double_t eOverP = e/tmom;
1468 fh1EOverP->Fill(tpt, eOverP);
1471 fh1EOverPR02->Fill(tpt,eOverP);
1472 if(dedx > 60 && dedx < 100) fh1EleEOverP->Fill(tpt,eOverP);
1476 fh2MatchdEdx->Fill(tmom,dedx);
1478 if(IsDataMC() && okPrimary)
1480 Double_t charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge();
1482 if(TMath::Abs(pdg) == 11)
1484 fhMCEle1EOverP->Fill(tpt,eOverP);
1485 fhMCEle1dR->Fill(dR);
1486 fhMCEle2MatchdEdx->Fill(tmom,dedx);
1489 fhMCEle1EOverPR02->Fill(tpt,eOverP);
1490 if(dedx > 60 && dedx < 100) fhMCEle1EleEOverP->Fill(tpt,eOverP);
1495 fhMCChHad1EOverP->Fill(tpt,eOverP);
1496 fhMCChHad1dR->Fill(dR);
1497 fhMCChHad2MatchdEdx->Fill(tmom,dedx);
1500 fhMCChHad1EOverPR02->Fill(tpt,eOverP);
1501 if(dedx > 60 && dedx < 100) fhMCChHad1EleEOverP->Fill(tpt,eOverP);
1504 else if(charge == 0)
1506 fhMCNeutral1EOverP->Fill(tpt,eOverP);
1507 fhMCNeutral1dR->Fill(dR);
1508 fhMCNeutral2MatchdEdx->Fill(tmom,dedx);
1511 fhMCNeutral1EOverPR02->Fill(tpt,eOverP);
1512 if(dedx > 60 && dedx < 100) fhMCNeutral1EleEOverP->Fill(tpt,eOverP);
1517 if(dR < 0.02 && eOverP > 0.6 && eOverP < 1.2
1518 && clus->GetNCells() > 1 && nITS > 3 && nTPC > 20)
1520 fh2EledEdx->Fill(tmom,dedx);
1525 //___________________________________
1526 void AliAnaCalorimeterQA::Correlate()
1528 // Correlate information from PHOS and EMCAL and with V0 and track multiplicity
1531 TObjArray * caloClustersEMCAL = GetEMCALClusters();
1532 TObjArray * caloClustersPHOS = GetPHOSClusters();
1534 if(!caloClustersEMCAL || !caloClustersPHOS)
1536 if( GetDebug() > 0 ) printf("AliAnaCalorimeterQA::Correlate() - PHOS (%p) or EMCAL (%p) clusters array not available, do not correlate\n",
1537 caloClustersPHOS,caloClustersEMCAL);
1542 AliVCaloCells * cellsEMCAL = GetEMCALCells();
1543 AliVCaloCells * cellsPHOS = GetPHOSCells();
1545 if(!cellsEMCAL || !cellsPHOS)
1547 if( GetDebug() > 0 ) printf("AliAnaCalorimeterQA::Correlate() - PHOS (%p) or EMCAL (%p) cells array ot available, do not correlate\n",
1548 cellsPHOS,cellsEMCAL);
1552 // Clusters parameters
1553 Int_t nclEMCAL = caloClustersEMCAL->GetEntriesFast();
1554 Int_t nclPHOS = caloClustersPHOS ->GetEntriesFast();
1556 Float_t cen = GetEventCentrality();
1557 Float_t ep = GetEventPlaneAngle();
1559 Float_t sumClusterEnergyEMCAL = 0;
1560 Float_t sumClusterEnergyPHOS = 0;
1562 for(iclus = 0 ; iclus < caloClustersEMCAL->GetEntriesFast() ; iclus++)
1563 sumClusterEnergyEMCAL += ((AliVCluster*)caloClustersEMCAL->At(iclus))->E();
1564 for(iclus = 0 ; iclus < caloClustersPHOS->GetEntriesFast(); iclus++)
1565 sumClusterEnergyPHOS += ((AliVCluster*)caloClustersPHOS->At(iclus))->E();
1568 Int_t ncellsEMCAL = cellsEMCAL->GetNumberOfCells();
1569 Int_t ncellsPHOS = cellsPHOS ->GetNumberOfCells();
1571 Float_t sumCellEnergyEMCAL = 0;
1572 Float_t sumCellEnergyPHOS = 0;
1574 for(icell = 0 ; icell < cellsEMCAL->GetNumberOfCells() ; icell++)
1575 sumCellEnergyEMCAL += cellsEMCAL->GetAmplitude(icell);
1576 for(icell = 0 ; icell < cellsPHOS->GetNumberOfCells(); icell++)
1577 sumCellEnergyPHOS += cellsPHOS->GetAmplitude(icell);
1581 fhCaloCorrNClusters->Fill(nclEMCAL,nclPHOS);
1582 fhCaloCorrEClusters->Fill(sumClusterEnergyEMCAL,sumClusterEnergyPHOS);
1583 fhCaloCorrNCells ->Fill(ncellsEMCAL,ncellsPHOS);
1584 fhCaloCorrECells ->Fill(sumCellEnergyEMCAL,sumCellEnergyPHOS);
1586 Int_t v0S = GetV0Signal(0)+GetV0Signal(1);
1587 Int_t v0M = GetV0Multiplicity(0)+GetV0Multiplicity(1);
1588 Int_t trM = GetTrackMultiplicity();
1589 if(GetCalorimeter()=="PHOS")
1591 fhCaloV0MCorrNClusters ->Fill(v0M,nclPHOS);
1592 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyPHOS);
1593 fhCaloV0MCorrNCells ->Fill(v0M,ncellsPHOS);
1594 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyPHOS);
1596 fhCaloV0SCorrNClusters ->Fill(v0S,nclPHOS);
1597 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyPHOS);
1598 fhCaloV0SCorrNCells ->Fill(v0S,ncellsPHOS);
1599 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyPHOS);
1601 fhCaloTrackMCorrNClusters->Fill(trM,nclPHOS);
1602 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyPHOS);
1603 fhCaloTrackMCorrNCells ->Fill(trM,ncellsPHOS);
1604 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyPHOS);
1606 fhCaloCenNClusters ->Fill(cen,nclPHOS);
1607 fhCaloCenEClusters ->Fill(cen,sumClusterEnergyPHOS);
1608 fhCaloCenNCells ->Fill(cen,ncellsPHOS);
1609 fhCaloCenECells ->Fill(cen,sumCellEnergyPHOS);
1611 fhCaloEvPNClusters ->Fill(ep ,nclPHOS);
1612 fhCaloEvPEClusters ->Fill(ep ,sumClusterEnergyPHOS);
1613 fhCaloEvPNCells ->Fill(ep ,ncellsPHOS);
1614 fhCaloEvPECells ->Fill(ep ,sumCellEnergyPHOS);
1618 fhCaloV0MCorrNClusters ->Fill(v0M,nclEMCAL);
1619 fhCaloV0MCorrEClusters ->Fill(v0M,sumClusterEnergyEMCAL);
1620 fhCaloV0MCorrNCells ->Fill(v0M,ncellsEMCAL);
1621 fhCaloV0MCorrECells ->Fill(v0M,sumCellEnergyEMCAL);
1623 fhCaloV0SCorrNClusters ->Fill(v0S,nclEMCAL);
1624 fhCaloV0SCorrEClusters ->Fill(v0S,sumClusterEnergyEMCAL);
1625 fhCaloV0SCorrNCells ->Fill(v0S,ncellsEMCAL);
1626 fhCaloV0SCorrECells ->Fill(v0S,sumCellEnergyEMCAL);
1628 fhCaloTrackMCorrNClusters->Fill(trM,nclEMCAL);
1629 fhCaloTrackMCorrEClusters->Fill(trM,sumClusterEnergyEMCAL);
1630 fhCaloTrackMCorrNCells ->Fill(trM,ncellsEMCAL);
1631 fhCaloTrackMCorrECells ->Fill(trM,sumCellEnergyEMCAL);
1633 fhCaloCenNClusters ->Fill(cen,nclEMCAL);
1634 fhCaloCenEClusters ->Fill(cen,sumClusterEnergyEMCAL);
1635 fhCaloCenNCells ->Fill(cen,ncellsEMCAL);
1636 fhCaloCenECells ->Fill(cen,sumCellEnergyEMCAL);
1638 fhCaloEvPNClusters ->Fill(ep ,nclEMCAL);
1639 fhCaloEvPEClusters ->Fill(ep ,sumClusterEnergyEMCAL);
1640 fhCaloEvPNCells ->Fill(ep ,ncellsEMCAL);
1641 fhCaloEvPECells ->Fill(ep ,sumCellEnergyEMCAL);
1646 printf("AliAnaCalorimeterQA::Correlate(): \n");
1647 printf("\t EMCAL: N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1648 ncellsEMCAL,nclEMCAL, sumCellEnergyEMCAL,sumClusterEnergyEMCAL);
1649 printf("\t PHOS : N cells %d, N clusters %d, summed E cells %f, summed E clusters %f \n",
1650 ncellsPHOS,nclPHOS,sumCellEnergyPHOS,sumClusterEnergyPHOS);
1651 printf("\t V0 : Signal %d, Multiplicity %d, Track Multiplicity %d \n", v0S,v0M,trM);
1652 printf("\t centrality : %f, Event plane angle %f \n", cen,ep);
1657 //__________________________________________________
1658 TObjString * AliAnaCalorimeterQA::GetAnalysisCuts()
1660 //Save parameters used for analysis
1661 TString parList ; //this will be list of parameters used for this analysis.
1662 const Int_t buffersize = 255;
1663 char onePar[buffersize] ;
1665 snprintf(onePar,buffersize,"--- AliAnaCalorimeterQA ---\n") ;
1667 snprintf(onePar,buffersize,"Calorimeter: %s\n",GetCalorimeter().Data()) ;
1669 snprintf(onePar,buffersize,"Time Cut : %2.2f < T < %2.2f ns \n",fTimeCutMin, fTimeCutMax) ;
1671 snprintf(onePar,buffersize,"PHOS Cell Amplitude > %2.2f GeV, EMCAL Cell Amplitude > %2.2f GeV \n",fPHOSCellAmpMin, fEMCALCellAmpMin) ;
1673 snprintf(onePar,buffersize,"Inv. Mass E1, E2 > %2.2f GeV \n",fMinInvMassECut) ;
1676 //Get parameters set in base class.
1677 //parList += GetBaseParametersList() ;
1679 //Get parameters set in FiducialCut class (not available yet)
1680 //parlist += GetFidCut()->GetFidCutParametersList()
1682 return new TObjString(parList) ;
1685 //_________________________________________________________________________________
1686 void AliAnaCalorimeterQA::ExoticHistograms(Int_t absIdMax, Float_t ampMax,
1687 AliVCluster *clus, AliVCaloCells* cells)
1689 // Calculate weights
1693 printf("AliAnaCalorimeterQA::ExoticHistograms()- Low amplitude energy %f\n",ampMax);
1697 Float_t l0 = clus->GetM02();
1698 Float_t l1 = clus->GetM20();
1699 Float_t en = clus->E();
1700 Int_t nc = clus->GetNCells();
1701 Double_t tmax = clus->GetTOF()*1.e9; // recalibrated elsewhere
1703 Float_t eCrossFrac = 1-GetECross(absIdMax,cells, 10000000)/ampMax;
1707 fhExoL0ECross->Fill(eCrossFrac,l0);
1708 fhExoL1ECross->Fill(eCrossFrac,l1);
1711 for(Int_t ie = 0; ie < fExoNECrossCuts; ie++)
1713 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1715 eCrossFrac = 1-GetECross(absIdMax,cells, fExoDTimeCuts[idt])/ampMax;
1717 if(eCrossFrac > fExoECrossCuts[ie])
1720 fhExoL0 [ie][idt]->Fill(en,l0 );
1721 fhExoL1 [ie][idt]->Fill(en,l1 );
1722 fhExoTime [ie][idt]->Fill(en,tmax);
1726 fhExoL0NCell[ie][idt]->Fill(nc,l0);
1727 fhExoL1NCell[ie][idt]->Fill(nc,l1);
1730 // Diff time, do for one cut in e cross
1733 for (Int_t icell = 0; icell < clus->GetNCells(); icell++)
1735 Int_t absId = clus->GetCellsAbsId()[icell];
1736 Double_t time = cells->GetCellTime(absId);
1737 GetCaloUtils()->RecalibrateCellTime(time, GetCalorimeter(), absId,GetReader()->GetInputEvent()->GetBunchCrossNumber());
1739 Float_t diff = (tmax-time)*1e9;
1740 fhExoDTime[idt]->Fill(en, diff);
1746 fhExoECross[ie][idt]->Fill(en,eCrossFrac);
1747 fhExoNCell [ie][idt]->Fill(en,nc);
1749 } // D time cut loop
1750 } // e cross cut loop
1753 //____________________________________________________
1754 TList * AliAnaCalorimeterQA::GetCreateOutputObjects()
1756 // Create histograms to be saved in output file and
1757 // store them in outputContainer
1759 TList * outputContainer = new TList() ;
1760 outputContainer->SetName("QAHistos") ;
1762 // Init the number of modules, set in the class AliCalorimeterUtils
1763 fNModules = GetCaloUtils()->GetNumberOfSuperModulesUsed();
1764 if(GetCalorimeter()=="PHOS" && fNModules > 4) fNModules = 4;
1767 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1768 Int_t nfineptbins = GetHistogramRanges()->GetHistoFinePtBins(); Float_t ptfinemax = GetHistogramRanges()->GetHistoFinePtMax(); Float_t ptfinemin = GetHistogramRanges()->GetHistoFinePtMin();
1769 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1770 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1771 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins(); Float_t massmax = GetHistogramRanges()->GetHistoMassMax(); Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
1772 Int_t nasymbins = GetHistogramRanges()->GetHistoAsymmetryBins(); Float_t asymmax = GetHistogramRanges()->GetHistoAsymmetryMax(); Float_t asymmin = GetHistogramRanges()->GetHistoAsymmetryMin();
1773 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins(); Float_t eOverPmax = GetHistogramRanges()->GetHistoPOverEMax(); Float_t eOverPmin = GetHistogramRanges()->GetHistoPOverEMin();
1774 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins(); Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax(); Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1775 Int_t ndRbins = GetHistogramRanges()->GetHistodRBins(); Float_t dRmax = GetHistogramRanges()->GetHistodRMax(); Float_t dRmin = GetHistogramRanges()->GetHistodRMin();
1776 Int_t ntimebins = GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1777 Int_t nclbins = GetHistogramRanges()->GetHistoNClustersBins(); Int_t nclmax = GetHistogramRanges()->GetHistoNClustersMax(); Int_t nclmin = GetHistogramRanges()->GetHistoNClustersMin();
1778 Int_t ncebins = GetHistogramRanges()->GetHistoNCellsBins(); Int_t ncemax = GetHistogramRanges()->GetHistoNCellsMax(); Int_t ncemin = GetHistogramRanges()->GetHistoNCellsMin();
1779 Int_t nceclbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nceclmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nceclmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1780 Int_t nvdistbins = GetHistogramRanges()->GetHistoVertexDistBins(); Float_t vdistmax = GetHistogramRanges()->GetHistoVertexDistMax(); Float_t vdistmin = GetHistogramRanges()->GetHistoVertexDistMin();
1781 Int_t rbins = GetHistogramRanges()->GetHistoRBins(); Float_t rmax = GetHistogramRanges()->GetHistoRMax(); Float_t rmin = GetHistogramRanges()->GetHistoRMin();
1782 Int_t xbins = GetHistogramRanges()->GetHistoXBins(); Float_t xmax = GetHistogramRanges()->GetHistoXMax(); Float_t xmin = GetHistogramRanges()->GetHistoXMin();
1783 Int_t ybins = GetHistogramRanges()->GetHistoYBins(); Float_t ymax = GetHistogramRanges()->GetHistoYMax(); Float_t ymin = GetHistogramRanges()->GetHistoYMin();
1784 Int_t zbins = GetHistogramRanges()->GetHistoZBins(); Float_t zmax = GetHistogramRanges()->GetHistoZMax(); Float_t zmin = GetHistogramRanges()->GetHistoZMin();
1785 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1786 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
1788 Int_t nv0sbins = GetHistogramRanges()->GetHistoV0SignalBins(); Int_t nv0smax = GetHistogramRanges()->GetHistoV0SignalMax(); Int_t nv0smin = GetHistogramRanges()->GetHistoV0SignalMin();
1789 Int_t nv0mbins = GetHistogramRanges()->GetHistoV0MultiplicityBins(); Int_t nv0mmax = GetHistogramRanges()->GetHistoV0MultiplicityMax(); Int_t nv0mmin = GetHistogramRanges()->GetHistoV0MultiplicityMin();
1790 Int_t ntrmbins = GetHistogramRanges()->GetHistoTrackMultiplicityBins(); Int_t ntrmmax = GetHistogramRanges()->GetHistoTrackMultiplicityMax(); Int_t ntrmmin = GetHistogramRanges()->GetHistoTrackMultiplicityMin();
1797 if(GetCalorimeter()=="PHOS")
1804 fhE = new TH1F ("hE","#it{E} reconstructed clusters ", nptbins*5,ptmin,ptmax*5);
1805 fhE->SetXTitle("#it{E} (GeV)");
1806 outputContainer->Add(fhE);
1808 fhPt = new TH1F ("hPt","#it{p}_{T} reconstructed clusters", nptbins,ptmin,ptmax);
1809 fhPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1810 outputContainer->Add(fhPt);
1812 fhPhi = new TH1F ("hPhi","#phi reconstructed clusters ",nphibins,phimin,phimax);
1813 fhPhi->SetXTitle("#phi (rad)");
1814 outputContainer->Add(fhPhi);
1816 fhEta = new TH1F ("hEta","#eta reconstructed clusters ",netabins,etamin,etamax);
1817 fhEta->SetXTitle("#eta ");
1818 outputContainer->Add(fhEta);
1823 fhEtaPhiE = new TH3F ("hEtaPhiE","#eta vs #phi vs energy, reconstructed clusters",
1824 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
1825 fhEtaPhiE->SetXTitle("#eta ");
1826 fhEtaPhiE->SetYTitle("#phi (rad)");
1827 fhEtaPhiE->SetZTitle("#it{E} (GeV) ");
1828 outputContainer->Add(fhEtaPhiE);
1831 fhClusterTimeEnergy = new TH2F ("hClusterTimeEnergy","energy vs TOF, reconstructed clusters",
1832 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1833 fhClusterTimeEnergy->SetXTitle("#it{E} (GeV) ");
1834 fhClusterTimeEnergy->SetYTitle("TOF (ns)");
1835 outputContainer->Add(fhClusterTimeEnergy);
1837 fhClusterPairDiffTimeE = new TH2F("hClusterPairDiffTimeE","cluster pair time difference vs E, only good clusters",
1838 nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1839 fhClusterPairDiffTimeE->SetXTitle("#it{E}_{cluster} (GeV)");
1840 fhClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
1841 outputContainer->Add(fhClusterPairDiffTimeE);
1843 fhLambda0 = new TH2F ("hLambda0","shower shape, #lambda^{2}_{0} vs E",
1844 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1845 fhLambda0->SetXTitle("#it{E}_{cluster}");
1846 fhLambda0->SetYTitle("#lambda^{2}_{0}");
1847 outputContainer->Add(fhLambda0);
1849 fhLambda1 = new TH2F ("hLambda1","shower shape, #lambda^{2}_{1} vs E for bad cluster ",
1850 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1851 fhLambda1->SetXTitle("#it{E}_{cluster}");
1852 fhLambda1->SetYTitle("#lambda^{2}_{1}");
1853 outputContainer->Add(fhLambda1);
1855 fhDispersion = new TH2F ("hDispersion","shower shape, Dispersion^{2} vs E for bad cluster ",
1856 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1857 fhDispersion->SetXTitle("#it{E}_{cluster}");
1858 fhDispersion->SetYTitle("Dispersion");
1859 outputContainer->Add(fhDispersion);
1861 fhClusterMaxCellCloseCellRatio = new TH2F ("hClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1862 nptbins,ptmin,ptmax, 100,0,1.);
1863 fhClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
1864 fhClusterMaxCellCloseCellRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cell max}");
1865 outputContainer->Add(fhClusterMaxCellCloseCellRatio);
1867 fhClusterMaxCellCloseCellDiff = new TH2F ("hClusterMaxCellCloseCellDiff","energy vs ratio of max cell / neighbour cell, reconstructed clusters",
1868 nptbins,ptmin,ptmax, 500,0,100.);
1869 fhClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1870 fhClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max}-#it{E}_{cell i} (GeV)");
1871 outputContainer->Add(fhClusterMaxCellCloseCellDiff);
1873 fhClusterMaxCellDiff = new TH2F ("hClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1874 nptbins,ptmin,ptmax, 500,0,1.);
1875 fhClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1876 fhClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1877 outputContainer->Add(fhClusterMaxCellDiff);
1879 fhClusterMaxCellDiffNoCut = new TH2F ("hClusterMaxCellDiffNoCut","energy vs difference of cluster energy - max cell energy / cluster energy",
1880 nptbins,ptmin,ptmax, 500,0,1.);
1881 fhClusterMaxCellDiffNoCut->SetXTitle("#it{E}_{cluster} (GeV) ");
1882 fhClusterMaxCellDiffNoCut->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max})/ #it{E}_{cluster}");
1883 outputContainer->Add(fhClusterMaxCellDiffNoCut);
1885 fhClusterMaxCellECross = new TH2F ("hClusterMaxCellECross","1 - Energy in cross around max energy cell / max energy cell vs cluster energy, good clusters",
1886 nptbins,ptmin,ptmax, 400,-1,1.);
1887 fhClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
1888 fhClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
1889 outputContainer->Add(fhClusterMaxCellECross);
1891 fhNCellsPerClusterNoCut = new TH2F ("hNCellsPerClusterNoCut","# cells per cluster vs energy, no bad clusters cut",
1892 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1893 fhNCellsPerClusterNoCut->SetXTitle("#it{E} (GeV)");
1894 fhNCellsPerClusterNoCut->SetYTitle("#it{n}_{cells}");
1895 outputContainer->Add(fhNCellsPerClusterNoCut);
1897 fhNCellsPerCluster = new TH2F ("hNCellsPerCluster","# cells per cluster vs energy",nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
1898 fhNCellsPerCluster->SetXTitle("#it{E} (GeV)");
1899 fhNCellsPerCluster->SetYTitle("#it{n}_{cells}");
1900 outputContainer->Add(fhNCellsPerCluster);
1902 fhNClusters = new TH1F ("hNClusters","# clusters", nclbins,nclmin,nclmax);
1903 fhNClusters->SetXTitle("#it{n}_{clusters}");
1904 outputContainer->Add(fhNClusters);
1906 if(fStudyBadClusters)
1908 fhBadClusterEnergy = new TH1F ("hBadClusterEnergy","Bad cluster energy", nptbins,ptmin,ptmax);
1909 fhBadClusterEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
1910 outputContainer->Add(fhBadClusterEnergy);
1912 fhBadClusterMaxCellCloseCellRatio = new TH2F ("hBadClusterMaxCellCloseCellRatio","energy vs ratio of max cell / neighbour cell constributing cell, reconstructed bad clusters",
1913 nptbins,ptmin,ptmax, 100,0,1.);
1914 fhBadClusterMaxCellCloseCellRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
1915 fhBadClusterMaxCellCloseCellRatio->SetYTitle("ratio");
1916 outputContainer->Add(fhBadClusterMaxCellCloseCellRatio);
1918 fhBadClusterMaxCellCloseCellDiff = new TH2F ("hBadClusterMaxCellCloseCellDiff","energy vs ratio of max cell - neighbour cell constributing cell, reconstructed bad clusters",
1919 nptbins,ptmin,ptmax, 500,0,100);
1920 fhBadClusterMaxCellCloseCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1921 fhBadClusterMaxCellCloseCellDiff->SetYTitle("#it{E}_{cell max} - #it{E}_{cell i} (GeV)");
1922 outputContainer->Add(fhBadClusterMaxCellCloseCellDiff);
1924 fhBadClusterMaxCellDiff = new TH2F ("hBadClusterMaxCellDiff","energy vs difference of cluster energy - max cell energy / cluster energy for bad clusters",
1925 nptbins,ptmin,ptmax, 500,0,1.);
1926 fhBadClusterMaxCellDiff->SetXTitle("#it{E}_{cluster} (GeV) ");
1927 fhBadClusterMaxCellDiff->SetYTitle("(#it{E}_{cluster} - #it{E}_{cell max}) / #it{E}_{cluster}");
1928 outputContainer->Add(fhBadClusterMaxCellDiff);
1930 fhBadClusterTimeEnergy = new TH2F ("hBadClusterTimeEnergy","energy vs TOF of reconstructed bad clusters",
1931 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1932 fhBadClusterTimeEnergy->SetXTitle("#it{E}_{cluster} (GeV) ");
1933 fhBadClusterTimeEnergy->SetYTitle("#it{t} (ns)");
1934 outputContainer->Add(fhBadClusterTimeEnergy);
1936 fhBadClusterPairDiffTimeE = new TH2F("hBadClusterPairDiffTimeE","cluster pair time difference (bad - good) vs E from bad cluster",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1937 fhBadClusterPairDiffTimeE->SetXTitle("#it{E}_{bad cluster} (GeV)");
1938 fhBadClusterPairDiffTimeE->SetYTitle("#Delta #it{t} (ns)");
1939 outputContainer->Add(fhBadClusterPairDiffTimeE);
1941 fhBadClusterMaxCellECross = new TH2F ("hBadClusterMaxCellECross","1 - #it{E}_{+} around max energy cell / max energy cell vs cluster energy, bad clusters",
1942 nptbins,ptmin,ptmax, 400,-1,1.);
1943 fhBadClusterMaxCellECross->SetXTitle("#it{E}_{cluster} (GeV) ");
1944 fhBadClusterMaxCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell max}");
1945 outputContainer->Add(fhBadClusterMaxCellECross);
1947 if(fFillAllCellTimeHisto)
1949 fhBadCellTimeSpreadRespectToCellMax = new TH2F ("hBadCellTimeSpreadRespectToCellMax","#it{t}_{cell max}-#it{t}_{cell i} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1950 fhBadCellTimeSpreadRespectToCellMax->SetXTitle("#it{E} (GeV)");
1951 fhBadCellTimeSpreadRespectToCellMax->SetYTitle("#Delta #it{t}_{cell max - i} (ns)");
1952 outputContainer->Add(fhBadCellTimeSpreadRespectToCellMax);
1954 fhBadClusterMaxCellDiffAverageTime = new TH2F ("hBadClusterMaxCellDiffAverageTime","#it{t}_{cell max}-#it{t}_{average} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1955 fhBadClusterMaxCellDiffAverageTime->SetXTitle("#it{E} (GeV)");
1956 fhBadClusterMaxCellDiffAverageTime->SetYTitle("#Delta #it{t}_{cell max - average} (ns)");
1957 outputContainer->Add(fhBadClusterMaxCellDiffAverageTime);
1959 fhBadClusterMaxCellDiffWeightedTime = new TH2F ("hBadClusterMaxCellDiffWeightedTime","#it{t}_{cell max}-#it{t}_{weighted} from bad cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1960 fhBadClusterMaxCellDiffWeightedTime->SetXTitle("#it{E} (GeV)");
1961 fhBadClusterMaxCellDiffWeightedTime->SetYTitle("#Delta #it{t}_{cell max - weighted} (ns)");
1962 outputContainer->Add(fhBadClusterMaxCellDiffWeightedTime);
1970 fhExoL0ECross = new TH2F("hExoL0_ECross",
1971 "#lambda^{2}_{0} vs 1-#it{E}_{+}/#it{E}_{max} for E > 5 GeV",
1972 400,0,1,ssbins,ssmin,ssmax);
1973 fhExoL0ECross ->SetXTitle("1-#it{E}_{+}/#it{E}_{cell max}");
1974 fhExoL0ECross ->SetYTitle("#lambda^{2}_{0}");
1975 outputContainer->Add(fhExoL0ECross) ;
1977 fhExoL1ECross = new TH2F("hExoL1_ECross",
1978 "#lambda^{2}_{1} vs 1-#it{E}_{+}/#it{E}_{max} for E > 5 GeV",
1979 400,0,1,ssbins,ssmin,ssmax);
1980 fhExoL1ECross ->SetXTitle("1-#it{E}_{+}/#it{E}_{cell max}");
1981 fhExoL1ECross ->SetYTitle("#lambda^{2}_{1}");
1982 outputContainer->Add(fhExoL1ECross) ;
1984 for(Int_t ie = 0; ie <fExoNECrossCuts; ie++)
1987 fhExoDTime[ie] = new TH2F(Form("hExoDTime_ECross%d",ie),
1988 Form("#Delta time = t_{max}-t_{cells} vs #it{E}_{cluster} for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f",fExoECrossCuts[ie]),
1989 nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
1990 fhExoDTime[ie] ->SetYTitle("#Delta #it{t} (ns)");
1991 fhExoDTime[ie] ->SetXTitle("#it{E} (GeV)");
1992 outputContainer->Add(fhExoDTime[ie]) ;
1994 for(Int_t idt = 0; idt < fExoNDTimeCuts; idt++)
1996 fhExoNCell[ie][idt] = new TH2F(Form("hExoNCell_ECross%d_DT%d",ie,idt),
1997 Form("N cells per cluster vs E cluster, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
1998 nptbins,ptmin,ptmax,nceclbins,nceclmin,nceclmax);
1999 fhExoNCell[ie][idt] ->SetYTitle("#it{n}_cells");
2000 fhExoNCell[ie][idt] ->SetXTitle("#it{E} (GeV)");
2001 outputContainer->Add(fhExoNCell[ie][idt]) ;
2003 fhExoL0 [ie][idt] = new TH2F(Form("hExoL0_ECross%d_DT%d",ie,idt),
2004 Form("#lambda^{2}_{0} vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2005 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2006 fhExoL0 [ie][idt] ->SetYTitle("#lambda^{2}_{0}");
2007 fhExoL0 [ie][idt] ->SetXTitle("#it{E} (GeV)");
2008 outputContainer->Add(fhExoL0[ie][idt]) ;
2010 fhExoL1 [ie][idt] = new TH2F(Form("hExoL1_ECross%d_DT%d",ie,idt),
2011 Form("#lambda^{2}_{1} vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2012 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2013 fhExoL1 [ie][idt] ->SetYTitle("#lambda^{2}_{1}");
2014 fhExoL1 [ie][idt] ->SetXTitle("#it{E} (GeV)");
2015 outputContainer->Add(fhExoL1[ie][idt]) ;
2017 fhExoECross[ie][idt] = new TH2F(Form("hExoECross_ECross%d_DT%d",ie,idt),
2018 Form("#it{E} cross for cells vs E cell, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t < %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2019 nptbins,ptmin,ptmax,400,0,1);
2020 fhExoECross[ie][idt] ->SetYTitle("1-#it{E}_{+}/#it{E}_{cell max}");
2021 fhExoECross[ie][idt] ->SetXTitle("#it{E}_{cell} (GeV)");
2022 outputContainer->Add(fhExoECross[ie][idt]) ;
2024 fhExoTime [ie][idt] = new TH2F(Form("hExoTime_ECross%d_DT%d",ie,idt),
2025 Form("Time of cluster (max cell) vs E cluster for exotic, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2026 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2027 fhExoTime [ie][idt] ->SetYTitle("#it{t}_{max} (ns)");
2028 fhExoTime [ie][idt] ->SetXTitle("#it{E} (GeV)");
2029 outputContainer->Add(fhExoTime[ie][idt]) ;
2031 fhExoL0NCell[ie][idt] = new TH2F(Form("hExoL0_NCell%d_DT%d",ie,idt),
2032 Form("#lambda^{2}_{0} vs N cells per clusters for E > 5 GeV, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2033 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2034 fhExoL0NCell[ie][idt] ->SetYTitle("#it{n}_{cells}");
2035 fhExoL0NCell[ie][idt] ->SetXTitle("#lambda^{2}_{0}");
2036 outputContainer->Add(fhExoL0NCell[ie][idt]) ;
2038 fhExoL1NCell[ie][idt] = new TH2F(Form("hExoL1_NCell%d_DT%d",ie,idt),
2039 Form("#lambda^{2}_{1} vs N cells per clusters for E > 5 GeV, 1-#it{E}_{+}/#it{E}_{max} < %2.2f, #Delta t = %2.0f",fExoECrossCuts[ie],fExoDTimeCuts[idt]),
2040 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2041 fhExoL1NCell[ie][idt] ->SetYTitle("#it{n}_{cells}");
2042 fhExoL1NCell[ie][idt] ->SetXTitle("#lambda^{2}_{1}");
2043 outputContainer->Add(fhExoL1NCell[ie][idt]) ;
2049 // Cluster size in terms of cells
2050 if(fStudyClustersAsymmetry)
2052 fhDeltaIEtaDeltaIPhiE0[0] = new TH2F ("hDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3",
2054 fhDeltaIEtaDeltaIPhiE0[0]->SetXTitle("#Delta Column");
2055 fhDeltaIEtaDeltaIPhiE0[0]->SetYTitle("#Delta Row");
2056 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[0]);
2058 fhDeltaIEtaDeltaIPhiE2[0] = new TH2F ("hDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3",
2060 fhDeltaIEtaDeltaIPhiE2[0]->SetXTitle("#Delta Column");
2061 fhDeltaIEtaDeltaIPhiE2[0]->SetYTitle("#Delta Row");
2062 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[0]);
2064 fhDeltaIEtaDeltaIPhiE6[0] = new TH2F ("hDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3",
2066 fhDeltaIEtaDeltaIPhiE6[0]->SetXTitle("#Delta Column");
2067 fhDeltaIEtaDeltaIPhiE6[0]->SetYTitle("#Delta Row");
2068 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[0]);
2070 fhDeltaIA[0] = new TH2F ("hDeltaIA"," Cluster *asymmetry* in cell units vs E",
2071 nptbins,ptmin,ptmax,21,-1.05,1.05);
2072 fhDeltaIA[0]->SetXTitle("#it{E}_{cluster}");
2073 fhDeltaIA[0]->SetYTitle("#it{A}_{cell in cluster}");
2074 outputContainer->Add(fhDeltaIA[0]);
2076 fhDeltaIAL0[0] = new TH2F ("hDeltaIAL0"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}",
2077 ssbins,ssmin,ssmax,21,-1.05,1.05);
2078 fhDeltaIAL0[0]->SetXTitle("#lambda^{2}_{0}");
2079 fhDeltaIAL0[0]->SetYTitle("#it{A}_{cell in cluster}");
2080 outputContainer->Add(fhDeltaIAL0[0]);
2082 fhDeltaIAL1[0] = new TH2F ("hDeltaIAL1"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}",
2083 ssbins,ssmin,ssmax,21,-1.05,1.05);
2084 fhDeltaIAL1[0]->SetXTitle("#lambda^{2}_{1}");
2085 fhDeltaIAL1[0]->SetYTitle("#it{A}_{cell in cluster}");
2086 outputContainer->Add(fhDeltaIAL1[0]);
2088 fhDeltaIANCells[0] = new TH2F ("hDeltaIANCells"," Cluster *asymmetry* in cell units vs N cells in cluster",
2089 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
2090 fhDeltaIANCells[0]->SetXTitle("#it{n}_{cell in cluster}");
2091 fhDeltaIANCells[0]->SetYTitle("#it{A}_{cell in cluster}");
2092 outputContainer->Add(fhDeltaIANCells[0]);
2095 fhDeltaIEtaDeltaIPhiE0[1] = new TH2F ("hDeltaIEtaDeltaIPhiE0Charged"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3, matched with track",
2097 fhDeltaIEtaDeltaIPhiE0[1]->SetXTitle("#Delta Column");
2098 fhDeltaIEtaDeltaIPhiE0[1]->SetYTitle("#Delta Row");
2099 outputContainer->Add(fhDeltaIEtaDeltaIPhiE0[1]);
2101 fhDeltaIEtaDeltaIPhiE2[1] = new TH2F ("hDeltaIEtaDeltaIPhiE2Charged"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3, matched with track",
2103 fhDeltaIEtaDeltaIPhiE2[1]->SetXTitle("#Delta Column");
2104 fhDeltaIEtaDeltaIPhiE2[1]->SetYTitle("#Delta Row");
2105 outputContainer->Add(fhDeltaIEtaDeltaIPhiE2[1]);
2107 fhDeltaIEtaDeltaIPhiE6[1] = new TH2F ("hDeltaIEtaDeltaIPhiE6Charged"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3, matched with track",
2109 fhDeltaIEtaDeltaIPhiE6[1]->SetXTitle("#Delta Column");
2110 fhDeltaIEtaDeltaIPhiE6[1]->SetYTitle("#Delta Row");
2111 outputContainer->Add(fhDeltaIEtaDeltaIPhiE6[1]);
2113 fhDeltaIA[1] = new TH2F ("hDeltaIACharged"," Cluster *asymmetry* in cell units vs E, matched with track",
2114 nptbins,ptmin,ptmax,21,-1.05,1.05);
2115 fhDeltaIA[1]->SetXTitle("#it{E}_{cluster}");
2116 fhDeltaIA[1]->SetYTitle("#it{A}_{cell in cluster}");
2117 outputContainer->Add(fhDeltaIA[1]);
2119 fhDeltaIAL0[1] = new TH2F ("hDeltaIAL0Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{0}, matched with track",
2120 ssbins,ssmin,ssmax,21,-1.05,1.05);
2121 fhDeltaIAL0[1]->SetXTitle("#lambda^{2}_{0}");
2122 fhDeltaIAL0[1]->SetYTitle("#it{A}_{cell in cluster}");
2123 outputContainer->Add(fhDeltaIAL0[1]);
2125 fhDeltaIAL1[1] = new TH2F ("hDeltaIAL1Charged"," Cluster *asymmetry* in cell units vs #lambda^{2}_{1}, matched with track",
2126 ssbins,ssmin,ssmax,21,-1.05,1.05);
2127 fhDeltaIAL1[1]->SetXTitle("#lambda^{2}_{1}");
2128 fhDeltaIAL1[1]->SetYTitle("#it{A}_{cell in cluster}");
2129 outputContainer->Add(fhDeltaIAL1[1]);
2131 fhDeltaIANCells[1] = new TH2F ("hDeltaIANCellsCharged"," Cluster *asymmetry* in cell units vs N cells in cluster, matched with track",
2132 nceclbins,nceclmin,nceclmax,21,-1.05,1.05);
2133 fhDeltaIANCells[1]->SetXTitle("#it{n}_{cell in cluster}");
2134 fhDeltaIANCells[1]->SetYTitle("#it{A}_{cell in cluster}");
2135 outputContainer->Add(fhDeltaIANCells[1]);
2138 TString particle[]={"Photon","Electron","Conversion","Hadron"};
2139 for (Int_t iPart = 0; iPart < 4; iPart++) {
2141 fhDeltaIAMC[iPart] = new TH2F (Form("hDeltaIA_MC%s",particle[iPart].Data()),Form(" Cluster *asymmetry* in cell units vs E, from %s",particle[iPart].Data()),
2142 nptbins,ptmin,ptmax,21,-1.05,1.05);
2143 fhDeltaIAMC[iPart]->SetXTitle("#it{E}_{cluster}");
2144 fhDeltaIAMC[iPart]->SetYTitle("#it{A}_{cell in cluster}");
2145 outputContainer->Add(fhDeltaIAMC[iPart]);
2149 if(fStudyBadClusters)
2151 fhBadClusterDeltaIEtaDeltaIPhiE0 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE0"," Cluster size in columns vs rows for E < 2 GeV, #it{n}_{cells} > 3",
2153 fhBadClusterDeltaIEtaDeltaIPhiE0->SetXTitle("#Delta Column");
2154 fhBadClusterDeltaIEtaDeltaIPhiE0->SetYTitle("#Delta Row");
2155 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE0);
2157 fhBadClusterDeltaIEtaDeltaIPhiE2 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE2"," Cluster size in columns vs rows for 2 <E < 6 GeV, #it{n}_{cells} > 3",
2159 fhBadClusterDeltaIEtaDeltaIPhiE2->SetXTitle("#Delta Column");
2160 fhBadClusterDeltaIEtaDeltaIPhiE2->SetYTitle("#Delta Row");
2161 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE2);
2163 fhBadClusterDeltaIEtaDeltaIPhiE6 = new TH2F ("hBadClusterDeltaIEtaDeltaIPhiE6"," Cluster size in columns vs rows for E > 6 GeV, #it{n}_{cells} > 3",
2165 fhBadClusterDeltaIEtaDeltaIPhiE6->SetXTitle("#Delta Column");
2166 fhBadClusterDeltaIEtaDeltaIPhiE6->SetYTitle("#Delta Row");
2167 outputContainer->Add(fhBadClusterDeltaIEtaDeltaIPhiE6);
2169 fhBadClusterDeltaIA = new TH2F ("hBadClusterDeltaIA"," Cluster *asymmetry* in cell units vs E",
2170 nptbins,ptmin,ptmax,21,-1.05,1.05);
2171 fhBadClusterDeltaIA->SetXTitle("#it{E}_{cluster}");
2172 fhBadClusterDeltaIA->SetYTitle("#it{A}_{cell in cluster}");
2173 outputContainer->Add(fhBadClusterDeltaIA);
2179 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy",
2180 nptbins,ptmin,ptmax, 100,0,1.);
2181 fhECellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
2182 fhECellClusterRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{cluster}");
2183 outputContainer->Add(fhECellClusterRatio);
2185 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy",
2186 nptbins,ptmin,ptmax, 100,-10,0);
2187 fhECellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
2188 fhECellClusterLogRatio->SetYTitle("Log(#it{E}_{cell i}/#it{E}_{cluster})");
2189 outputContainer->Add(fhECellClusterLogRatio);
2191 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy",
2192 nptbins,ptmin,ptmax, 100,0,1.);
2193 fhEMaxCellClusterRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
2194 fhEMaxCellClusterRatio->SetYTitle("#it{E}_{max cell}/#it{E}_{cluster}");
2195 outputContainer->Add(fhEMaxCellClusterRatio);
2197 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy",
2198 nptbins,ptmin,ptmax, 100,-10,0);
2199 fhEMaxCellClusterLogRatio->SetXTitle("#it{E}_{cluster} (GeV) ");
2200 fhEMaxCellClusterLogRatio->SetYTitle("Log (#it{E}_{max cell}/#it{E}_{cluster})");
2201 outputContainer->Add(fhEMaxCellClusterLogRatio);
2203 fhECellTotalRatio = new TH2F ("hECellTotalRatio"," cell energy / sum all energy vs all energy",
2204 nptbins*2,ptmin,ptmax*2, 100,0,1.);
2205 fhECellTotalRatio->SetXTitle("#it{E}_{total} (GeV) ");
2206 fhECellTotalRatio->SetYTitle("#it{E}_{cell i}/#it{E}_{total}");
2207 outputContainer->Add(fhECellTotalRatio);
2209 fhECellTotalLogRatio = new TH2F ("hECellTotalLogRatio"," Log(cell energy / sum all energy) vs all energy",
2210 nptbins*2,ptmin,ptmax*2, 100,-10,0);
2211 fhECellTotalLogRatio->SetXTitle("#it{E}_{total} (GeV) ");
2212 fhECellTotalLogRatio->SetYTitle("Log(#it{E}_{cell i}/#it{E}_{total})");
2213 outputContainer->Add(fhECellTotalLogRatio);
2215 fhECellTotalRatioMod = new TH2F*[fNModules];
2216 fhECellTotalLogRatioMod = new TH2F*[fNModules];
2218 for(Int_t imod = 0; imod < fNModules; imod++)
2220 fhECellTotalRatioMod[imod] = new TH2F (Form("hECellTotalRatio_Mod%d",imod),
2221 Form("#cell energy / sum all energy vs all energy in Module %d",imod),
2222 nptbins*2,ptmin,ptmax*2, 100,0,1.);
2223 fhECellTotalRatioMod[imod]->SetXTitle("#it{E} (GeV)");
2224 fhECellTotalRatioMod[imod]->SetYTitle("#it{n}_{cells}");
2225 outputContainer->Add(fhECellTotalRatioMod[imod]);
2227 fhECellTotalLogRatioMod[imod] = new TH2F (Form("hECellTotalLogRatio_Mod%d",imod),
2228 Form("Log(cell energy / sum all energy) vs all energy in Module %d",imod),
2229 nptbins*2,ptmin,ptmax*2, 100,-10,0);
2230 fhECellTotalLogRatioMod[imod]->SetXTitle("#it{E} (GeV)");
2231 fhECellTotalLogRatioMod[imod]->SetYTitle("#it{n}_{cells}");
2232 outputContainer->Add(fhECellTotalLogRatioMod[imod]);
2236 for(Int_t iw = 0; iw < 12; iw++)
2238 Float_t w0 = 3+0.25*iw;
2239 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f",w0),
2240 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2241 fhLambda0ForW0[iw]->SetXTitle("#it{E}_{cluster}");
2242 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
2243 outputContainer->Add(fhLambda0ForW0[iw]);
2245 // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f",w0),
2246 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2247 // fhLambda1ForW0[iw]->SetXTitle("#it{E}_{cluster}");
2248 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
2249 // outputContainer->Add(fhLambda1ForW0[iw]);
2252 TString mcnames[] = {"Photon", "Electron","Conversion","Pi0","Hadron"};
2253 for(Int_t imc = 0; imc < 5; imc++){
2254 fhLambda0ForW0MC[iw][imc] = new TH2F (Form("hLambda0ForW0%d_MC%s",iw,mcnames[imc].Data()),
2255 Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for MC %s",w0,mcnames[imc].Data()),
2256 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2257 fhLambda0ForW0MC[iw][imc]->SetXTitle("#it{E}_{cluster}");
2258 fhLambda0ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{0}");
2259 outputContainer->Add(fhLambda0ForW0MC[iw][imc]);
2261 // fhLambda1ForW0MC[iw][imc] = new TH2F (Form("hLambda1ForW0%d_MC%s",iw,mcnames[imc].Data()),
2262 // Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for MC %s",w0,mcnames[imc].Data()),
2263 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2264 // fhLambda1ForW0MC[iw][imc]->SetXTitle("#it{E}_{cluster}");
2265 // fhLambda1ForW0MC[iw][imc]->SetYTitle("#lambda^{2}_{1}");
2266 // outputContainer->Add(fhLambda1ForW0MC[iw][imc]);
2275 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
2276 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
2277 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
2278 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
2279 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
2280 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
2282 fhTrackMatchedDEta = new TH2F("hTrackMatchedDEta","d#eta of cluster-track vs cluster energy",
2283 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2284 fhTrackMatchedDEta->SetYTitle("d#eta");
2285 fhTrackMatchedDEta->SetXTitle("#it{E}_{cluster} (GeV)");
2287 fhTrackMatchedDPhi = new TH2F("hTrackMatchedDPhi","d#phi of cluster-track vs cluster energy",
2288 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2289 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
2290 fhTrackMatchedDPhi->SetXTitle("#it{E}_{cluster} (GeV)");
2292 fhTrackMatchedDEtaDPhi = new TH2F("hTrackMatchedDEtaDPhi","d#eta vs d#phi of cluster-track vs cluster energy",
2293 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2294 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
2295 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
2297 fhTrackMatchedDEtaPos = new TH2F("hTrackMatchedDEtaPos","d#eta of cluster-track vs cluster energy",
2298 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2299 fhTrackMatchedDEtaPos->SetYTitle("d#eta");
2300 fhTrackMatchedDEtaPos->SetXTitle("#it{E}_{cluster} (GeV)");
2302 fhTrackMatchedDPhiPos = new TH2F("hTrackMatchedDPhiPos","d#phi of cluster-track vs cluster energy",
2303 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2304 fhTrackMatchedDPhiPos->SetYTitle("d#phi (rad)");
2305 fhTrackMatchedDPhiPos->SetXTitle("#it{E}_{cluster} (GeV)");
2307 fhTrackMatchedDEtaDPhiPos = new TH2F("hTrackMatchedDEtaDPhiPos","d#eta vs d#phi of cluster-track vs cluster energy",
2308 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2309 fhTrackMatchedDEtaDPhiPos->SetYTitle("d#phi (rad)");
2310 fhTrackMatchedDEtaDPhiPos->SetXTitle("d#eta");
2312 outputContainer->Add(fhTrackMatchedDEta) ;
2313 outputContainer->Add(fhTrackMatchedDPhi) ;
2314 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
2315 outputContainer->Add(fhTrackMatchedDEtaPos) ;
2316 outputContainer->Add(fhTrackMatchedDPhiPos) ;
2317 outputContainer->Add(fhTrackMatchedDEtaDPhiPos) ;
2319 fhECharged = new TH1F ("hECharged","#it{E} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2320 fhECharged->SetXTitle("#it{E} (GeV)");
2321 outputContainer->Add(fhECharged);
2323 fhPtCharged = new TH1F ("hPtCharged","#it{p}_{T} reconstructed clusters, matched with track", nptbins,ptmin,ptmax);
2324 fhPtCharged->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2325 outputContainer->Add(fhPtCharged);
2327 fhPhiCharged = new TH1F ("hPhiCharged","#phi reconstructed clusters, matched with track",nphibins,phimin,phimax);
2328 fhPhiCharged->SetXTitle("#phi (rad)");
2329 outputContainer->Add(fhPhiCharged);
2331 fhEtaCharged = new TH1F ("hEtaCharged","#eta reconstructed clusters, matched with track",netabins,etamin,etamax);
2332 fhEtaCharged->SetXTitle("#eta ");
2333 outputContainer->Add(fhEtaCharged);
2337 fhEtaPhiECharged = new TH3F ("hEtaPhiECharged","#eta vs #phi, reconstructed clusters, matched with track",
2338 netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2339 fhEtaPhiECharged->SetXTitle("#eta ");
2340 fhEtaPhiECharged->SetYTitle("#phi ");
2341 fhEtaPhiECharged->SetZTitle("#it{E} (GeV) ");
2342 outputContainer->Add(fhEtaPhiECharged);
2345 fh1EOverP = new TH2F("h1EOverP","TRACK matches #it{E}/#it{p}",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2346 fh1EOverP->SetYTitle("#it{E}/#it{p}");
2347 fh1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2348 outputContainer->Add(fh1EOverP);
2350 fh2dR = new TH2F("h2dR","TRACK matches #Delta #it{R}",nptbins,ptmin,ptmax,ndRbins,dRmin,dRmax);
2351 fh2dR->SetXTitle("#Delta #it{R} (rad)");
2352 fh2dR->SetXTitle("#it{E} cluster (GeV)");
2353 outputContainer->Add(fh2dR) ;
2355 fh2MatchdEdx = new TH2F("h2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2356 fh2MatchdEdx->SetXTitle("p (GeV/#it{c})");
2357 fh2MatchdEdx->SetYTitle("#it{dE/dx}>");
2358 outputContainer->Add(fh2MatchdEdx);
2360 fh2EledEdx = new TH2F("h2EledEdx","#it{dE/dx} vs. #it{p} for electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
2361 fh2EledEdx->SetXTitle("p (GeV/#it{c})");
2362 fh2EledEdx->SetYTitle("<#it{dE/dx}>");
2363 outputContainer->Add(fh2EledEdx) ;
2365 fh1EOverPR02 = new TH2F("h1EOverPR02","TRACK matches #it{E}/#it{p}, all",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2366 fh1EOverPR02->SetYTitle("#it{E}/#it{p}");
2367 fh1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2368 outputContainer->Add(fh1EOverPR02);
2370 fh1EleEOverP = new TH2F("h1EleEOverP","Electron candidates #it{E}/#it{p} (60<#it{dE/dx}<100)",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
2371 fh1EleEOverP->SetYTitle("#it{E}/#it{p}");
2372 fh1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2373 outputContainer->Add(fh1EleEOverP);
2376 if(fFillAllPi0Histo)
2378 fhIM = new TH2F ("hIM","Cluster pairs Invariant mass vs reconstructed pair energy, ncell > 1",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2379 fhIM->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2380 fhIM->SetYTitle("M_{cluster pairs} (GeV/#it{c}^{2})");
2381 outputContainer->Add(fhIM);
2383 fhAsym = new TH2F ("hAssym","Cluster pairs Asymmetry vs reconstructed pair energy",nptbins,ptmin,ptmax,nasymbins,asymmin,asymmax);
2384 fhAsym->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2385 fhAsym->SetYTitle("#it{Asymmetry}");
2386 outputContainer->Add(fhAsym);
2390 if(fFillAllPosHisto2)
2394 fhXYZ = new TH3F ("hXYZ","Cluster: #it{x} vs #it{y} vs #it{z}",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2395 fhXYZ->SetXTitle("#it{x} (cm)");
2396 fhXYZ->SetYTitle("#it{y} (cm)");
2397 fhXYZ->SetZTitle("#it{z} (cm) ");
2398 outputContainer->Add(fhXYZ);
2401 fhXNCells = new TH2F ("hXNCells","Cluster X position vs N Cells per Cluster",xbins,xmin,xmax,nceclbins,nceclmin,nceclmax);
2402 fhXNCells->SetXTitle("#it{x} (cm)");
2403 fhXNCells->SetYTitle("N cells per cluster");
2404 outputContainer->Add(fhXNCells);
2406 fhZNCells = new TH2F ("hZNCells","Cluster Z position vs N Cells per Cluster",zbins,zmin,zmax,nceclbins,nceclmin,nceclmax);
2407 fhZNCells->SetXTitle("#it{z} (cm)");
2408 fhZNCells->SetYTitle("N cells per cluster");
2409 outputContainer->Add(fhZNCells);
2411 fhXE = new TH2F ("hXE","Cluster X position vs cluster energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2412 fhXE->SetXTitle("#it{x} (cm)");
2413 fhXE->SetYTitle("#it{E} (GeV)");
2414 outputContainer->Add(fhXE);
2416 fhZE = new TH2F ("hZE","Cluster Z position vs cluster energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2417 fhZE->SetXTitle("#it{z} (cm)");
2418 fhZE->SetYTitle("#it{E} (GeV)");
2419 outputContainer->Add(fhZE);
2421 fhRNCells = new TH2F ("hRNCells","Cluster R position vs N Cells per Cluster",rbins,rmin,rmax,nceclbins,nceclmin,nceclmax);
2422 fhRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2423 fhRNCells->SetYTitle("N cells per cluster");
2424 outputContainer->Add(fhRNCells);
2427 fhYNCells = new TH2F ("hYNCells","Cluster Y position vs N Cells per Cluster",ybins,ymin,ymax,nceclbins,nceclmin,nceclmax);
2428 fhYNCells->SetXTitle("#it{y} (cm)");
2429 fhYNCells->SetYTitle("N cells per cluster");
2430 outputContainer->Add(fhYNCells);
2432 fhRE = new TH2F ("hRE","Cluster R position vs cluster energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2433 fhRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2434 fhRE->SetYTitle("#it{E} (GeV)");
2435 outputContainer->Add(fhRE);
2437 fhYE = new TH2F ("hYE","Cluster Y position vs cluster energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2438 fhYE->SetXTitle("#it{y} (cm)");
2439 fhYE->SetYTitle("#it{E} (GeV)");
2440 outputContainer->Add(fhYE);
2443 if(fFillAllPosHisto)
2445 fhRCellE = new TH2F ("hRCellE","Cell R position vs cell energy",rbins,rmin,rmax,nptbins,ptmin,ptmax);
2446 fhRCellE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2447 fhRCellE->SetYTitle("#it{E} (GeV)");
2448 outputContainer->Add(fhRCellE);
2450 fhXCellE = new TH2F ("hXCellE","Cell X position vs cell energy",xbins,xmin,xmax,nptbins,ptmin,ptmax);
2451 fhXCellE->SetXTitle("#it{x} (cm)");
2452 fhXCellE->SetYTitle("#it{E} (GeV)");
2453 outputContainer->Add(fhXCellE);
2455 fhYCellE = new TH2F ("hYCellE","Cell Y position vs cell energy",ybins,ymin,ymax,nptbins,ptmin,ptmax);
2456 fhYCellE->SetXTitle("#it{y} (cm)");
2457 fhYCellE->SetYTitle("#it{E} (GeV)");
2458 outputContainer->Add(fhYCellE);
2460 fhZCellE = new TH2F ("hZCellE","Cell Z position vs cell energy",zbins,zmin,zmax,nptbins,ptmin,ptmax);
2461 fhZCellE->SetXTitle("#it{z} (cm)");
2462 fhZCellE->SetYTitle("#it{E} (GeV)");
2463 outputContainer->Add(fhZCellE);
2465 fhXYZCell = new TH3F ("hXYZCell","Cell : #it{x} vs #it{y} vs #it{z}",xbins,xmin,xmax,ybins,ymin,ymax,zbins,zmin,zmax);
2466 fhXYZCell->SetXTitle("#it{x} (cm)");
2467 fhXYZCell->SetYTitle("#it{y} (cm)");
2468 fhXYZCell->SetZTitle("#it{z} (cm)");
2469 outputContainer->Add(fhXYZCell);
2472 Float_t dx = TMath::Abs(xmin)+TMath::Abs(xmax);
2473 Float_t dy = TMath::Abs(ymin)+TMath::Abs(ymax);
2474 Float_t dz = TMath::Abs(zmin)+TMath::Abs(zmax);
2475 Float_t dr = TMath::Abs(rmin)+TMath::Abs(rmax);
2477 fhDeltaCellClusterRNCells = new TH2F ("hDeltaCellClusterRNCells","Cluster-Cell R position vs N Cells per Cluster",rbins*2,-dr,dr,nceclbins,nceclmin,nceclmax);
2478 fhDeltaCellClusterRNCells->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2479 fhDeltaCellClusterRNCells->SetYTitle("#it{n}_{cells per cluster}");
2480 outputContainer->Add(fhDeltaCellClusterRNCells);
2482 fhDeltaCellClusterXNCells = new TH2F ("hDeltaCellClusterXNCells","Cluster-Cell X position vs N Cells per Cluster",xbins*2,-dx,dx,nceclbins,nceclmin,nceclmax);
2483 fhDeltaCellClusterXNCells->SetXTitle("#it{x} (cm)");
2484 fhDeltaCellClusterXNCells->SetYTitle("#it{n}_{cells per cluster}");
2485 outputContainer->Add(fhDeltaCellClusterXNCells);
2487 fhDeltaCellClusterYNCells = new TH2F ("hDeltaCellClusterYNCells","Cluster-Cell Y position vs N Cells per Cluster",ybins*2,-dy,dy,nceclbins,nceclmin,nceclmax);
2488 fhDeltaCellClusterYNCells->SetXTitle("#it{y} (cm)");
2489 fhDeltaCellClusterYNCells->SetYTitle("N cells per cluster");
2490 outputContainer->Add(fhDeltaCellClusterYNCells);
2492 fhDeltaCellClusterZNCells = new TH2F ("hDeltaCellClusterZNCells","Cluster-Cell Z position vs N Cells per Cluster",zbins*2,-dz,dz,nceclbins,nceclmin,nceclmax);
2493 fhDeltaCellClusterZNCells->SetXTitle("#it{z} (cm)");
2494 fhDeltaCellClusterZNCells->SetYTitle("#it{n}_{cells per cluster}");
2495 outputContainer->Add(fhDeltaCellClusterZNCells);
2497 fhDeltaCellClusterRE = new TH2F ("hDeltaCellClusterRE","Cluster-Cell R position vs cluster energy",rbins*2,-dr,dr,nptbins,ptmin,ptmax);
2498 fhDeltaCellClusterRE->SetXTitle("r = #sqrt{x^{2}+y^{2}} (cm)");
2499 fhDeltaCellClusterRE->SetYTitle("#it{E} (GeV)");
2500 outputContainer->Add(fhDeltaCellClusterRE);
2502 fhDeltaCellClusterXE = new TH2F ("hDeltaCellClusterXE","Cluster-Cell X position vs cluster energy",xbins*2,-dx,dx,nptbins,ptmin,ptmax);
2503 fhDeltaCellClusterXE->SetXTitle("#it{x} (cm)");
2504 fhDeltaCellClusterXE->SetYTitle("#it{E} (GeV)");
2505 outputContainer->Add(fhDeltaCellClusterXE);
2507 fhDeltaCellClusterYE = new TH2F ("hDeltaCellClusterYE","Cluster-Cell Y position vs cluster energy",ybins*2,-dy,dy,nptbins,ptmin,ptmax);
2508 fhDeltaCellClusterYE->SetXTitle("#it{y} (cm)");
2509 fhDeltaCellClusterYE->SetYTitle("#it{E} (GeV)");
2510 outputContainer->Add(fhDeltaCellClusterYE);
2512 fhDeltaCellClusterZE = new TH2F ("hDeltaCellClusterZE","Cluster-Cell Z position vs cluster energy",zbins*2,-dz,dz,nptbins,ptmin,ptmax);
2513 fhDeltaCellClusterZE->SetXTitle("#it{z} (cm)");
2514 fhDeltaCellClusterZE->SetYTitle("#it{E} (GeV)");
2515 outputContainer->Add(fhDeltaCellClusterZE);
2517 fhEtaPhiAmp = new TH3F ("hEtaPhiAmp","Cell #eta vs cell #phi vs cell energy",netabins,etamin,etamax,nphibins,phimin,phimax,nptbins,ptmin,ptmax);
2518 fhEtaPhiAmp->SetXTitle("#eta ");
2519 fhEtaPhiAmp->SetYTitle("#phi (rad)");
2520 fhEtaPhiAmp->SetZTitle("#it{E} (GeV) ");
2521 outputContainer->Add(fhEtaPhiAmp);
2526 fhNCells = new TH1F ("hNCells","# cells", ncebins,ncemin+0.5,ncemax);
2527 fhNCells->SetXTitle("#it{n}_{cells}");
2528 outputContainer->Add(fhNCells);
2530 fhNCellsCutAmpMin = new TH1F ("hNCellsCutAmpMin",Form("# cells amp > %1.2f-%1.2f",fEMCALCellAmpMin,fPHOSCellAmpMin), ncebins,ncemin+0.5,ncemax);
2531 fhNCellsCutAmpMin->SetXTitle("#it{n}_{cells}");
2532 outputContainer->Add(fhNCellsCutAmpMin);
2534 fhAmplitude = new TH1F ("hAmplitude","#it{E}_{cell}", nptbins*2,ptmin,ptmax);
2535 fhAmplitude->SetXTitle("#it{E}_{cell} (GeV)");
2536 outputContainer->Add(fhAmplitude);
2538 fhAmpId = new TH2F ("hAmpId","#it{E}_{cell}", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2539 fhAmpId->SetXTitle("#it{E}_{cell} (GeV)");
2540 outputContainer->Add(fhAmpId);
2542 fhAmpIdLowGain = new TH2F ("hAmpIdLG","Low gain: #it{E}_{cell}", nfineptbins,ptfinemin,ptfinemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2543 fhAmpIdLowGain->SetXTitle("#it{E}_{cell} (GeV)");
2544 outputContainer->Add(fhAmpIdLowGain);
2546 if(fFillAllCellTimeHisto)
2548 fhCellTimeSpreadRespectToCellMax = new TH2F ("hCellTimeSpreadRespectToCellMax","t_{cell max}-t_{cell i} per cluster", nptbins,ptmin,ptmax,tdbins,tdmin,tdmax);
2549 fhCellTimeSpreadRespectToCellMax->SetXTitle("#it{E} (GeV)");
2550 fhCellTimeSpreadRespectToCellMax->SetYTitle("#Delta #it{t}_{cell max-i} (ns)");
2551 outputContainer->Add(fhCellTimeSpreadRespectToCellMax);
2553 fhClusterMaxCellDiffAverageTime = new TH2F ("hClusterMaxCellDiffAverageTime","t_{cell max}-t_{average} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2554 fhClusterMaxCellDiffAverageTime->SetXTitle("#it{E} (GeV)");
2555 fhClusterMaxCellDiffAverageTime->SetYTitle("#Delta #it{t}_{cell max - average} (ns)");
2556 outputContainer->Add(fhClusterMaxCellDiffAverageTime);
2558 fhClusterMaxCellDiffWeightedTime = new TH2F ("hClusterMaxCellDiffWeightedTime","t_{cell max}-t_{weighted} per cluster", nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
2559 fhClusterMaxCellDiffWeightedTime->SetXTitle("#it{E} (GeV)");
2560 fhClusterMaxCellDiffWeightedTime->SetYTitle("#Delta #it{t}_{cell max - weighted} (ns)");
2561 outputContainer->Add(fhClusterMaxCellDiffWeightedTime);
2563 fhCellIdCellLargeTimeSpread= new TH1F ("hCellIdCellLargeTimeSpread","Cells with time 100 ns larger than cell max in cluster ",
2564 fNMaxCols*fNMaxRows*fNModules,0,fNMaxCols*fNMaxRows*fNModules);
2565 fhCellIdCellLargeTimeSpread->SetXTitle("Absolute Cell Id");
2566 outputContainer->Add(fhCellIdCellLargeTimeSpread);
2568 fhTime = new TH1F ("hTime","#it{t}_{cell}",ntimebins,timemin,timemax);
2569 fhTime->SetXTitle("#it{t}_{cell} (ns)");
2570 outputContainer->Add(fhTime);
2572 fhTimeVz = new TH2F ("hTimeVz","#it{t}_{cell} vs vertex, amplitude > 0.5 GeV",100, 0, 50,ntimebins,timemin,timemax);
2573 fhTimeVz->SetXTitle("|v_{z}| (cm)");
2574 fhTimeVz->SetYTitle("#it{t}_{cell} (ns)");
2575 outputContainer->Add(fhTimeVz);
2577 fhTimeId = new TH2F ("hTimeId","#it{t}_{cell} vs Absolute Id",
2578 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2579 fhTimeId->SetXTitle("#it{t}_{cell} (ns)");
2580 fhTimeId->SetYTitle("Cell Absolute Id");
2581 outputContainer->Add(fhTimeId);
2583 fhTimeAmp = new TH2F ("hTimeAmp","#it{t}_{cell} vs #it{E}_{cell}",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
2584 fhTimeAmp->SetYTitle("#it{t}_{cell} (ns)");
2585 fhTimeAmp->SetXTitle("#it{E}_{cell} (GeV)");
2586 outputContainer->Add(fhTimeAmp);
2588 fhTimeIdLowGain = new TH2F ("hTimeIdLG","Low gain: #it{t}_{cell} vs Absolute Id",
2589 ntimebins,timemin,timemax,fNMaxRows*fNMaxCols*fNModules,0,fNMaxRows*fNMaxCols*fNModules);
2590 fhTimeIdLowGain->SetXTitle("#it{t}_{cell} (ns)");
2591 fhTimeIdLowGain->SetYTitle("Cell Absolute Id");
2592 outputContainer->Add(fhTimeIdLowGain);
2594 fhTimeAmpLowGain = new TH2F ("hTimeAmpLG","Low gain: #it{t}_{cell} vs #it{E}_{cell}",nptbins*2,ptmin,ptmax,ntimebins,timemin,timemax);
2595 fhTimeAmpLowGain->SetYTitle("#it{t}_{cell} (ns)");
2596 fhTimeAmpLowGain->SetXTitle("#it{E}_{cell} (GeV)");
2597 outputContainer->Add(fhTimeAmpLowGain);
2601 fhCellECross = new TH2F ("hCellECross","1 - Energy in cross around cell / cell energy",
2602 nptbins,ptmin,ptmax, 400,-1,1.);
2603 fhCellECross->SetXTitle("#it{E}_{cell} (GeV) ");
2604 fhCellECross->SetYTitle("1- #it{E}_{cross}/#it{E}_{cell}");
2605 outputContainer->Add(fhCellECross);
2611 fhCaloCorrNClusters = new TH2F ("hCaloCorrNClusters","# clusters in EMCAL vs PHOS", nclbins,nclmin,nclmax,nclbins,nclmin,nclmax);
2612 fhCaloCorrNClusters->SetXTitle("number of clusters in EMCAL");
2613 fhCaloCorrNClusters->SetYTitle("number of clusters in PHOS");
2614 outputContainer->Add(fhCaloCorrNClusters);
2616 fhCaloCorrEClusters = new TH2F ("hCaloCorrEClusters","summed energy of clusters in EMCAL vs PHOS", nptbins,ptmin,ptmax*2,nptbins,ptmin,ptmax*2);
2617 fhCaloCorrEClusters->SetXTitle("#Sigma #it{E} of clusters in EMCAL (GeV)");
2618 fhCaloCorrEClusters->SetYTitle("#Sigma #it{E} of clusters in PHOS (GeV)");
2619 outputContainer->Add(fhCaloCorrEClusters);
2621 fhCaloCorrNCells = new TH2F ("hCaloCorrNCells","# Cells in EMCAL vs PHOS", ncebins,ncemin,ncemax, ncebins,ncemin,ncemax);
2622 fhCaloCorrNCells->SetXTitle("number of Cells in EMCAL");
2623 fhCaloCorrNCells->SetYTitle("number of Cells in PHOS");
2624 outputContainer->Add(fhCaloCorrNCells);
2626 fhCaloCorrECells = new TH2F ("hCaloCorrECells","summed energy of Cells in EMCAL vs PHOS", nptbins*2,ptmin,ptmax*4,nptbins*2,ptmin,ptmax*4);
2627 fhCaloCorrECells->SetXTitle("#Sigma #it{E} of Cells in EMCAL (GeV)");
2628 fhCaloCorrECells->SetYTitle("#Sigma #it{E} of Cells in PHOS (GeV)");
2629 outputContainer->Add(fhCaloCorrECells);
2631 //Calorimeter VS V0 signal
2632 fhCaloV0SCorrNClusters = new TH2F ("hCaloV0SNClusters",Form("# clusters in %s vs V0 signal",GetCalorimeter().Data()), nv0sbins,nv0smin,nv0smax,nclbins,nclmin,nclmax);
2633 fhCaloV0SCorrNClusters->SetXTitle("V0 signal");
2634 fhCaloV0SCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeter().Data()));
2635 outputContainer->Add(fhCaloV0SCorrNClusters);
2637 fhCaloV0SCorrEClusters = new TH2F ("hCaloV0SEClusters",Form("summed energy of clusters in %s vs V0 signal",GetCalorimeter().Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax*2);
2638 fhCaloV0SCorrEClusters->SetXTitle("V0 signal");
2639 fhCaloV0SCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeter().Data()));
2640 outputContainer->Add(fhCaloV0SCorrEClusters);
2642 fhCaloV0SCorrNCells = new TH2F ("hCaloV0SNCells",Form("# Cells in %s vs V0 signal",GetCalorimeter().Data()), nv0sbins,nv0smin,nv0smax, ncebins,ncemin,ncemax);
2643 fhCaloV0SCorrNCells->SetXTitle("V0 signal");
2644 fhCaloV0SCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeter().Data()));
2645 outputContainer->Add(fhCaloV0SCorrNCells);
2647 fhCaloV0SCorrECells = new TH2F ("hCaloV0SECells",Form("summed energy of Cells in %s vs V0 signal",GetCalorimeter().Data()), nv0sbins,nv0smin,nv0smax,nptbins,ptmin,ptmax*2);
2648 fhCaloV0SCorrECells->SetXTitle("V0 signal");
2649 fhCaloV0SCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeter().Data()));
2650 outputContainer->Add(fhCaloV0SCorrECells);
2652 //Calorimeter VS V0 multiplicity
2653 fhCaloV0MCorrNClusters = new TH2F ("hCaloV0MNClusters",Form("# clusters in %s vs V0 signal",GetCalorimeter().Data()), nv0mbins,nv0mmin,nv0mmax,nclbins,nclmin,nclmax);
2654 fhCaloV0MCorrNClusters->SetXTitle("V0 signal");
2655 fhCaloV0MCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeter().Data()));
2656 outputContainer->Add(fhCaloV0MCorrNClusters);
2658 fhCaloV0MCorrEClusters = new TH2F ("hCaloV0MEClusters",Form("summed energy of clusters in %s vs V0 signal",GetCalorimeter().Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax*2);
2659 fhCaloV0MCorrEClusters->SetXTitle("V0 signal");
2660 fhCaloV0MCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeter().Data()));
2661 outputContainer->Add(fhCaloV0MCorrEClusters);
2663 fhCaloV0MCorrNCells = new TH2F ("hCaloV0MNCells",Form("# Cells in %s vs V0 signal",GetCalorimeter().Data()), nv0mbins,nv0mmin,nv0mmax, ncebins,ncemin,ncemax);
2664 fhCaloV0MCorrNCells->SetXTitle("V0 signal");
2665 fhCaloV0MCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeter().Data()));
2666 outputContainer->Add(fhCaloV0MCorrNCells);
2668 fhCaloV0MCorrECells = new TH2F ("hCaloV0MECells",Form("summed energy of Cells in %s vs V0 signal",GetCalorimeter().Data()), nv0mbins,nv0mmin,nv0mmax,nptbins,ptmin,ptmax*2);
2669 fhCaloV0MCorrECells->SetXTitle("V0 signal");
2670 fhCaloV0MCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeter().Data()));
2671 outputContainer->Add(fhCaloV0MCorrECells);
2673 //Calorimeter VS Track multiplicity
2674 fhCaloTrackMCorrNClusters = new TH2F ("hCaloTrackMNClusters",Form("# clusters in %s vs # tracks",GetCalorimeter().Data()), ntrmbins,ntrmmin,ntrmmax,nclbins,nclmin,nclmax);
2675 fhCaloTrackMCorrNClusters->SetXTitle("# tracks");
2676 fhCaloTrackMCorrNClusters->SetYTitle(Form("number of clusters in %s",GetCalorimeter().Data()));
2677 outputContainer->Add(fhCaloTrackMCorrNClusters);
2679 fhCaloTrackMCorrEClusters = new TH2F ("hCaloTrackMEClusters",Form("summed energy of clusters in %s vs # tracks",GetCalorimeter().Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax*2);
2680 fhCaloTrackMCorrEClusters->SetXTitle("# tracks");
2681 fhCaloTrackMCorrEClusters->SetYTitle(Form("#Sigma #it{E} of clusters in %s (GeV)",GetCalorimeter().Data()));
2682 outputContainer->Add(fhCaloTrackMCorrEClusters);
2684 fhCaloTrackMCorrNCells = new TH2F ("hCaloTrackMNCells",Form("# Cells in %s vs # tracks",GetCalorimeter().Data()), ntrmbins,ntrmmin,ntrmmax, ncebins,ncemin,ncemax);
2685 fhCaloTrackMCorrNCells->SetXTitle("# tracks");
2686 fhCaloTrackMCorrNCells->SetYTitle(Form("number of Cells in %s",GetCalorimeter().Data()));
2687 outputContainer->Add(fhCaloTrackMCorrNCells);
2689 fhCaloTrackMCorrECells = new TH2F ("hCaloTrackMECells",Form("summed energy of Cells in %s vs # tracks",GetCalorimeter().Data()), ntrmbins,ntrmmin,ntrmmax,nptbins,ptmin,ptmax*2);
2690 fhCaloTrackMCorrECells->SetXTitle("# tracks");
2691 fhCaloTrackMCorrECells->SetYTitle(Form("#Sigma #it{E} of Cells in %s (GeV)",GetCalorimeter().Data()));
2692 outputContainer->Add(fhCaloTrackMCorrECells);
2694 fhCaloCenNClusters = new TH2F ("hCaloCenNClusters","# clusters in calorimeter vs centrality",100,0,100,nclbins,nclmin,nclmax);
2695 fhCaloCenNClusters->SetYTitle("number of clusters in calorimeter");
2696 fhCaloCenNClusters->SetXTitle("Centrality");
2697 outputContainer->Add(fhCaloCenNClusters);
2699 fhCaloCenEClusters = new TH2F ("hCaloCenEClusters","summed energy of clusters in calorimeter vs centrality",100,0,100,nptbins,ptmin,ptmax*2);
2700 fhCaloCenEClusters->SetYTitle("#Sigma #it{E} of clusters in calorimeter (GeV)");
2701 fhCaloCenEClusters->SetXTitle("Centrality");
2702 outputContainer->Add(fhCaloCenEClusters);
2704 fhCaloCenNCells = new TH2F ("hCaloCenNCells","# Cells in calorimeter vs centrality",100,0,100,ncebins,ncemin,ncemax);
2705 fhCaloCenNCells->SetYTitle("number of Cells in calorimeter");
2706 fhCaloCenNCells->SetXTitle("Centrality");
2707 outputContainer->Add(fhCaloCenNCells);
2709 fhCaloCenECells = new TH2F ("hCaloCenECells","summed energy of Cells in calorimeter vs centrality",100,0,100,nptbins*2,ptmin,ptmax*4);
2710 fhCaloCenECells->SetYTitle("#Sigma #it{E} of Cells in calorimeter (GeV)");
2711 fhCaloCenECells->SetXTitle("Centrality");
2712 outputContainer->Add(fhCaloCenECells);
2714 fhCaloEvPNClusters = new TH2F ("hCaloEvPNClusters","# clusters in calorimeter vs event plane angle",100,0,TMath::Pi(),nclbins,nclmin,nclmax);
2715 fhCaloEvPNClusters->SetYTitle("number of clusters in calorimeter");
2716 fhCaloEvPNClusters->SetXTitle("Event plane angle (rad)");
2717 outputContainer->Add(fhCaloEvPNClusters);
2719 fhCaloEvPEClusters = new TH2F ("hCaloEvPEClusters","summed energy of clusters in calorimeter vs event plane angle",100,0,TMath::Pi(),nptbins,ptmin,ptmax*2);
2720 fhCaloEvPEClusters->SetYTitle("#Sigma #it{E} of clusters in calorimeter (GeV)");
2721 fhCaloEvPEClusters->SetXTitle("Event plane angle (rad)");
2722 outputContainer->Add(fhCaloEvPEClusters);
2724 fhCaloEvPNCells = new TH2F ("hCaloEvPNCells","# Cells in calorimeter vs event plane angle",100,0,TMath::Pi(),ncebins,ncemin,ncemax);
2725 fhCaloEvPNCells->SetYTitle("number of Cells in calorimeter");
2726 fhCaloEvPNCells->SetXTitle("Event plane angle (rad)");
2727 outputContainer->Add(fhCaloEvPNCells);
2729 fhCaloEvPECells = new TH2F ("hCaloEvPECells","summed energy of Cells in calorimeter vs event plane angle",100,0,TMath::Pi(),nptbins*2,ptmin,ptmax*4);
2730 fhCaloEvPECells->SetYTitle("#Sigma #it{E} of Cells in calorimeter (GeV)");
2731 fhCaloEvPECells->SetXTitle("Event plane angle (rad)");
2732 outputContainer->Add(fhCaloEvPECells);
2735 }//correlate calorimeters
2739 fhEMod = new TH2F ("hE_Mod","Cluster reconstructed Energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2740 fhEMod->SetXTitle("#it{E} (GeV)");
2741 fhEMod->SetYTitle("Module");
2742 outputContainer->Add(fhEMod);
2744 fhAmpMod = new TH2F ("hAmp_Mod","Cell energy in each present Module",nptbins,ptmin,ptmax,fNModules,0,fNModules);
2745 fhAmpMod->SetXTitle("#it{E} (GeV)");
2746 fhAmpMod->SetYTitle("Module");
2747 outputContainer->Add(fhAmpMod);
2749 if(fFillAllCellTimeHisto)
2751 fhTimeMod = new TH2F ("hTime_Mod","Cell time in each present Module",ntimebins,timemin,timemax,fNModules,0,fNModules);
2752 fhTimeMod->SetXTitle("t (ns)");
2753 fhTimeMod->SetYTitle("Module");
2754 outputContainer->Add(fhTimeMod);
2757 fhNClustersMod = new TH2F ("hNClusters_Mod","# clusters vs Module", nclbins,nclmin+0.5,nclmax,fNModules,0,fNModules);
2758 fhNClustersMod->SetXTitle("number of clusters");
2759 fhNClustersMod->SetYTitle("Module");
2760 outputContainer->Add(fhNClustersMod);
2762 fhNCellsMod = new TH2F ("hNCells_Mod","# cells vs Module", ncebins,ncemin+0.5,ncemax,fNModules,0,fNModules);
2763 fhNCellsMod->SetXTitle("#it{n}_{cells}");
2764 fhNCellsMod->SetYTitle("Module");
2765 outputContainer->Add(fhNCellsMod);
2767 Int_t colmaxs = fNMaxCols;
2768 Int_t rowmaxs = fNMaxRows;
2769 if(GetCalorimeter()=="EMCAL")
2771 colmaxs=2*fNMaxCols;
2772 rowmaxs=Int_t(fNModules/2)*fNMaxRows;
2776 rowmaxs=fNModules*fNMaxRows;
2779 fhGridCells = new TH2F ("hGridCells",Form("Entries in grid of cells"),
2780 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2781 fhGridCells->SetYTitle("row (phi direction)");
2782 fhGridCells->SetXTitle("column (eta direction)");
2783 outputContainer->Add(fhGridCells);
2785 fhGridCellsE = new TH2F ("hGridCellsE","Accumulated energy in grid of cells",
2786 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2787 fhGridCellsE->SetYTitle("row (phi direction)");
2788 fhGridCellsE->SetXTitle("column (eta direction)");
2789 outputContainer->Add(fhGridCellsE);
2791 fhGridCellsLowGain = new TH2F ("hGridCellsLG",Form("Low gain: Entries in grid of cells"),
2792 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2793 fhGridCellsLowGain->SetYTitle("row (phi direction)");
2794 fhGridCellsLowGain->SetXTitle("column (eta direction)");
2795 outputContainer->Add(fhGridCellsLowGain);
2797 fhGridCellsELowGain = new TH2F ("hGridCellsELG","Low gain: Accumulated energy in grid of cells",
2798 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2799 fhGridCellsELowGain->SetYTitle("row (phi direction)");
2800 fhGridCellsELowGain->SetXTitle("column (eta direction)");
2801 outputContainer->Add(fhGridCellsELowGain);
2804 if(fFillAllCellTimeHisto)
2806 fhGridCellsTime = new TH2F ("hGridCellsTime","Accumulated time in grid of cells",
2807 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2808 fhGridCellsTime->SetYTitle("row (phi direction)");
2809 fhGridCellsTime->SetXTitle("column (eta direction)");
2810 outputContainer->Add(fhGridCellsTime);
2812 fhGridCellsTimeLowGain = new TH2F ("hGridCellsTimeLG","Low gain: Accumulated time in grid of cells",
2813 colmaxs+2,-1.5,colmaxs+0.5, rowmaxs+2,-1.5,rowmaxs+0.5);
2814 fhGridCellsTimeLowGain->SetYTitle("row (phi direction)");
2815 fhGridCellsTimeLowGain->SetXTitle("column (eta direction)");
2816 outputContainer->Add(fhGridCellsTimeLowGain);
2819 fhNCellsPerClusterMod = new TH2F*[fNModules];
2820 fhNCellsPerClusterModNoCut = new TH2F*[fNModules];
2821 fhIMMod = new TH2F*[fNModules];
2822 if(fFillAllCellTimeHisto) fhTimeAmpPerRCU = new TH2F*[fNModules*fNRCU];
2824 for(Int_t imod = 0; imod < fNModules; imod++)
2826 fhNCellsPerClusterMod[imod] = new TH2F (Form("hNCellsPerCluster_Mod%d",imod),
2827 Form("# cells per cluster vs cluster energy in Module %d",imod),
2828 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2829 fhNCellsPerClusterMod[imod]->SetXTitle("#it{E} (GeV)");
2830 fhNCellsPerClusterMod[imod]->SetYTitle("#it{n}_{cells}");
2831 outputContainer->Add(fhNCellsPerClusterMod[imod]);
2833 fhNCellsPerClusterModNoCut[imod] = new TH2F (Form("hNCellsPerClusterNoCut_Mod%d",imod),
2834 Form("# cells per cluster vs cluster energy in Module %d, no cut",imod),
2835 nptbins,ptmin,ptmax, nceclbins,nceclmin,nceclmax);
2836 fhNCellsPerClusterModNoCut[imod]->SetXTitle("#it{E} (GeV)");
2837 fhNCellsPerClusterModNoCut[imod]->SetYTitle("#it{n}_{cells}");
2838 outputContainer->Add(fhNCellsPerClusterModNoCut[imod]);
2840 if(fFillAllCellTimeHisto)
2842 for(Int_t ircu = 0; ircu < fNRCU; ircu++)
2844 fhTimeAmpPerRCU[imod*fNRCU+ircu] = new TH2F (Form("hTimeAmp_Mod%d_RCU%d",imod,ircu),
2845 Form("#it{E}_{cell} vs #it{t}_{cell} in Module %d, RCU %d ",imod,ircu),
2846 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2847 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetXTitle("#it{E} (GeV)");
2848 fhTimeAmpPerRCU[imod*fNRCU+ircu]->SetYTitle("#it{t} (ns)");
2849 outputContainer->Add(fhTimeAmpPerRCU[imod*fNRCU+ircu]);
2854 if(fFillAllPi0Histo)
2856 fhIMMod[imod] = new TH2F (Form("hIM_Mod%d",imod),
2857 Form("Cluster pairs Invariant mass vs reconstructed pair energy in Module %d, n cell > 1",imod),
2858 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
2859 fhIMMod[imod]->SetXTitle("#it{p}_{T, cluster pairs} (GeV) ");
2860 fhIMMod[imod]->SetYTitle("#it{M}_{cluster pairs} (GeV/#it{c}^{2})");
2861 outputContainer->Add(fhIMMod[imod]);
2866 // Monte Carlo Histograms
2868 TString particleName[] = { "Photon","PhotonConv","Pi0", "Eta", "Electron", "NeutralHadron", "ChargedHadron" };
2872 for(Int_t iPart = 0; iPart < 7; iPart++)
2874 for(Int_t iCh = 0; iCh < 2; iCh++)
2876 fhRecoMCRatioE[iPart][iCh] = new TH2F (Form("hRecoMCRatioE_%s_Match%d",particleName[iPart].Data(),iCh),
2877 Form("Reconstructed/Generated E, %s, Matched %d",particleName[iPart].Data(),iCh),
2878 nptbins, ptmin, ptmax, 200,0,2);
2879 fhRecoMCRatioE[iPart][iCh]->SetYTitle("#it{E}_{reconstructed}/#it{E}_{generated}");
2880 fhRecoMCRatioE[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
2881 outputContainer->Add(fhRecoMCRatioE[iPart][iCh]);
2884 fhRecoMCDeltaE[iPart][iCh] = new TH2F (Form("hRecoMCDeltaE_%s_Match%d",particleName[iPart].Data(),iCh),
2885 Form("Generated - Reconstructed E, %s, Matched %d",particleName[iPart].Data(),iCh),
2886 nptbins, ptmin, ptmax, nptbins*2,-ptmax,ptmax);
2887 fhRecoMCDeltaE[iPart][iCh]->SetYTitle("#Delta #it{E} (GeV)");
2888 fhRecoMCDeltaE[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
2889 outputContainer->Add(fhRecoMCDeltaE[iPart][iCh]);
2891 fhRecoMCDeltaPhi[iPart][iCh] = new TH2F (Form("hRecoMCDeltaPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2892 Form("Generated - Reconstructed #phi, %s, Matched %d",particleName[iPart].Data(),iCh),
2893 nptbins, ptmin, ptmax, nphibins*2,-phimax,phimax);
2894 fhRecoMCDeltaPhi[iPart][iCh]->SetYTitle("#Delta #phi (rad)");
2895 fhRecoMCDeltaPhi[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
2896 outputContainer->Add(fhRecoMCDeltaPhi[iPart][iCh]);
2898 fhRecoMCDeltaEta[iPart][iCh] = new TH2F (Form("hRecoMCDeltaEta_%s_Match%d",particleName[iPart].Data(),iCh),
2899 Form("Generated - Reconstructed #eta, %s, Matched %d",particleName[iPart].Data(),iCh),
2900 nptbins, ptmin, ptmax,netabins*2,-etamax,etamax);
2901 fhRecoMCDeltaEta[iPart][iCh]->SetYTitle("#Delta #eta ");
2902 fhRecoMCDeltaEta[iPart][iCh]->SetXTitle("#it{E}_{reconstructed} (GeV)");
2903 outputContainer->Add(fhRecoMCDeltaEta[iPart][iCh]);
2905 fhRecoMCE[iPart][iCh] = new TH2F (Form("hRecoMCE_%s_Match%d",particleName[iPart].Data(),iCh),
2906 Form("#it{E} distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2907 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2908 fhRecoMCE[iPart][iCh]->SetXTitle("#it{E}_{rec} (GeV)");
2909 fhRecoMCE[iPart][iCh]->SetYTitle("#it{E}_{gen} (GeV)");
2910 outputContainer->Add(fhRecoMCE[iPart][iCh]);
2912 fhRecoMCPhi[iPart][iCh] = new TH2F (Form("hRecoMCPhi_%s_Match%d",particleName[iPart].Data(),iCh),
2913 Form("#phi distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2914 nphibins,phimin,phimax, nphibins,phimin,phimax);
2915 fhRecoMCPhi[iPart][iCh]->SetXTitle("#phi_{reconstructed} (rad)");
2916 fhRecoMCPhi[iPart][iCh]->SetYTitle("#phi_{generated} (rad)");
2917 outputContainer->Add(fhRecoMCPhi[iPart][iCh]);
2919 fhRecoMCEta[iPart][iCh] = new TH2F (Form("hRecoMCEta_%s_Match%d",particleName[iPart].Data(),iCh),
2920 Form("#eta distribution, reconstructed vs generated, %s, Matched %d",particleName[iPart].Data(),iCh),
2921 netabins,etamin,etamax,netabins,etamin,etamax);
2922 fhRecoMCEta[iPart][iCh]->SetXTitle("#eta_{reconstructed} ");
2923 fhRecoMCEta[iPart][iCh]->SetYTitle("#eta_{generated} ");
2924 outputContainer->Add(fhRecoMCEta[iPart][iCh]);
2929 for(Int_t iPart = 0; iPart < 4; iPart++)
2931 fhGenMCE [iPart] = new TH1F(Form("hGenMCE_%s",particleName[iPart].Data()) ,
2932 Form("#it{E} of generated %s",particleName[iPart].Data()),
2933 nptbins,ptmin,ptmax);
2935 fhGenMCPt[iPart] = new TH1F(Form("hGenMCPt_%s",particleName[iPart].Data()) ,
2936 Form("#it{p}_{T} of generated %s",particleName[iPart].Data()),
2937 nptbins,ptmin,ptmax);
2939 fhGenMCEtaPhi[iPart] = new TH2F(Form("hGenMCEtaPhi_%s",particleName[iPart].Data()),
2940 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2941 200,-1,1,360,0,TMath::TwoPi());
2943 fhGenMCE [iPart] ->SetXTitle("#it{E} (GeV)");
2944 fhGenMCPt[iPart] ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2945 fhGenMCEtaPhi[iPart]->SetXTitle("#eta");
2946 fhGenMCEtaPhi[iPart]->SetYTitle("#phi (rad)");
2948 outputContainer->Add(fhGenMCE [iPart]);
2949 outputContainer->Add(fhGenMCPt [iPart]);
2950 outputContainer->Add(fhGenMCEtaPhi[iPart]);
2953 fhGenMCAccE [iPart] = new TH1F(Form("hGenMCAccE_%s",particleName[iPart].Data()) ,
2954 Form("#it{E} of generated %s",particleName[iPart].Data()),
2955 nptbins,ptmin,ptmax);
2956 fhGenMCAccPt[iPart] = new TH1F(Form("hGenMCAccPt_%s",particleName[iPart].Data()) ,
2957 Form("#it{p}_{T} of generated %s",particleName[iPart].Data()),
2958 nptbins,ptmin,ptmax);
2959 fhGenMCAccEtaPhi[iPart] = new TH2F(Form("hGenMCAccEtaPhi_%s",particleName[iPart].Data()),
2960 Form("Y vs #phi of generated %s",particleName[iPart].Data()),
2961 netabins,etamin,etamax,nphibins,phimin,phimax);
2963 fhGenMCAccE [iPart] ->SetXTitle("#it{E} (GeV)");
2964 fhGenMCAccPt[iPart] ->SetXTitle("#it{p}_{T} (GeV/#it{c})");
2965 fhGenMCAccEtaPhi[iPart]->SetXTitle("#eta");
2966 fhGenMCAccEtaPhi[iPart]->SetYTitle("#phi (rad)");
2968 outputContainer->Add(fhGenMCAccE [iPart]);
2969 outputContainer->Add(fhGenMCAccPt [iPart]);
2970 outputContainer->Add(fhGenMCAccEtaPhi[iPart]);
2974 //Vertex of generated particles
2976 fhEMVxyz = new TH2F ("hEMVxyz","Production vertex of reconstructed ElectroMagnetic particles",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2977 fhEMVxyz->SetXTitle("#it{v}_{x}");
2978 fhEMVxyz->SetYTitle("#it{v}_{y}");
2979 //fhEMVxyz->SetZTitle("v_{z}");
2980 outputContainer->Add(fhEMVxyz);
2982 fhHaVxyz = new TH2F ("hHaVxyz","Production vertex of reconstructed hadrons",nvdistbins,vdistmin,vdistmax,nvdistbins,vdistmin,vdistmax);//,100,0,500);
2983 fhHaVxyz->SetXTitle("#it{v}_{x}");
2984 fhHaVxyz->SetYTitle("#it{v}_{y}");
2985 //fhHaVxyz->SetZTitle("v_{z}");
2986 outputContainer->Add(fhHaVxyz);
2988 fhEMR = new TH2F ("hEMR","Distance to production vertex of reconstructed ElectroMagnetic particles vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2989 fhEMR->SetXTitle("#it{E} (GeV)");
2990 fhEMR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2991 outputContainer->Add(fhEMR);
2993 fhHaR = new TH2F ("hHaR","Distance to production vertex of reconstructed Hadrons vs E rec",nptbins,ptmin,ptmax,nvdistbins,vdistmin,vdistmax);
2994 fhHaR->SetXTitle("#it{E} (GeV)");
2995 fhHaR->SetYTitle("TMath::Sqrt(v_{x}^{2}+v_{y}^{2})");
2996 outputContainer->Add(fhHaR);
3001 fhMCEle1EOverP = new TH2F("hMCEle1EOverP","TRACK matches #it{E}/#it{p}, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3002 fhMCEle1EOverP->SetYTitle("#it{E}/#it{p}");
3003 fhMCEle1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3004 outputContainer->Add(fhMCEle1EOverP);
3006 fhMCEle1dR = new TH1F("hMCEle1dR","TRACK matches dR, MC electrons",ndRbins,dRmin,dRmax);
3007 fhMCEle1dR->SetXTitle("#Delta #it{R} (rad)");
3008 outputContainer->Add(fhMCEle1dR) ;
3010 fhMCEle2MatchdEdx = new TH2F("hMCEle2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC electrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3011 fhMCEle2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3012 fhMCEle2MatchdEdx->SetYTitle("<#it{dE/dx}>");
3013 outputContainer->Add(fhMCEle2MatchdEdx);
3015 fhMCChHad1EOverP = new TH2F("hMCChHad1EOverP","TRACK matches #it{E}/#it{p}, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3016 fhMCChHad1EOverP->SetYTitle("#it{E}/#it{p}");
3017 fhMCChHad1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3018 outputContainer->Add(fhMCChHad1EOverP);
3020 fhMCChHad1dR = new TH1F("hMCChHad1dR","TRACK matches dR, MC charged hadrons",ndRbins,dRmin,dRmax);
3021 fhMCChHad1dR->SetXTitle("#Delta R (rad)");
3022 outputContainer->Add(fhMCChHad1dR) ;
3024 fhMCChHad2MatchdEdx = new TH2F("hMCChHad2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC charged hadrons",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3025 fhMCChHad2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3026 fhMCChHad2MatchdEdx->SetYTitle("#it{dE/dx}>");
3027 outputContainer->Add(fhMCChHad2MatchdEdx);
3029 fhMCNeutral1EOverP = new TH2F("hMCNeutral1EOverP","TRACK matches #it{E}/#it{p}, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3030 fhMCNeutral1EOverP->SetYTitle("#it{E}/#it{p}");
3031 fhMCNeutral1EOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3032 outputContainer->Add(fhMCNeutral1EOverP);
3034 fhMCNeutral1dR = new TH1F("hMCNeutral1dR","TRACK matches dR, MC neutrals",ndRbins,dRmin,dRmax);
3035 fhMCNeutral1dR->SetXTitle("#Delta #it{R} (rad)");
3036 outputContainer->Add(fhMCNeutral1dR) ;
3038 fhMCNeutral2MatchdEdx = new TH2F("hMCNeutral2MatchdEdx","#it{dE/dx} vs. #it{p} for all matches, MC neutrals",nptbins,ptmin,ptmax,ndedxbins,dedxmin,dedxmax);
3039 fhMCNeutral2MatchdEdx->SetXTitle("#it{p} (GeV/#it{c})");
3040 fhMCNeutral2MatchdEdx->SetYTitle("#it{dE/dx}>");
3041 outputContainer->Add(fhMCNeutral2MatchdEdx);
3043 fhMCEle1EOverPR02 = new TH2F("hMCEle1EOverPR02","TRACK matches #it{E}/#it{p}, MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3044 fhMCEle1EOverPR02->SetYTitle("#it{E}/#it{p}");
3045 fhMCEle1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3046 outputContainer->Add(fhMCEle1EOverPR02);
3048 fhMCChHad1EOverPR02 = new TH2F("hMCChHad1EOverPR02","TRACK matches #it{E}/#it{p}, MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3049 fhMCChHad1EOverPR02->SetYTitle("#it{E}/#it{p}");
3050 fhMCChHad1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3051 outputContainer->Add(fhMCChHad1EOverPR02);
3053 fhMCNeutral1EOverPR02 = new TH2F("hMCNeutral1EOverPR02","TRACK matches #it{E}/#it{p}, MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3054 fhMCNeutral1EOverPR02->SetYTitle("#it{E}/#it{p}");
3055 fhMCNeutral1EOverPR02->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3056 outputContainer->Add(fhMCNeutral1EOverPR02);
3058 fhMCEle1EleEOverP = new TH2F("hMCEle1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC electrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3059 fhMCEle1EleEOverP->SetYTitle("#it{E}/#it{p}");
3060 fhMCEle1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3061 outputContainer->Add(fhMCEle1EleEOverP);
3063 fhMCChHad1EleEOverP = new TH2F("hMCEle1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC charged hadrons",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3064 fhMCChHad1EleEOverP->SetYTitle("#it{E}/#it{p}");
3065 fhMCChHad1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3066 outputContainer->Add(fhMCChHad1EleEOverP);
3068 fhMCNeutral1EleEOverP = new TH2F("hMCNeutral1EleEOverP","Electron candidates #it{E}/#it{p} (60<dEdx<100), MC neutrals",nptbins,ptmin,ptmax, nPoverEbins,eOverPmin,eOverPmax);
3069 fhMCNeutral1EleEOverP->SetYTitle("#it{E}/#it{p}");
3070 fhMCNeutral1EleEOverP->SetXTitle("#it{p}_{T} (GeV/#it{c})");
3071 outputContainer->Add(fhMCNeutral1EleEOverP);
3075 // for(Int_t i = 0; i < outputContainer->GetEntries() ; i++)
3076 // printf("i=%d, name= %s\n",i,outputContainer->At(i)->GetName());
3078 return outputContainer;
3081 //______________________________________________________________________________________
3082 Float_t AliAnaCalorimeterQA::GetECross(Int_t absID, AliVCaloCells* cells, Float_t dtcut)
3084 // Get energy in cross axis around maximum cell, for EMCAL only
3086 Int_t icol =-1, irow=-1,iRCU = -1;
3087 Int_t imod = GetModuleNumberCellIndexes(absID, GetCalorimeter(), icol, irow, iRCU);
3089 if(GetCalorimeter()=="EMCAL")
3091 //Get close cells index, energy and time, not in corners
3096 if( irow < AliEMCALGeoParams::fgkEMCALRows-1) absID1 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow+1, icol);
3097 if( irow > 0 ) absID2 = GetCaloUtils()->GetEMCALGeometry()->GetAbsCellIdFromCellIndexes(imod, irow-1, icol);
3099 // In case of cell in eta = 0 border, depending on SM shift the cross cell index
3103 if ( icol == AliEMCALGeoParams::fgkEMCALCols - 1 && !(imod%2) )
3105 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod+1, irow, 0);
3106 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol-1);
3108 else if( icol == 0 && imod%2 )
3110 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod , irow, icol+1);
3111 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod-1, irow, AliEMCALGeoParams::fgkEMCALCols-1);
3115 if( icol < AliEMCALGeoParams::fgkEMCALCols-1 )
3116 absID3 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol+1);
3118 absID4 = GetCaloUtils()->GetEMCALGeometry()-> GetAbsCellIdFromCellIndexes(imod, irow, icol-1);
3121 //Recalibrate cell energy if needed
3122 //Float_t ecell = cells->GetCellAmplitude(absID);
3123 //GetCaloUtils()->RecalibrateCellAmplitude(ecell,GetCalorimeter(), absID);
3124 Double_t tcell = cells->GetCellTime(absID);
3125 GetCaloUtils()->RecalibrateCellTime(tcell, GetCalorimeter(), absID,GetReader()->GetInputEvent()->GetBunchCrossNumber());
3127 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
3128 Double_t tcell1 = 0, tcell2 = 0, tcell3 = 0, tcell4 = 0;
3132 ecell1 = cells->GetCellAmplitude(absID1);
3133 GetCaloUtils()->RecalibrateCellAmplitude(ecell1, GetCalorimeter(), absID1);
3134 tcell1 = cells->GetCellTime(absID1);
3135 GetCaloUtils()->RecalibrateCellTime (tcell1, GetCalorimeter(), absID1,GetReader()->GetInputEvent()->GetBunchCrossNumber());
3139 ecell2 = cells->GetCellAmplitude(absID2);
3140 GetCaloUtils()->RecalibrateCellAmplitude(ecell2, GetCalorimeter(), absID2);
3141 tcell2 = cells->GetCellTime(absID2);
3142 GetCaloUtils()->RecalibrateCellTime (tcell2, GetCalorimeter(), absID2, GetReader()->GetInputEvent()->GetBunchCrossNumber());
3146 ecell3 = cells->GetCellAmplitude(absID3);
3147 GetCaloUtils()->RecalibrateCellAmplitude(ecell3, GetCalorimeter(), absID3);
3148 tcell3 = cells->GetCellTime(absID3);
3149 GetCaloUtils()->RecalibrateCellTime (tcell3, GetCalorimeter(), absID3, GetReader()->GetInputEvent()->GetBunchCrossNumber());
3153 ecell4 = cells->GetCellAmplitude(absID4);
3154 GetCaloUtils()->RecalibrateCellAmplitude(ecell4, GetCalorimeter(), absID4);
3155 tcell4 = cells->GetCellTime(absID4);
3156 GetCaloUtils()->RecalibrateCellTime (tcell4, GetCalorimeter(), absID4, GetReader()->GetInputEvent()->GetBunchCrossNumber());
3159 if(TMath::Abs(tcell-tcell1)*1.e9 > dtcut) ecell1 = 0 ;
3160 if(TMath::Abs(tcell-tcell2)*1.e9 > dtcut) ecell2 = 0 ;
3161 if(TMath::Abs(tcell-tcell3)*1.e9 > dtcut) ecell3 = 0 ;
3162 if(TMath::Abs(tcell-tcell4)*1.e9 > dtcut) ecell4 = 0 ;
3164 return ecell1+ecell2+ecell3+ecell4;
3169 Int_t absId1 = -1, absId2 = -1, absId3 = -1, absId4 = -1;
3171 Int_t relId1[] = { imod+1, 0, irow+1, icol };
3172 Int_t relId2[] = { imod+1, 0, irow-1, icol };
3173 Int_t relId3[] = { imod+1, 0, irow , icol+1 };
3174 Int_t relId4[] = { imod+1, 0, irow , icol-1 };
3176 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId1, absId1);
3177 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId2, absId2);
3178 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId3, absId3);
3179 GetCaloUtils()->GetPHOSGeometry()->RelToAbsNumbering(relId4, absId4);
3181 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
3183 if(absId1 > 0 ) ecell1 = cells->GetCellAmplitude(absId1);
3184 if(absId2 > 0 ) ecell2 = cells->GetCellAmplitude(absId2);
3185 if(absId3 > 0 ) ecell3 = cells->GetCellAmplitude(absId3);
3186 if(absId4 > 0 ) ecell4 = cells->GetCellAmplitude(absId4);
3188 return ecell1+ecell2+ecell3+ecell4;
3194 //__________________________________________________________________________________________________
3195 void AliAnaCalorimeterQA::InvariantMassHistograms(Int_t iclus, TLorentzVector mom,
3196 Int_t nModule, const TObjArray* caloClusters,
3197 AliVCaloCells * cells)
3199 // Fill Invariant mass histograms
3201 if(GetDebug()>1) printf("AliAnaCalorimeterQA::InvariantMassHistograms() - Start \n");
3203 //Get vertex for photon momentum calculation and event selection
3204 Double_t v[3] = {0,0,0}; //vertex ;
3205 //GetReader()->GetVertex(v);
3207 Int_t nModule2 = -1;
3208 TLorentzVector mom2 ;
3209 Int_t nCaloClusters = caloClusters->GetEntriesFast();
3211 for(Int_t jclus = iclus + 1 ; jclus < nCaloClusters ; jclus++)
3213 AliVCluster* clus2 = (AliVCluster*)caloClusters->At(jclus);
3215 Float_t maxCellFraction = 0.;
3216 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, clus2, maxCellFraction);
3218 // Try to rediuce background with a mild shower shape cut and no more than 1 maxima
3219 // in cluster and remove low energy clusters
3220 if( clus2->GetNCells() <= 1 || !IsGoodCluster(absIdMax,cells) ||
3221 GetCaloUtils()->GetNumberOfLocalMaxima(clus2,cells) > 1 ||
3222 clus2->GetM02() > 0.5 || clus2->E() < fMinInvMassECut ) continue;
3224 //Get cluster kinematics
3225 clus2->GetMomentum(mom2,v);
3227 //Check only certain regions
3229 if(IsFiducialCutOn()) in2 = GetFiducialCut()->IsInFiducialCut(mom2,GetCalorimeter()) ;
3232 //Get module of cluster
3233 nModule2 = GetModuleNumber(clus2);
3238 fhIM ->Fill((mom+mom2).Pt(),(mom+mom2).M());
3241 if(nModule == nModule2 && nModule >= 0 && nModule < fNModules)
3242 fhIMMod[nModule]->Fill((mom+mom2).Pt(),(mom+mom2).M());
3245 //Asymetry histograms
3246 fhAsym->Fill((mom+mom2).Pt(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
3248 }// 2nd cluster loop
3252 //______________________________
3253 void AliAnaCalorimeterQA::Init()
3255 //Check if the data or settings are ok
3257 if(GetCalorimeter() != "PHOS" && GetCalorimeter() !="EMCAL")
3258 AliFatal(Form("Wrong calorimeter name <%s>", GetCalorimeter().Data()));
3260 //if(GetReader()->GetDataType()== AliCaloTrackReader::kMC)
3261 // AliFatal("Analysis of reconstructed data, MC reader not aplicable");
3265 //________________________________________
3266 void AliAnaCalorimeterQA::InitParameters()
3268 //Initialize the parameters of the analysis.
3269 AddToHistogramsName("AnaCaloQA_");
3271 fNModules = 22; // set maximum to maximum number of EMCAL modules
3272 fNRCU = 2; // set maximum number of RCU in EMCAL per SM
3274 fTimeCutMin = -9999999;
3275 fTimeCutMax = 9999999;
3277 fEMCALCellAmpMin = 0.2; // 200 MeV
3278 fPHOSCellAmpMin = 0.2; // 200 MeV
3279 fCellAmpMin = 0.2; // 200 MeV
3280 fMinInvMassECut = 0.5; // 500 MeV
3283 fExoNECrossCuts = 10 ;
3284 fExoNDTimeCuts = 4 ;
3286 fExoDTimeCuts [0] = 1.e4 ; fExoDTimeCuts [1] = 50.0 ; fExoDTimeCuts [2] = 25.0 ; fExoDTimeCuts [3] = 10.0 ;
3287 fExoECrossCuts[0] = 0.80 ; fExoECrossCuts[1] = 0.85 ; fExoECrossCuts[2] = 0.90 ; fExoECrossCuts[3] = 0.92 ; fExoECrossCuts[4] = 0.94 ;
3288 fExoECrossCuts[5] = 0.95 ; fExoECrossCuts[6] = 0.96 ; fExoECrossCuts[7] = 0.97 ; fExoECrossCuts[8] = 0.98 ; fExoECrossCuts[9] = 0.99 ;
3292 //_____________________________________________________________________________
3293 Bool_t AliAnaCalorimeterQA::IsGoodCluster(Int_t absIdMax, AliVCaloCells* cells)
3295 //Identify cluster as exotic or not
3297 if(!fStudyBadClusters) return kTRUE;
3299 if(GetCalorimeter()=="EMCAL")
3301 if(!GetCaloUtils()->GetEMCALRecoUtils()->IsRejectExoticCluster())
3303 return !( GetCaloUtils()->GetEMCALRecoUtils()->IsExoticCell(absIdMax,cells,(GetReader()->GetInputEvent())->GetBunchCrossNumber()) );
3312 Float_t ampMax = cells->GetCellAmplitude(absIdMax);
3313 GetCaloUtils()->RecalibrateCellAmplitude(ampMax, GetCalorimeter(), absIdMax);
3315 if(ampMax < 0.01) return kFALSE;
3317 if(1-GetECross(absIdMax,cells)/ampMax > 0.95) return kFALSE;
3323 //_________________________________________________________
3324 void AliAnaCalorimeterQA::Print(const Option_t * opt) const
3326 //Print some relevant parameters set for the analysis
3330 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3331 AliAnaCaloTrackCorrBaseClass::Print(" ");
3333 printf("Select Calorimeter %s \n",GetCalorimeter().Data());
3334 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
3335 printf("EMCAL Min Amplitude : %2.1f GeV/c\n", fEMCALCellAmpMin) ;
3336 printf("PHOS Min Amplitude : %2.1f GeV/c\n", fPHOSCellAmpMin) ;
3337 printf("Inv. Mass min. E clus : %2.1f GeV/c\n", fMinInvMassECut) ;
3341 //_____________________________________________________
3342 void AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
3344 //Fill Calorimeter QA histograms
3346 //Play with the MC stack if available
3347 if(IsDataMC()) MCHistograms();
3349 // Correlate Calorimeters and V0 and track Multiplicity
3350 if(fCorrelate) Correlate();
3352 //Get List with CaloClusters , calo Cells, init min amplitude
3353 TObjArray * caloClusters = NULL;
3354 AliVCaloCells * cells = 0x0;
3355 if (GetCalorimeter() == "PHOS")
3357 fCellAmpMin = fPHOSCellAmpMin;
3358 caloClusters = GetPHOSClusters();
3359 cells = GetPHOSCells();
3361 else if (GetCalorimeter() == "EMCAL")
3363 fCellAmpMin = fEMCALCellAmpMin;
3364 caloClusters = GetEMCALClusters();
3365 cells = GetEMCALCells();
3368 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - Wrong calorimeter name <%s>, END\n", GetCalorimeter().Data()));
3370 if( !caloClusters || !cells )
3372 AliFatal(Form("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - No CaloClusters or CaloCells available\n"));
3373 return; // trick coverity
3376 if(caloClusters->GetEntriesFast() == 0) return ;
3378 //printf("QA: N cells %d, N clusters %d \n",cells->GetNumberOfCells(),caloClusters->GetEntriesFast());
3381 ClusterLoopHistograms(caloClusters,cells);
3384 CellHistograms(cells);
3387 printf("AliAnaCalorimeterQA::MakeAnalysisFillHistograms() - End \n");
3391 //______________________________________
3392 void AliAnaCalorimeterQA::MCHistograms()
3394 //Get the MC arrays and do some checks before filling MC histograms
3400 TParticle * primStack = 0;
3401 AliAODMCParticle * primAOD = 0;
3402 TLorentzVector mom ;
3404 // Get the ESD MC particles container
3405 AliStack * stack = 0;
3406 if( GetReader()->ReadStack() )
3408 stack = GetMCStack();
3410 nprim = stack->GetNtrack();
3413 // Get the AOD MC particles container
3414 TClonesArray * mcparticles = 0;
3415 if( GetReader()->ReadAODMCParticles() )
3417 mcparticles = GetReader()->GetAODMCParticles();
3418 if( !mcparticles ) return;
3419 nprim = mcparticles->GetEntriesFast();
3422 //printf("N primaries %d\n",nprim);
3423 for(Int_t i=0 ; i < nprim; i++)
3425 if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
3427 // Get the generated particles, check that it is primary (not parton, resonance)
3428 // and get its momentum. Different way to recover from ESD or AOD
3429 if(GetReader()->ReadStack())
3431 primStack = stack->Particle(i) ;
3434 printf("AliAnaCalorimeterQA::MCHistograms() - ESD primaries pointer not available!!\n");
3438 pdg = primStack->GetPdgCode();
3439 status = primStack->GetStatusCode();
3441 //printf("Input: i %d, %s, pdg %d, status %d \n",i, primStack->GetName(), pdg, status);
3443 if ( status > 11 ) continue; //Working for PYTHIA and simple generators, check for HERWIG, HIJING?
3445 if ( primStack->Energy() == TMath::Abs(primStack->Pz()) ) continue ; //Protection against floating point exception
3447 //printf("Take : i %d, %s, pdg %d, status %d \n",i, primStack->GetName(), pdg, status);
3450 primStack->Momentum(mom);
3454 primAOD = (AliAODMCParticle *) mcparticles->At(i);
3457 printf("AliAnaCalorimeterQA::MCHistograms() - AOD primaries pointer not available!!\n");
3461 pdg = primAOD->GetPdgCode();
3462 status = primAOD->GetStatus();
3464 //printf("Input: i %d, %s, pdg %d, status %d \n",i, primAOD->GetName(), pdg, status);
3466 if (!primAOD->IsPrimary()) continue; //accept all which is not MC transport generated. Don't know how to avoid partons
3468 if ( status > 11 ) continue; //Working for PYTHIA and simple generators, check for HERWIG
3470 if ( primAOD->E() == TMath::Abs(primAOD->Pz()) ) continue ; //Protection against floating point exception
3472 //printf("Take : i %d, %s, pdg %d, status %d \n",i, primAOD->GetName(), pdg, status);
3475 mom.SetPxPyPzE(primAOD->Px(),primAOD->Py(),primAOD->Pz(),primAOD->E());
3478 Float_t eMC = mom.E();
3479 if(eMC < 0.2) continue;
3480 Float_t ptMC = mom.E();
3482 Float_t etaMC = mom.Eta();
3483 // Only particles in |eta| < 1
3484 if (TMath::Abs(etaMC) > 1) continue;
3486 Float_t phiMC = mom.Phi();
3488 phiMC += TMath::TwoPi();
3491 if (pdg==22) mcIndex = kmcPhoton;
3492 else if (pdg==111) mcIndex = kmcPi0;
3493 else if (pdg==221) mcIndex = kmcEta;
3494 else if (TMath::Abs(pdg)==11) mcIndex = kmcElectron;
3498 fhGenMCE [mcIndex]->Fill( eMC);
3499 fhGenMCPt[mcIndex]->Fill(ptMC);
3500 if(eMC > 0.5) fhGenMCEtaPhi[mcIndex]->Fill(etaMC,phiMC);
3502 Bool_t inacceptance = kTRUE;
3503 // Check same fidutial borders as in data analysis on top of real acceptance if real was requested.
3504 if( IsFiducialCutOn() && !GetFiducialCut()->IsInFiducialCut(mom,GetCalorimeter()) ) inacceptance = kFALSE ;
3506 if(IsRealCaloAcceptanceOn()) // defined on base class
3508 if(GetReader()->ReadStack() &&
3509 !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primStack)) inacceptance = kFALSE ;
3510 if(GetReader()->ReadAODMCParticles() &&
3511 !GetCaloUtils()->IsMCParticleInCalorimeterAcceptance(GetCalorimeter(), primAOD )) inacceptance = kFALSE ;
3514 if(!inacceptance) continue;
3516 fhGenMCAccE [mcIndex]->Fill( eMC);
3517 fhGenMCAccPt[mcIndex]->Fill(ptMC);
3518 if(eMC > 0.5) fhGenMCAccEtaPhi[mcIndex]->Fill(etaMC,phiMC);
3525 //_________________________________________________________________________________
3526 void AliAnaCalorimeterQA::WeightHistograms(AliVCluster *clus, AliVCaloCells* cells)
3528 // Calculate weights
3530 // First recalculate energy in case non linearity was applied
3533 Float_t energyOrg = clus->E();
3535 // Do study when there are enough cells in cluster
3536 if(clus->GetNCells() < 3) return ;
3538 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3540 Int_t id = clus->GetCellsAbsId()[ipos];
3542 //Recalibrate cell energy if needed
3543 Float_t amp = cells->GetCellAmplitude(id);
3544 GetCaloUtils()->RecalibrateCellAmplitude(amp, GetCalorimeter(), id);
3555 printf("AliAnaCalorimeterQA::WeightHistograms()- Wrong calculated energy %f\n",energy);
3559 //Remove non lin correction
3562 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
3563 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
3565 //Get the ratio and log ratio to all cells in cluster
3566 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
3568 Int_t id = clus->GetCellsAbsId()[ipos];
3570 //Recalibrate cell energy if needed
3571 Float_t amp = cells->GetCellAmplitude(id);
3572 GetCaloUtils()->RecalibrateCellAmplitude(amp, GetCalorimeter(), id);
3574 fhECellClusterRatio ->Fill(energy,amp/energy);
3575 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
3578 //Recalculate shower shape for different W0
3579 if(GetCalorimeter()=="EMCAL")
3581 Float_t l0org = clus->GetM02();
3582 Float_t l1org = clus->GetM20();
3583 Float_t dorg = clus->GetDispersion();
3586 if(IsDataMC() && clus->GetNLabels() > 0)
3588 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(clus->GetLabels(),clus->GetNLabels(), GetReader(),GetCalorimeter());
3590 if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) &&
3591 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) &&
3592 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3593 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3596 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCElectron) &&
3597 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3600 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCConversion) ){
3603 else if( GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPi0) ){
3606 else if(!GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCEta) &&
3607 !GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPhoton) ){
3612 for(Int_t iw = 0; iw < 12; iw++)
3614 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(3+iw*0.25);
3615 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
3617 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
3618 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
3620 if(IsDataMC() && tagMC >= 0)
3622 fhLambda0ForW0MC[iw][tagMC]->Fill(energy,clus->GetM02());
3623 //fhLambda1ForW0MC[iw][tagMC]->Fill(energy,clus->GetM20());
3627 // Set the original values back
3628 clus->SetM02(l0org);
3629 clus->SetM20(l1org);
3630 clus->SetDispersion(dorg);
3634 clus->SetE(energyOrg);