17 #include <TGeoManager.h> 23 #include <TParticle.h> 24 #include <AliMCEvent.h> 28 #include "AliDataFile.h" 29 #include "AliESDEvent.h" 30 #include "AliMCEvent.h" 32 #include "AliVCluster.h" 33 #include "AliVCaloCells.h" 34 #include "AliAODCaloCluster.h" 35 #include "AliOADBContainer.h" 36 #include "AliAnalysisManager.h" 37 #include "AliAODMCParticle.h" 38 #include "AliVParticle.h" 42 #include "AliEMCALGeometry.h" 43 #include "AliPHOSGeoUtils.h" 59 fEMCALGeo(0x0), fPHOSGeo(0x0),
60 fEMCALGeoMatrixSet(kFALSE), fPHOSGeoMatrixSet(kFALSE),
61 fLoadEMCALMatrices(kFALSE), fLoadPHOSMatrices(kFALSE),
62 fRemoveBadChannels(kFALSE), fPHOSBadChannelMap(0x0),
63 fNCellsFromPHOSBorder(0),
64 fNMaskCellColumns(0), fMaskCellColumns(0x0),
65 fRecalibration(kFALSE), fRunDependentCorrection(kFALSE),
67 fRecalculatePosition(kFALSE), fCorrectELinearity(kFALSE),
68 fRecalculateMatching(kFALSE),
70 fCutEta(20), fCutPhi(20),
71 fLocMaxCutE(0), fLocMaxCutEDiff(0),
72 fPlotCluster(0), fOADBSet(kFALSE),
73 fOADBForEMCAL(kFALSE), fOADBForPHOS(kFALSE),
74 fOADBFilePathEMCAL(
""), fOADBFilePathPHOS(
""),
75 fImportGeometryFromFile(0), fImportGeometryFilePath(
""),
76 fNSuperModulesUsed(0),
77 fFirstSuperModuleUsed(-1), fLastSuperModuleUsed(-1),
79 fMCECellClusFracCorrOn(0), fMCECellClusFracCorrParam()
132 AliOADBContainer *contBC=
new AliOADBContainer(
"");
134 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALBadChannels");
136 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"AliEMCALBadChannels");
143 AliInfo(
"Remove EMCAL bad cells");
145 for (
Int_t i=0; i<nSM; ++i)
152 hbm=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
156 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
160 hbm->SetDirectory(0);
164 }
else AliInfo(
"Do NOT remove EMCAL bad channels");
172 AliOADBContainer *contRF=
new AliOADBContainer(
"");
175 contRF->InitFromFile(Form(
"%s/EMCALRecalib.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALRecalib");
177 contRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALRecalib.root").data(),
"AliEMCALRecalib");
191 AliInfo(
"Recalibrate EMCAL");
192 for (
Int_t i=0; i < nSM; ++i)
199 h = (
TH2F*)recalib->FindObject(Form(
"EMCALRecalFactors_SM%d",i));
203 AliError(Form(
"Could not load EMCALRecalFactors_SM%d",i));
211 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params object array");
212 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for pass");
213 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for run");
224 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
227 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALRunDepTempCalibCorrections");
229 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
231 TH1S *htd=(TH1S*)contRFTD->GetObject(
fRunNumber);
236 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",
fRunNumber));
240 Int_t maxEntry = contRFTD->GetNumberOfEntries();
242 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) <
fRunNumber) )
248 Int_t closest = lower;
249 if ( (ic<maxEntry) &&
255 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
256 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
261 AliInfo(
"Recalibrate (Temperature) EMCAL");
263 for (
Int_t ism=0; ism<nSM; ++ism)
265 for (
Int_t icol=0; icol<48; ++icol)
267 for (
Int_t irow=0; irow<24; ++irow)
271 Int_t absID =
fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol);
272 factor *= htd->GetBinContent(absID) / 10000. ;
281 }
else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
289 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
292 contTRF->InitFromFile(Form(
"%s/EMCALTimeCalib.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALTimeCalib");
294 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeCalib.root").data(),
"AliEMCALTimeCalib");
302 if ( pass==
"spc_calo" ) passM =
"pass3";
311 AliInfo(
"Time Recalibrate EMCAL");
312 for (
Int_t ibc = 0; ibc < 4; ++ibc)
319 h = (TH1F*)trecalpass->FindObject(Form(
"hAllTimeAvBC%d",ibc));
323 AliError(Form(
"Could not load hAllTimeAvBC%d",ibc));
331 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for pass");
332 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for run");
340 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
342 contTRF->InitFromFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALTimeL1PhaseCalib");
344 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"AliEMCALTimeL1PhaseCalib");
349 AliError(Form(
"L1 phase time recal: No params for run %d. Default used.",
fRunNumber));
350 trecal=(
TObjArray*)contTRF->GetObject(0);
364 AliInfo(Form(
"L1 phase time recal: No params for run %d and pass %s, try default",
fRunNumber, passM.Data()));
368 trecal=(
TObjArray*)contTRF->GetObject(0);
371 trecalpass=(
TObjArray*)trecal->FindObject(
"pass1");
373 AliInfo(
"Time L1 phase Recalibrate EMCAL");
382 h = (TH1C*)trecalpass->FindObject(Form(
"h%d",
fRunNumber));
384 if (!h) AliError(Form(
"Could not load h%d",
fRunNumber));
392 AliError(
"Do not calibrate L1 phase time");
398 AliError(
"Do not calibrate L1 phase time");
415 AliOADBContainer badmapContainer(Form(
"phosBadMap"));
417 badmapContainer.InitFromFile(Form(
"%s/PHOSBadMaps.root",
fOADBFilePathPHOS.Data()),
"phosBadMap");
423 AliInfo(Form(
"Can not read PHOS bad map for run %d",
fRunNumber)) ;
427 AliInfo(Form(
"Setting PHOS bad map with name %s",maps->GetName())) ;
429 for(
Int_t mod = 1; mod < 5; mod++)
436 hbmPH = (TH2I*)maps->At(mod);
438 if(hbmPH) hbmPH->SetDirectory(0);
468 AliInfo(
"Load user defined EMCAL geometry matrices");
471 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
473 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePathEMCAL.Data()),
"AliEMCALgeo");
475 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
479 for(
Int_t mod=0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
483 AliDebug(1,Form(
"EMCAL matrices SM %d, %p", mod,((TGeoHMatrix*) matEMCAL->At(mod))));
498 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
499 fEMCALGeo->SetMisalMatrix(
fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
503 AliError(Form(
"Alignment atrix for SM %d is not available",mod));
510 else if (!gGeoManager)
512 AliDebug(1,
"Load EMCAL misalignment matrices");
513 if(!strcmp(inputEvent->GetName(),
"AliESDEvent"))
515 for(
Int_t mod = 0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
518 if(((
AliESDEvent*)inputEvent)->GetEMCALMatrix(mod))
529 AliDebug(1,
"Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file");
543 AliInfo(
"Load user defined PHOS geometry matrices");
546 AliOADBContainer geomContainer(
"phosGeo");
547 geomContainer.InitFromFile(Form(
"%s/PHOSGeometry.root",
fOADBFilePathPHOS.Data()),
"PHOSRotationMatrixes");
548 TObjArray *matPHOS = (
TObjArray*)geomContainer.GetObject(139000,
"PHOSRotationMatrixes");
550 for(
Int_t mod = 0 ; mod < 5 ; mod++)
554 AliDebug(1,Form(
"PHOS matrices module %d, %p",mod,((TGeoHMatrix*) matPHOS->At(mod))));
557 fPHOSMatrix[mod] = (TGeoHMatrix*) matPHOS->At(mod) ;
573 else if (!gGeoManager)
575 AliDebug(1,
"Load PHOS misalignment matrices.");
576 if(!strcmp(inputEvent->GetName(),
"AliESDEvent"))
578 for(
Int_t mod = 0; mod < 5; mod++)
580 if( ((
AliESDEvent*)inputEvent)->GetPHOSMatrix(mod))
591 AliDebug(1,
"Setting of EMCAL transformation matrixes for AODs not implemented yet. \n Import geometry.root file");
607 Bool_t areNeighbours = kFALSE ;
609 Int_t iRCU1 = -1, irow1 = -1, icol1 = -1;
610 Int_t iRCU2 = -1, irow2 = -1, icol2 = -1;
612 Int_t rowdiff = 0, coldiff = 0;
621 if(nSupMod1%2) icol1+=AliEMCALGeoParams::fgkEMCALCols;
622 else icol2+=AliEMCALGeoParams::fgkEMCALCols;
625 rowdiff = TMath::Abs( irow1 - irow2 ) ;
626 coldiff = TMath::Abs( icol1 - icol2 ) ;
629 if ((coldiff + rowdiff == 1 ))
630 areNeighbours = kTRUE ;
632 return areNeighbours;
640 AliVCluster* cluster)
650 for(
Int_t iDigit = 0; iDigit < cluster->GetNCells(); iDigit++)
653 geom->GetCellIndex(cluster->GetCellAbsId(iDigit),iSupMod,iTower,iIphi,iIeta);
654 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta, iphi,ieta);
657 if (iDigit == 0 ) iSM0 = iSupMod;
658 else if(iSupMod != iSM0)
660 if(iSupMod > 11 && iSupMod < 18)
661 AliWarning(Form(
"Cluster shared in 2 DCal: SM%d, SM%d??",iSupMod,iSM0));
675 AliVCaloCells* cells)
const 686 for(
Int_t i = 0; i < cluster->GetNCells() ; i++)
688 Int_t absId = cluster->GetCellAbsId(i) ;
689 Float_t amp = cells->GetCellAmplitude(absId);
698 AliDebug(1,Form(
"Cluster Max AbsId %d, Cell Energy %2.2f, Cluster Energy %2.2f",
699 absIdMax, ampMax, cluster->E()));
701 if ( absIdMax == -1 )
return kFALSE;
707 if ( cells->GetType() == AliVCaloCells::kEMCALCell )
712 Int_t iTower = -1, iIphi = -1, iIeta = -1, iphi = -1, ieta = -1, iSM = -1;
714 fEMCALGeo->GetCellIndex(absIdMax,iSM,iTower,iIphi,iIeta);
716 fEMCALGeo->GetCellPhiEtaIndexInSModule(iSM,iTower,iIphi, iIeta,iphi,ieta);
718 if(iSM < 0 || iphi < 0 || ieta < 0 )
720 AliFatal(Form(
"Negative value for super module: %d, or cell ieta: %d, or cell iphi: %d, check EMCAL geometry name",iSM,ieta,iphi));
726 if ( iSM < 10 || (iSM > 11 && iSM < 18) )
728 if(iphi >= nborder && iphi < 24-nborder) okrow = kTRUE;
732 if(iphi >= nborder && iphi < 8-nborder) okrow = kTRUE;
740 if(ieta > nborder && ieta < 48-nborder) okcol =kTRUE;
746 if(ieta >= nborder) okcol = kTRUE;
750 if(ieta < 48-nborder) okcol = kTRUE;
754 AliDebug(1,Form(
"EMCAL Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d ? ok row %d, ok column %d",
755 nborder, ieta, iphi, iSM,okrow,okcol));
758 else if ( cells->GetType() == AliVCaloCells::kPHOSCell )
761 Int_t irow = -1, icol = -1;
762 fPHOSGeo->AbsToRelNumbering(absIdMax,relId);
764 if (relId[1] != 0 )
return kFALSE;
770 if(irow >= fNCellsFromPHOSBorder && irow < 64-fNCellsFromPHOSBorder) okrow =kTRUE;
771 if(icol >= fNCellsFromPHOSBorder && icol < 56-fNCellsFromPHOSBorder) okcol =kTRUE;
773 AliDebug(1,Form(
"PHOS Cluster in %d cells fiducial volume: ieta %d, iphi %d, SM %d ? ok row %d, ok column %d",
774 fNCellsFromPHOSBorder, icol, irow, relId[0]-1,okrow,okcol));
777 if (okcol && okrow)
return kTRUE;
796 for(
Int_t iCell = 0; iCell<nCells; iCell++)
806 fPHOSGeo->AbsToRelNumbering(cellList[iCell],relId);
808 if (relId[1] != 0 )
return kTRUE;
843 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - **** Start ***\n");
849 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Remove exotics in EMCAL\n");
862 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on energy recalibration in EMCAL\n");
871 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on bad channels removal in EMCAL\n");
880 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on time recalibration in EMCAL\n");
898 printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kBeamTestCorrected xxx\n");
905 printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kPi0MCv3 xxx\n");
915 printf(
"ConfigureEMCALRecoUtils() xxx DON'T SET Non linearity correction xxx\n");
941 if ( cells->IsEMCAL() )
943 Double_t tcell = cells->GetCellTime(absID);
949 Int_t icol = -1, irow = -1,iRCU = -1;
952 Int_t absId1 = -1, absId2 = -1, absId3 = -1, absId4 = -1;
954 Int_t relId1[] = { imod+1, 0, irow+1, icol };
955 Int_t relId2[] = { imod+1, 0, irow-1, icol };
956 Int_t relId3[] = { imod+1, 0, irow , icol+1 };
957 Int_t relId4[] = { imod+1, 0, irow , icol-1 };
959 fPHOSGeo->RelToAbsNumbering(relId1, absId1);
960 fPHOSGeo->RelToAbsNumbering(relId2, absId2);
961 fPHOSGeo->RelToAbsNumbering(relId3, absId3);
962 fPHOSGeo->RelToAbsNumbering(relId4, absId4);
964 Float_t ecell1 = 0, ecell2 = 0, ecell3 = 0, ecell4 = 0;
966 if(absId1 > 0 ) ecell1 = cells->GetCellAmplitude(absId1);
967 if(absId2 > 0 ) ecell2 = cells->GetCellAmplitude(absId2);
968 if(absId3 > 0 ) ecell3 = cells->GetCellAmplitude(absId3);
969 if(absId4 > 0 ) ecell4 = cells->GetCellAmplitude(absId4);
971 return ecell1+ecell2+ecell3+ecell4;
990 regEta = regPhi = -1 ;
992 if(!clus->IsEMCAL())
return ;
994 Int_t icol = -1, irow = -1, iRCU = -1;
1002 if( sm%2 == 1) icol+=AliEMCALGeoParams::fgkEMCALCols;
1005 if(icol < 2 || icol > 93 || irow < 2 || irow > 21)
return;
1012 if ( icol > 9 && icol < 34 ) regEta = 0;
1013 else if ( icol > 62 && icol < 87 ) regEta = 0;
1017 else if ( icol <= 9 && icol >= 5 ) regEta = 3;
1018 else if ( icol <= 38 && icol >= 34 ) regEta = 3;
1019 else if ( icol <= 62 && icol >= 58 ) regEta = 3;
1020 else if ( icol <= 91 && icol >= 87 ) regEta = 3;
1024 else if ( icol < 58 && icol > 38 ) regEta = 1 ;
1034 if ( irow >= 2 && irow <= 5 ) regPhi = 0;
1035 else if ( irow >= 18 && irow <= 21 ) regPhi = 0;
1036 else if ( irow >= 6 && irow <= 9 ) regPhi = 1;
1037 else if ( irow >= 14 && irow <= 17 ) regPhi = 1;
1056 Int_t absIdSMMin =
fEMCALGeo->GetAbsCellIdFromCellIndexes(sm,0,1);
1059 for(
Int_t k = 0; k < 4; k++ )
1061 for(
Int_t p = 0; p < 72; p++ )
1063 Int_t n = absIdSMMin + 2*k + 16 *p;
1065 if ( absId == n || absId == n+1 ||
1066 absId == n+8 || absId == n+9 )
1069 absIdCorr[1] = n+1 ;
1070 absIdCorr[2] = n+8 ;
1071 absIdCorr[3] = n+9 ;
1106 if(absId1 == absId2)
return kFALSE;
1111 if ( sm1 != sm2 )
return kFALSE ;
1114 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1117 fEMCALGeo->GetCellIndex(absId1,sm1,iTower,iIphi,iIeta);
1118 fEMCALGeo->GetCellPhiEtaIndexInSModule(sm1,iTower,iIphi, iIeta,row1,col1);
1121 fEMCALGeo->GetCellIndex(absId2,sm2,iTower,iIphi,iIeta);
1122 fEMCALGeo->GetCellPhiEtaIndexInSModule(sm2,iTower,iIphi, iIeta,row2,col2);
1127 Int_t rowDiff0 = row2-row0;
1128 Int_t colDiff0 = col2-col0;
1130 rowDiff = row1-row2;
1131 colDiff = col1-col2;
1134 if ( colDiff0 >=0 && colDiff0 < 2 && rowDiff0 >=0 && rowDiff0 < 8 )
1153 Float_t & clusterFraction)
const 1155 if( !clu || !cells )
1157 AliInfo(
"Cluster or cells pointer is null!");
1166 Int_t cellAbsId =-1 , absId =-1 ;
1167 Int_t iSupMod =-1 , ieta =-1 , iphi = -1, iRCU = -1;
1172 for (
Int_t iDig=0; iDig< clu->GetNCells(); iDig++)
1174 cellAbsId = clu->GetCellAbsId(iDig);
1176 fraction = clu->GetCellAmplitudeFraction(iDig);
1177 if(fraction < 1e-4) fraction = 1.;
1189 eCell = cells->GetCellAmplitude(cellAbsId)*fraction*recalFactor;
1202 clusterFraction = (eTot-eMax)/eTot;
1204 clusterFraction =1.;
1215 AliVEvent* event,
Int_t index)
const 1217 AliVTrack *track = 0x0;
1228 AliInfo(Form(
"Wrong track index %d, from recalculation", trackIndex));
1230 track =
dynamic_cast<AliVTrack*
> (
event->GetTrack(trackIndex));
1240 if( cluster->GetNTracksMatched() < 1 )
return 0x0;
1246 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",cluster->ClassName())))
1248 if( index >= 0 ) iTrack = index;
1249 else iTrack = ((AliESDCaloCluster*)cluster)->GetTracksMatched()->At(0);
1251 track =
dynamic_cast<AliVTrack*
> (
event->GetTrack(iTrack) );
1255 if( index > 0 ) iTrack = index;
1257 track =
dynamic_cast<AliVTrack*
>( cluster->GetTrackMatched(iTrack) );
1269 if( eCluster <= 0 || eCluster < eCell )
1271 AliWarning(Form(
"Bad values eCell=%f, eCluster %f",eCell,eCluster));
1275 Float_t frac = eCell / eCluster;
1297 fEMCALGeo->GetAbsCellIdFromEtaPhi(particle->
Eta(),particle->
Phi(), absId);
1299 AliDebug(2,Form(
"EMCAL: cluster eta %f, phi %f, absid %d, SuperModule %d",
1300 particle->
Eta(), particle->
Phi()*TMath::RadToDeg(),absId,
fEMCALGeo->GetSuperModuleNumber(absId)));
1302 return fEMCALGeo->GetSuperModuleNumber(absId) ;
1308 if(strcmp(inputEvent->ClassName(),
"AliMCEvent") == 0 )
1313 TParticle* primary = ((AliMCEvent*)inputEvent)->Particle(particle->
GetCaloLabel(0));
1317 fPHOSGeo->ImpactOnEmc(primary,mod,z,x) ;
1321 AliFatal(
"Primary not available, stop!");
1346 AliDebug(1,
"AliCalorimeterUtils::GetModuleNumber() - NUL Cluster, please check!!!");
1351 if ( cluster->GetNCells() <= 0 )
return -1;
1353 Int_t absId = cluster->GetCellAbsId(0);
1355 if ( absId < 0 )
return -1;
1357 if( cluster->IsEMCAL() )
1359 AliDebug(2,Form(
"EMCAL absid %d, SuperModule %d",absId,
fEMCALGeo->GetSuperModuleNumber(absId)));
1361 return fEMCALGeo->GetSuperModuleNumber(absId) ;
1363 else if ( cluster->IsPHOS() )
1366 fPHOSGeo->AbsToRelNumbering(absId,relId);
1368 if (relId[1] != 0 )
return -1;
1370 AliDebug(2,Form(
"PHOS absid %d Module %d",absId, relId[0]-1));
1386 if ( absId < 0 )
return -1 ;
1390 Int_t iTower = -1, iIphi = -1, iIeta = -1;
1391 fEMCALGeo->GetCellIndex(absId,imod,iTower,iIphi,iIeta);
1392 fEMCALGeo->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,irow,icol);
1394 if(imod < 0 || irow < 0 || icol < 0 )
1396 AliFatal(Form(
"Negative value for super module: %d, or cell icol: %d, or cell irow: %d, check EMCAL geometry name",imod,icol,irow));
1403 if ( imod == 13 || imod == 15 || imod == 17 ) ico2 += 16;
1406 if(imod < 10 || (imod > 11 && imod < 18))
1409 if ( 0 <= irow && irow < 8 ) iRCU = 0;
1410 else if ( 8 <= irow && irow < 16 &&
1411 0 <= ico2 && ico2 < 24 ) iRCU = 0;
1415 else if ( 8 <= irow && irow < 16 &&
1416 24 <= ico2 && ico2 < 48 ) iRCU = 1;
1418 else if ( 16 <= irow && irow < 24 ) iRCU = 1;
1420 if ( imod%2 == 1 ) iRCU = 1 - iRCU;
1429 AliFatal(Form(
"Wrong EMCAL RCU number = %d", iRCU));
1436 fPHOSGeo->AbsToRelNumbering(absId,relId);
1438 if (relId[1] != 0 )
return -1;
1443 iRCU= (
Int_t)(relId[2]-1)/16 ;
1448 AliFatal(Form(
"Wrong PHOS RCU number = %d", iRCU));
1474 irowAbs = irow + 64 * imod;
1485 Int_t shiftEta = 48;
1488 if ( imod > 11 && imod < 18) shiftEta+=48/3;
1490 icolAbs = (imod % 2) ? icol + shiftEta : icol;
1494 irowAbs = irow + 24 *
Int_t(imod / 2);
1497 if ( imod > 11 && imod < 20) irowAbs -= (2*24 / 3);
1509 const Int_t nc = cluster->GetNCells();
1511 Int_t absIdList[nc];
1529 const Int_t nCells = cluster->GetNCells();
1537 simuTotWeight/= eCluster;
1547 for(iDigit = 0; iDigit < nCells ; iDigit++)
1549 absIdList[iDigit] = cluster->GetCellsAbsId()[iDigit] ;
1550 Float_t en = cells->GetCellAmplitude(absIdList[iDigit]);
1559 idmax = absIdList[iDigit] ;
1566 for(iDigit = 0 ; iDigit < nCells; iDigit++)
1568 if( absIdList[iDigit] >= 0 )
1570 absId1 = cluster->GetCellsAbsId()[iDigit];
1572 Float_t en1 = cells->GetCellAmplitude(absId1);
1580 for(iDigitN = 0; iDigitN < nCells; iDigitN++)
1582 absId2 = cluster->GetCellsAbsId()[iDigitN] ;
1584 if(absId2==-1 || absId2==absId1)
continue;
1588 Float_t en2 = cells->GetCellAmplitude(absId2);
1601 absIdList[iDigitN] = -1 ;
1606 absIdList[iDigit] = -1 ;
1611 absIdList[iDigit] = -1 ;
1616 absIdList[iDigitN] = -1 ;
1627 for(iDigit = 0; iDigit < nCells; iDigit++)
1629 if( absIdList[iDigit] >= 0 )
1631 absIdList[iDigitN] = absIdList[iDigit] ;
1633 Float_t en = cells->GetCellAmplitude(absIdList[iDigit]);
1641 maxEList[iDigitN] = en ;
1650 AliDebug(1,Form(
"No local maxima found, assign highest energy cell as maxima, id %d, en cell %2.2f, en cluster %2.2f",
1651 idmax,emax,cluster->E()));
1653 maxEList[0] = emax ;
1654 absIdList[0] = idmax ;
1658 AliDebug(1,Form(
"In cluster E %2.2f (wth non lin. %2.2f), M02 %2.2f, M20 %2.2f, N maxima %d",
1659 cluster->E(),eCluster, cluster->GetM02(),cluster->GetM20(), iDigitN));
1674 if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1676 AliError(
"AliCalorimeterUtils::GetPass() - Pointer to tree = 0, returning null");
1680 if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1682 AliError(
"AliCalorimeterUtils::GetPass() - Null pointer input file, returning null");
1686 TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1687 if (pass.Contains(
"ass1"))
return TString(
"pass1");
1688 else if (pass.Contains(
"ass2"))
return TString(
"pass2");
1689 else if (pass.Contains(
"ass3"))
return TString(
"pass3");
1690 else if (pass.Contains(
"ass4"))
return TString(
"pass4");
1691 else if (pass.Contains(
"ass5"))
return TString(
"pass5");
1692 else if (pass.Contains(
"LHC11c") && pass.Contains(
"spc_calo") )
return TString(
"spc_calo");
1693 else if (pass.Contains(
"calo") || pass.Contains(
"high_lumi"))
1695 AliInfo(
"Path contains <calo> or <high-lumi>, set as <pass1>");
1698 else if (pass.Contains(
"LHC14a1a"))
1700 AliInfo(
"Check that Energy calibration was enabled for this MC production in the tender, clusterizer or here!!");
1706 AliInfo(
"Pass number string not found");
1758 AliDebug(1,
"Init bad channel map");
1761 Bool_t oldStatus = TH1::AddDirectoryStatus();
1762 TH1::AddDirectory(kFALSE);
1765 for (
int i = 0; i < 5; i++)
fPHOSBadChannelMap->Add(
new TH2I(Form(
"PHOS_BadMap_mod%d",i),
1766 Form(
"PHOS_BadMap_mod%d",i),
1767 64, 0, 64, 56, 0, 56));
1773 TH1::AddDirectory(oldStatus);
1781 AliDebug(1,
"Init recalibration map");
1784 Bool_t oldStatus = TH1::AddDirectoryStatus();
1785 TH1::AddDirectory(kFALSE);
1788 for (
int i = 0; i < 5; i++)
1791 Form(
"PHOSRecalFactors_Mod%d",i),
1792 64, 0, 64, 56, 0, 56));
1796 for (
Int_t m = 0; m < 5; m++)
1798 for (
Int_t i = 0; i < 56; i++)
1800 for (
Int_t j = 0; j < 64; j++)
1811 TH1::AddDirectory(oldStatus);
1826 AliInfo(Form(
"Get EMCAL geometry name to <%s> for run %d",
fEMCALGeo->GetName(),
fRunNumber));
1831 AliInfo(Form(
"Set EMCAL geometry name to <%s>",
fEMCALGeoName.Data()));
1850 else if (!gGeoManager) AliInfo(
"Careful!, gGeoManager not loaded, load misalign matrices");
1879 AliFatal(Form(
"Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1895 Int_t icol = -1, irow = -1, iRCU = -1;
1898 if(status > 0) ok = kFALSE;
1917 AliFatal(Form(
"Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1921 Float_t phi = particle->Phi();
1922 if(phi < 0) phi+=TMath::TwoPi();
1928 Double_t vtx[]={ particle->Xv(), particle->Yv(), particle->Zv() } ;
1929 return GetPHOSGeometry()->ImpactOnEmc(vtx, particle->Theta(), phi, mod, z, x) ;
1937 Int_t icol = -1, irow = -1, iRCU = -1;
1940 if(status > 0) ok = kFALSE;
1959 AliFatal(Form(
"Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
1963 Float_t phi = particle->Phi();
1964 if(phi < 0) phi+=TMath::TwoPi();
1970 Double_t vtx[]={ particle->Xv(), particle->Yv(), particle->Zv() } ;
1971 return GetPHOSGeometry()->ImpactOnEmc(vtx, particle->Theta(), phi, mod, z, x) ;
1979 Int_t icol = -1, irow = -1, iRCU = -1;
1982 if(status > 0) ok = kFALSE;
2002 AliFatal(Form(
"Careful Geo Matrix for calo <%d> is not set, use AliFidutialCut instead",calo));
2007 if(phi < 0) phi+=TMath::TwoPi();
2021 Int_t icol = -1, irow = -1, iRCU = -1;
2024 if(status > 0) ok = kFALSE;
2040 if ( iSM%2 ) icol+=48;
2061 printf(
"***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
2063 printf(
"Remove Clusters with max cell at less than %d cells from EMCAL border and %d cells from PHOS border\n",
2069 printf(
"Matching criteria: dR < %2.2f[cm], dZ < %2.2f[cm]\n",
fCutR,
fCutZ);
2128 AliVCaloCells * cells)
2136 UShort_t * index = cluster->GetCellsAbsId() ;
2137 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
2138 Int_t ncells = cluster->GetNCells();
2144 for(
Int_t icell = 0; icell < ncells; icell++)
2146 Int_t absId = index[icell];
2148 frac = fraction[icell];
2149 if(frac < 1e-3) frac = 1;
2151 Float_t amp = cells->GetCellAmplitude(absId);
2154 AliDebug(2,Form(
"Recalibrate cell: calo <%d>, cell fraction %f, cell energy: before cal %f; after cal %f",
2155 calo,frac,cells->GetCellAmplitude(absId),amp));
2160 AliDebug(1,Form(
"Energy before %f, after %f",cluster->E(),
energy));
2170 AliVCaloCells * cells,
Float_t energyOrg)
2176 UShort_t * index = cluster->GetCellsAbsId() ;
2177 Double_t * fraction = cluster->GetCellsAmplitudeFraction() ;
2178 Int_t ncells = cluster->GetNCells();
2184 for(
Int_t icell = 0; icell < ncells; icell++)
2186 Int_t absId = index[icell];
2188 frac = fraction[icell];
2189 if(frac < 1e-3) frac = 1;
2191 Float_t amp = cells->GetCellAmplitude(absId);
2196 AliDebug(2,Form(
"Recalibrate cell: calo <%d>, cell fraction %f, cell energy %f",
2197 calo,frac,cells->GetCellAmplitude(absId)));
2202 AliDebug(1,Form(
"Energy before %f, after %f",cluster->E(),
energy));
2235 Int_t nClusters =
event->GetNumberOfCaloClusters();
2236 if(clusterArray) nClusters = clusterArray->GetEntriesFast();
2238 AliVCluster * clus = 0;
2240 for (
Int_t iclus = 0; iclus < nClusters ; iclus++)
2242 if ( clusterArray ) clus = (AliVCluster*) clusterArray->At(iclus) ;
2243 else clus =
event->GetCaloCluster(iclus) ;
2245 if (!clus->IsEMCAL())
continue ;
2252 if ( TMath::Abs(clus->GetTrackDx()) < 500 )
2253 AliDebug(2,Form(
"Residuals (Old, New): z (%2.4f,%2.4f), x (%2.4f,%2.4f)",
2254 clus->GetTrackDz(),dZ,clus->GetTrackDx(),dR));
2256 clus->SetTrackDistance(dR,dZ);
2261 if(clus->GetNTracksMatched() > 0)
2263 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",clus->ClassName())))
2266 ((AliESDCaloCluster*)clus)->AddTracksMatched(arrayTrackMatched);
2270 for(
Int_t iTrack = 0; iTrack < clus->GetNTracksMatched(); iTrack++)
2272 ((AliAODCaloCluster*)clus)->RemoveTrackMatched((
TObject*)((AliAODCaloCluster*)clus)->GetTrackMatched(iTrack));
2281 if ( trackIndex >= 0 )
2283 if(!strcmp(
"AliESDCaloCluster",Form(
"%s",clus->ClassName())))
2286 arrayTrackMatched[0] = trackIndex;
2287 ((AliESDCaloCluster*)clus)->AddTracksMatched(arrayTrackMatched);
2291 ((AliAODCaloCluster*)clus)->AddTrackMatched((
TObject*)event->GetTrack(trackIndex));
2313 AliVCluster* cluster,
2314 AliVCaloCells* cells,
2316 AliAODCaloCluster* cluster1,
2317 AliAODCaloCluster* cluster2,
2320 TH2F* hClusterMap = 0 ;
2321 TH2F* hClusterLocMax = 0 ;
2322 TH2F* hCluster1 = 0 ;
2323 TH2F* hCluster2 = 0 ;
2327 hClusterMap =
new TH2F(
"hClusterMap",
"Cluster Map",48,0,48,24,0,24);
2328 hClusterLocMax =
new TH2F(
"hClusterLocMax",
"Cluster 2 highest local maxima",48,0,48,24,0,24);
2329 hCluster1 =
new TH2F(
"hCluster1",
"Cluster 1",48,0,48,24,0,24);
2330 hCluster2 =
new TH2F(
"hCluster2",
"Cluster 2",48,0,48,24,0,24);
2331 hClusterMap ->SetXTitle(
"column");
2332 hClusterMap ->SetYTitle(
"row");
2333 hClusterLocMax ->SetXTitle(
"column");
2334 hClusterLocMax ->SetYTitle(
"row");
2335 hCluster1 ->SetXTitle(
"column");
2336 hCluster1 ->SetYTitle(
"row");
2337 hCluster2 ->SetXTitle(
"column");
2338 hCluster2 ->SetYTitle(
"row");
2342 if(cluster->IsPHOS())
2345 AliWarning(
"Not supported for PHOS yet");
2349 const Int_t ncells = cluster->GetNCells();
2350 Int_t absIdList[ncells];
2353 Int_t icol = -1, irow = -1, iRCU = -1, sm = -1;
2355 Float_t minCol = 100, minRow = 100, maxCol = -1, maxRow = -1;
2356 for(
Int_t iDigit = 0; iDigit < ncells; iDigit++ )
2358 absIdList[iDigit] = cluster->GetCellsAbsId()[iDigit];
2360 Float_t ec = cells->GetCellAmplitude(absIdList[iDigit]);
2368 if(sm > -1 && sm < 12)
2370 if(icol > maxCol) maxCol = icol;
2371 if(icol < minCol) minCol = icol;
2372 if(irow > maxRow) maxRow = irow;
2373 if(irow < minRow) minRow = irow;
2374 hClusterMap->Fill(icol,irow,ec);
2383 absIdList1[0] = absId1 ;
2384 fracList1 [0] = 1. ;
2386 Float_t ecell1 = cells->GetCellAmplitude(absId1);
2393 absIdList2[0] = absId2 ;
2394 fracList2 [0] = 1. ;
2396 Float_t ecell2 = cells->GetCellAmplitude(absId2);
2402 Int_t icol1 = -1, irow1 = -1, icol2 = -1, irow2 = -1;
2404 hClusterLocMax->Fill(icol1,irow1,ecell1);
2406 hClusterLocMax->Fill(icol2,irow2,ecell2);
2410 Float_t eRemain = (eCluster-ecell1-ecell2)/2;
2411 Float_t shareFraction1 = ecell1/eCluster+eRemain/eCluster;
2412 Float_t shareFraction2 = ecell2/eCluster+eRemain/eCluster;
2414 for(
Int_t iDigit = 0; iDigit < ncells; iDigit++)
2416 Int_t absId = absIdList[iDigit];
2418 if ( absId==absId1 || absId==absId2 || absId < 0 )
continue;
2420 Float_t ecell = cells->GetCellAmplitude(absId);
2425 absIdList1[ncells1]= absId;
2429 fracList1[ncells1] = shareFraction1;
2430 e1 += ecell*shareFraction1;
2434 fracList1[ncells1] = 1.;
2444 absIdList2[ncells2]= absId;
2448 fracList2[ncells2] = shareFraction2;
2449 e2 += ecell*shareFraction2;
2453 fracList2[ncells2] = 1.;
2462 AliDebug(1,Form(
"N Local Max %d, Cluster energy = %f, Ecell1 = %f, Ecell2 = %f, Enew1 = %f, Enew2 = %f, Remain %f, \n ncells %d, ncells1 %d, ncells2 %d, f1 %f, f2 %f, sum f12 = %f",
2463 nMax, eCluster,ecell1,ecell2,e1,e2,eCluster-e1-e2,ncells,ncells1,ncells2,shareFraction1,shareFraction2,shareFraction1+shareFraction2));
2468 cluster1->SetNCells(ncells1);
2469 cluster2->SetNCells(ncells2);
2471 cluster1->SetCellsAbsId(absIdList1);
2472 cluster2->SetCellsAbsId(absIdList2);
2474 cluster1->SetCellsAmplitudeFraction(fracList1);
2475 cluster2->SetCellsAmplitudeFraction(fracList2);
2490 for(
Int_t iDigit = 0; iDigit < ncells1; iDigit++ )
2496 Float_t ecell = cells->GetCellAmplitude(absIdList1[iDigit]);
2499 if(
AreNeighbours(calorimeter, absId2,absIdList1[iDigit]) && absId1!=absIdList1[iDigit])
2500 hCluster1->Fill(icol,irow,ecell*shareFraction1);
2502 hCluster1->Fill(icol,irow,ecell);
2508 for(
Int_t iDigit = 0; iDigit < ncells2; iDigit++ )
2514 Float_t ecell = cells->GetCellAmplitude(absIdList2[iDigit]);
2517 if(
AreNeighbours(calorimeter, absId1,absIdList2[iDigit]) && absId2!=absIdList2[iDigit])
2518 hCluster2->Fill(icol,irow,ecell*shareFraction2);
2520 hCluster2->Fill(icol,irow,ecell);
2524 gStyle->SetPadRightMargin(0.1);
2525 gStyle->SetPadLeftMargin(0.1);
2526 gStyle->SetOptStat(0);
2527 gStyle->SetOptFit(000000);
2529 if(maxCol-minCol > maxRow-minRow)
2531 maxRow+= maxCol-minCol;
2535 maxCol+= maxRow-minRow;
2538 TCanvas *
c=
new TCanvas(
"canvas",
"canvas", 4000, 4000) ;
2544 hClusterMap ->SetAxisRange(minCol, maxCol,
"X");
2545 hClusterMap ->SetAxisRange(minRow, maxRow,
"Y");
2546 hClusterMap ->Draw(
"colz TEXT");
2551 hClusterLocMax ->SetAxisRange(minCol, maxCol,
"X");
2552 hClusterLocMax ->SetAxisRange(minRow, maxRow,
"Y");
2553 hClusterLocMax ->Draw(
"colz TEXT");
2558 hCluster1 ->SetAxisRange(minCol, maxCol,
"X");
2559 hCluster1 ->SetAxisRange(minRow, maxRow,
"Y");
2560 hCluster1 ->Draw(
"colz TEXT");
2565 hCluster2 ->SetAxisRange(minCol, maxCol,
"X");
2566 hCluster2 ->SetAxisRange(minRow, maxRow,
"Y");
2567 hCluster2 ->Draw(
"colz TEXT");
2569 if(eCluster > 6 )c->Print(Form(
"clusterFigures/Event%d_E%1.0f_nMax%d_NCell1_%d_NCell2_%d.eps",
2570 eventNumber,cluster->E(),nMax,ncells1,ncells2));
2574 delete hClusterLocMax;
Bool_t fRecalculatePosition
Recalculate cluster position.
virtual Double_t Eta() const
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
Bool_t IsL1PhaseInTimeRecalibrationOn() const
Bool_t IsMCParticleInCalorimeterAcceptance(Int_t calo, AliVParticle *particle)
Check that a MC AOD is in the calorimeter acceptance.
void InitPHOSRecalibrationFactors()
Init PHOS recalibration factors.
Bool_t IsRecalculationOfClusterTrackMatchingOn() const
TGeoHMatrix * fEMCALMatrix[22]
Geometry matrices with alignments.
Int_t GetPHOSChannelStatus(Int_t imod, Int_t iCol, Int_t iRow) const
Float_t fLocMaxCutEDiff
Local maxima cut, when aggregating cells, next can be a bit higher.
Bool_t IsAbsIDsFromTCard(Int_t absId1, Int_t absId2, Int_t &rowDiff, Int_t &colDiff) const
TGeoHMatrix * fPHOSMatrix[5]
Geometry matrices with alignments.
Bool_t ClusterContainsBadChannel(Int_t calo, UShort_t *cellList, Int_t nCells)
AliPHOSGeoUtils * fPHOSGeo
! PHOS geometry pointer.
AliEMCALRecoUtils * GetEMCALRecoUtils() const
Float_t GetECross(Int_t absId, AliVCaloCells *cells, Int_t bc)
void SetEMCALL1PhaseInTimeRecalibrationForAllSM(TObjArray *map)
void SwitchOnDistToBadChannelRecalculation()
AliPHOSGeoUtils * GetPHOSGeometry() const
Bool_t fOADBForEMCAL
Get calibration from OADB for EMCAL.
Float_t GetPHOSChannelRecalibrationFactor(Int_t imod, Int_t iCol, Int_t iRow) const
Float_t fLocMaxCutE
Local maxima cut must have more than this energy.
Float_t GetMCECellClusFracCorrection(Float_t eCell, Float_t eCluster) const
void SetEMCALChannelStatusMap(Int_t iSM, TH2I *h)
Int_t GetNumberOfCellsFromEMCALBorder() const
Bool_t fRunDependentCorrection
Switch on or off the recalibration dependent on T.
TObjArray * fPHOSRecalibrationFactors
Array of histograms with map of recalibration factors, PHOS.
TString fEMCALGeoName
Name of geometry to use for EMCAL.
TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const
Bool_t fRecalibration
Switch on or off the recalibration.
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
void SetNonLinearityFunction(Int_t fun)
TH1F * GetEMCALChannelTimeRecalibrationFactors(Int_t bc) const
const TString calorimeter
Int_t fDebug
Debugging level.
TH1C * GetEMCALL1PhaseInTimeRecalibrationForAllSM() const
virtual UInt_t GetDetectorTag() const
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2I * GetEMCALChannelStatusMap(Int_t iSM) const
Int_t GetModuleNumber(AliCaloTrackParticle *particle, AliVEvent *inputEvent) const
Get the EMCAL/PHOS module number that corresponds to this particle.
void SwitchOnBadChannelsRemoval()
Bool_t fLoadEMCALMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
Int_t GetMatchedTrackIndex(Int_t clsIndex)
AliEMCALGeometry * GetEMCALGeometry() const
void SwitchOnL1PhaseInTimeRecalibration()
Container for input particle information on CaloTrackCorr package.
Bool_t IsL1PhaseInTimeRecalibrationOn() const
Bool_t fRecalculateMatching
Recalculate cluster position.
Bool_t IsEMCALNoBorderAtEta0() const
Bool_t MaskFrameCluster(Int_t iSM, Int_t ieta) const
Bool_t fOADBForPHOS
Get calibration from OADB for PHOS.
Int_t * fMaskCellColumns
List of masked cells collumn index.
Bool_t fRemoveBadChannels
Check the channel status provided and remove clusters with bad channels.
void InitPHOSBadChannelStatusMap()
Init PHOS bad channels map.
virtual ~AliCalorimeterUtils()
void RecalculateClusterTrackMatching(AliVEvent *event, TObjArray *clusterArray=0x0, AliMCEvent *mc=0x0)
Bool_t IsTimeRecalibrationOn() const
AliCalorimeterUtils()
Constructor. Initialize parameters.
virtual void InitParameters()
Initialize the parameters of the analysis.
Int_t fNMaskCellColumns
Number of masked columns.
void SwitchOnRecalibration()
Bool_t IsClusterSharedByTwoSuperModules(const AliEMCALGeometry *geom, AliVCluster *cluster)
void GetMatchedResiduals(Int_t clsIndex, Float_t &dEta, Float_t &dPhi)
Int_t GetNumberOfLocalMaxima(AliVCluster *cluster, AliVCaloCells *cells)
Find the number of local maxima in cluster.
Float_t fMCECellClusFracCorrParam[4]
Parameters for the function correcting the weight of the cells in the cluster.
Bool_t fEMCALGeoMatrixSet
Check if the transformation matrix is set for EMCAL.
void SetPositionAlgorithm(Int_t alg)
void SwitchOffL1PhaseInTimeRecalibration()
TH2I * GetPHOSChannelStatusMap(Int_t imod) const
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
TString GetPass()
Get passx from filename.
void RecalculateClusterPosition(AliVCaloCells *cells, AliVCluster *clu)
void SwitchOnDistToBadChannelRecalculation()
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t fCorrectELinearity
Correct cluster energy linearity.
Bool_t fPHOSGeoMatrixSet
Check if the transformation matrix is set for PHOS.
TString fOADBFilePathPHOS
Default path $ALICE_PHYSICS/OADB/PHOS, if needed change.
void CorrectClusterEnergy(AliVCluster *cl)
Correct cluster energy non linearity.
Float_t fCutZ
dZ cut on matching (EMCAL/PHOS).
void RecalculateClusterPosition(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
Bool_t fLoadPHOSMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
void SwitchOnRunDepCorrection()
void SetPHOSChannelStatusMap(Int_t imod, TH2I *h)
Int_t fNCellsFromPHOSBorder
Number of cells from PHOS border the cell with maximum amplitude has to be.
AliVTrack * GetMatchedTrack(AliVCluster *cluster, AliVEvent *event, Int_t index=-1) const
void RecalibrateCellTimeL1Phase(Double_t &time, Int_t calo, Int_t iSM, Int_t bunchCrossNumber) const
Recalculate time L1 phase shift if time recalibration available for EMCAL.
Bool_t fMCECellClusFracCorrOn
Correct or not the weight of cells in cluster.
void SwitchOnRejectExoticCluster()
Int_t fNSuperModulesUsed
Number of supermodules to be used in analysis, can be different than the real geo, to be used at initialization of histograms.
TString fImportGeometryFilePath
Path fo geometry.root file.
Bool_t fPlotCluster
Plot cluster in splitting method.
Int_t fRunNumber
Run number of the data, take it from data itself unless set by user.
virtual Double_t Phi() const
void RecalibrateCellAmplitude(Float_t &, Int_t calo, Int_t absId) const
Recalculate cell energy if recalibration factor.
void SetExoticCellMinAmplitudeCut(Float_t ma)
void RecalibrateCellTimeL1Phase(Int_t iSM, Int_t bc, Double_t &time) const
void SetEMCALChannelTimeRecalibrationFactors(TObjArray *map)
Bool_t IsPHOSGeoMatrixSet() const
void FindMatches(AliVEvent *event, TObjArray *clusterArr=0x0, const AliEMCALGeometry *geom=0x0, AliMCEvent *mc=0x0)
Bool_t IsTimeRecalibrationOn() const
Bool_t fOADBSet
AODB parameters already set.
void SetExoticCellFractionCut(Float_t f)
TObjArray * fPHOSBadChannelMap
Array of histograms with map of bad channels, PHOS.
TString fPHOSGeoName
Name of geometry to use for PHOS.
Bool_t AreNeighbours(Int_t calo, Int_t absId1, Int_t absId2) const
void ConfigureEMCALRecoUtils(Bool_t bMC=kFALSE, Bool_t bExotic=kTRUE, Bool_t bNonLin=kFALSE, Bool_t bRecalE=kTRUE, Bool_t bBad=kTRUE, Bool_t bRecalT=kTRUE, Int_t debug=-1)
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow) const
Bool_t IsEMCALGeoMatrixSet() const
Class with utils specific to calorimeter clusters/cells.
Float_t CorrectClusterEnergyLinearity(AliVCluster *clu)
void AccessGeometry(AliVEvent *inputEvent)
AliEMCALRecoUtils * fEMCALRecoUtils
EMCAL utils for cluster rereconstruction.
Bool_t ClusterContainsBadChannel(const AliEMCALGeometry *geom, const UShort_t *cellList, Int_t nCells)
void SetEMCALChannelRecalibrationFactors(Int_t iSM, TH2F *h)
void AccessOADB(AliVEvent *event)
Float_t GetECross(Int_t absID, Double_t tcell, AliVCaloCells *cells, Int_t bc)
void SwitchOnTimeRecalibration()
TString fOADBFilePathEMCAL
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
void RecalibrateCellTime(Double_t &time, Int_t calo, Int_t absId, Int_t bunchCrossNumber) const
Recalculate time if time recalibration available for EMCAL not ready for PHOS.
Int_t GetMaxEnergyCell(AliVCaloCells *cells, AliVCluster *clu, Float_t &fraction) const
For a given CaloCluster, it gets the absId of the cell with maximum energy deposit.
Float_t fCutR
dR cut on matching (PHOS).
Float_t RecalibrateClusterEnergyWeightCell(AliVCluster *cluster, AliVCaloCells *cells, Float_t energyOrg)
virtual Int_t GetCaloLabel(Int_t i) const
void SplitEnergy(Int_t absId1, Int_t absId2, AliVCluster *cluster, AliVCaloCells *cells, AliAODCaloCluster *cluster1, AliAODCaloCluster *cluster2, Int_t nMax, Int_t eventNumber=0)
Bool_t GetFECCorrelatedCellAbsId(Int_t absId, Int_t absIdCorr[4]) const
Int_t GetModuleNumberCellIndexes(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU) const
Get the EMCAL/PHOS module, columns, row and RCU/DDL number that corresponds to this absId...
void RecalibrateCellTime(Int_t absId, Int_t bc, Double_t &time, Bool_t isLGon=kFALSE) const
TH2I * GetEMCALChannelStatusMap(Int_t iSM) const
void SetPHOSChannelRecalibrationFactor(Int_t imod, Int_t iCol, Int_t iRow, Double_t c=1)
Float_t RecalibrateClusterEnergy(AliVCluster *cluster, AliVCaloCells *cells)
Recalibrate the cluster energy, considering the recalibration map and the energy of the cells that co...
void SwitchOnRejectExoticCell()
void GetEMCALSubregion(AliVCluster *clus, AliVCaloCells *cells, Int_t ®Eta, Int_t ®Phi) const
Bool_t CheckCellFiducialRegion(AliVCluster *cluster, AliVCaloCells *cells) const
Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const