18 #include <TRefArray.h> 19 #include <TClonesArray.h> 21 #include <TGeoManager.h> 23 #include <TInterpreter.h> 27 #include "AliAnalysisTask.h" 28 #include "AliAnalysisManager.h" 29 #include "AliESDEvent.h" 30 #include "AliGeomManager.h" 31 #include "AliVCaloCells.h" 32 #include "AliAODCaloCluster.h" 33 #include "AliCDBManager.h" 34 #include "AliCDBStorage.h" 35 #include "AliCDBEntry.h" 37 #include "AliVEventHandler.h" 38 #include "AliAODInputHandler.h" 39 #include "AliOADBContainer.h" 40 #include "AliAODMCParticle.h" 41 #include "AliCentrality.h" 42 #include "AliMultSelection.h" 43 #include "AliDataFile.h" 46 #include "AliEMCALAfterBurnerUF.h" 47 #include "AliEMCALGeometry.h" 48 #include "AliEMCALClusterizerNxN.h" 49 #include "AliEMCALClusterizerv1.h" 50 #include "AliEMCALClusterizerv2.h" 51 #include "AliEMCALRecPoint.h" 52 #include "AliEMCALDigit.h" 66 , fGeom(0), fGeomName(
"")
67 , fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
68 , fOCDBpath(
""), fAccessOCDB(kFALSE)
69 , fDigitsArr(0), fClusterArr(0)
70 , fCaloClusterArr(0), fCaloCells(0)
71 , fRecParam(0), fClusterizer(0)
72 , fUnfolder(0), fJustUnfold(kFALSE)
73 , fOutputAODBranch(0), fOutputAODBranchName(
"")
74 , fOutputAODCells (0), fOutputAODCellsName (
""), fInputCaloCellsName (
"")
75 , fOutputAODBranchSet(0)
76 , fFillAODFile(kFALSE), fFillAODHeader(0)
77 , fFillAODCaloCells(0), fRun(-1)
78 , fRecoUtils(0), fConfigName(
"")
80 , fCellLabels(), fCellSecondLabels(), fCellTime()
81 , fCellMatchdEta(), fCellMatchdPhi()
82 , fRecalibrateWithClusterTime(0)
83 , fMaxEvent(0), fDoTrackMatching(kFALSE), fUpdateCell(0)
84 , fSelectCell(kFALSE), fSelectCellMinE(0), fSelectCellMinFrac(0)
85 , fRejectBelowThreshold(kFALSE)
86 , fRemoveLEDEvents(kTRUE),fRemoveExoticEvents(kFALSE)
87 , fImportGeometryFromFile(kTRUE), fImportGeometryFilePath(
"")
88 , fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(
"")
89 , fConstantTimeShift(0)
90 , fCentralityClass(
""), fUseAliCentrality(0), fSelectEMCALEvent(0)
91 , fEMCALEnergyCut(0.), fEMCALNcellsCut (0)
92 , fSetCellMCLabelFromCluster(0)
93 , fSetCellMCLabelFromEdepFrac(0)
94 , fRemapMCLabelForAODs(0)
96 , fTCardCorrEmulation(0), fTCardCorrClusEnerConserv(0)
97 , fRandom(0), fRandomizeTCard(1)
98 , fTCardCorrMinAmp(0.01), fTCardCorrMaxInduced(100)
102 for(
Int_t i = 0; i < 22; i++)
109 for(
Int_t j = 0; j < 4 ; j++)
164 for(
Int_t i = 0; i < 22; i++)
171 for(
Int_t j = 0; j < 4 ; j++)
224 if ( absID < 0 || absID >= 24*48*
fGeom->GetNumberOfSuperModules() )
227 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
228 if (!
fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
231 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
234 if (
fRecoUtils->IsBadChannelsRemovalSwitchedOn() &&
235 fRecoUtils->GetEMCALChannelStatus(imod, ieta, iphi) )
252 Int_t nCluster =
fEvent -> GetNumberOfCaloClusters();
255 for(
Int_t icalo = 0; icalo < nCluster; icalo++)
257 AliVCluster *clus = (AliVCluster*) (
fEvent->GetCaloCluster(icalo));
263 AliDebug(1, Form(
"Accept : E %2.2f > %2.2f, nCells %d > %d",
271 AliDebug(1,
"Reject");
287 AliInfo(Form(
"Get AODB parameters from EMCAL in %s for run %d, and <%s>",
fOADBFilePath.Data(),
fRun,pass.Data()));
292 if(
fRecoUtils->IsBadChannelsRemovalSwitchedOn())
294 AliOADBContainer *contBC=
new AliOADBContainer(
"");
296 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fOADBFilePath.Data()),
"AliEMCALBadChannels");
298 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"AliEMCALBadChannels");
304 fRecoUtils->SwitchOnDistToBadChannelRecalculation();
305 AliInfo(
"Remove EMCAL bad cells");
307 for (
Int_t i=0; i < nSM; ++i)
309 TH2I *hbm =
fRecoUtils->GetEMCALChannelStatusMap(i);
314 hbm=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
318 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
322 hbm->SetDirectory(0);
326 }
else AliInfo(
"Do NOT remove EMCAL bad channels");
334 AliOADBContainer *contRF=
new AliOADBContainer(
"");
337 contRF->InitFromFile(Form(
"%s/EMCALRecalib.root",
fOADBFilePath.Data()),
"AliEMCALRecalib");
339 contRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALRecalib.root").data(),
"AliEMCALRecalib");
353 AliInfo(
"Recalibrate EMCAL");
354 for (
Int_t i=0; i<nSM; ++i)
361 h = (
TH2F*)recalib->FindObject(Form(
"EMCALRecalFactors_SM%d",i));
365 AliError(Form(
"Could not load EMCALRecalFactors_SM%d",i));
371 fRecoUtils->SetEMCALChannelRecalibrationFactors(i,h);
373 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params object array");
374 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for pass");
375 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for run");
383 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
386 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
388 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
390 TH1S *htd=(TH1S*)contRFTD->GetObject(
fRun);
395 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",
fRun));
399 Int_t maxEntry = contRFTD->GetNumberOfEntries();
401 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) <
fRun) ) {
406 Int_t closest = lower;
407 if ( (ic<maxEntry) &&
408 (contRFTD->LowerLimit(ic)-
fRun) < (
fRun - contRFTD->UpperLimit(lower)) ) {
412 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
413 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
418 AliInfo(
"Recalibrate (Temperature) EMCAL");
420 for (
Int_t ism=0; ism<nSM; ++ism)
422 for (
Int_t icol=0; icol<48; ++icol)
424 for (
Int_t irow=0; irow<24; ++irow)
428 Int_t absID =
fGeom->GetAbsCellIdFromCellIndexes(ism, irow, icol);
429 factor *= htd->GetBinContent(absID) / 10000. ;
432 fRecoUtils->SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
436 }
else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
444 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
447 contTRF->InitFromFile(Form(
"%s/EMCALTimeCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeCalib");
449 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeCalib.root").data(),
"AliEMCALTimeCalib");
457 if ( pass==
"spc_calo" ) passM =
"pass3";
458 if (
fRun > 209121 ) passM =
"pass1";
459 if ( pass ==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
466 AliInfo(
"Time Recalibrate EMCAL");
467 for (
Int_t ibc = 0; ibc < 4; ++ibc)
469 TH1F *h =
fRecoUtils->GetEMCALChannelTimeRecalibrationFactors(ibc);
474 h = (TH1F*)trecalpass->FindObject(Form(
"hAllTimeAvBC%d",ibc));
478 AliError(Form(
"Could not load hAllTimeAvBC%d",ibc));
484 fRecoUtils->SetEMCALChannelTimeRecalibrationFactors(ibc,h);
486 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for pass");
487 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for run");
493 if(
fRecoUtils->IsL1PhaseInTimeRecalibrationOn() )
496 if (!
fRecoUtils->GetEMCALL1PhaseInTimeRecalibrationArray())
497 fRecoUtils->InitEMCALL1PhaseInTimeRecalibration() ;
499 AliOADBContainer *contBC =
new AliOADBContainer(
"");
503 timeFile =
new TFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"read");
505 timeFile =
new TFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"read");
507 if (!timeFile || timeFile->IsZombie())
509 AliFatal(Form(
"EMCALTimeL1PhaseCalib.root was not found in the path provided: %s",
fOADBFilePath.Data()));
513 if (timeFile)
delete timeFile;
516 contBC->InitFromFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeL1PhaseCalib");
518 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"AliEMCALTimeL1PhaseCalib");
523 AliError(Form(
"No external L1 phase in time calibration set for run number: %d",
fRun));
524 fRecoUtils->SwitchOffL1PhaseInTimeRecalibration();
531 if ( pass==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
537 AliError(Form(
"No external L1 phase in time calibration set for: %d -%s",
fRun,pass2.Data()));
538 fRecoUtils->SwitchOffL1PhaseInTimeRecalibration();
540 else AliInfo(
"Recalibrate L1 Phase time");
544 if ( DebugLevel()>0 ) arrayBCpass->Print();
546 TH1C *h =
fRecoUtils->GetEMCALL1PhaseInTimeRecalibrationForAllSM();
549 h = (TH1C*)arrayBCpass->FindObject(Form(
"h%d",
fRun));
553 AliFatal(Form(
"There is no calibration histogram h%d for this run",
fRun));
558 fRecoUtils->SetEMCALL1PhaseInTimeRecalibrationForAllSM(h);
580 AliCDBManager *cdb = AliCDBManager::Instance();
584 cdb->SetDefaultStorage(
fOCDBpath.Data());
585 AliInfo(Form(
"Default storage %s",
fOCDBpath.Data()));
594 cdb->SetSpecificStorage(
"EMCAL/Calib/Data",
"raw://");
595 cdb->SetSpecificStorage(
"EMCAL/Calib/Time",
"raw://");
596 cdb->SetSpecificStorage(
"EMCAL/Calib/Pedestals",
"raw://");
599 TString path = cdb->GetDefaultStorage()->GetBaseFolder();
636 new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j,
fTCardCorrCellsEner[j], fixTime,AliEMCALDigit::kHG,idigit, 0, 0, 0);
655 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
656 Int_t eventN = Entry();
657 if(aodIH) eventN = aodIH->GetReadEntry();
666 if (aodIH && aodIH->GetMergeEvents())
670 if(!aodIH->GetMergeEMCALCells())
671 AliFatal(
"Events merged but not EMCAL cells, check analysis settings!");
673 AliDebug(1,
"Use embedded events");
675 AliDebug(1,Form(
"\t InputEvent N Clusters %d, N Cells %d",
676 InputEvent()->GetNumberOfCaloClusters(),InputEvent()->GetEMCALCells()->GetNumberOfCells()));
678 AliDebug(1,Form(
"\t MergedEvent N Clusters %d, N Cells %d",
679 aodIH->GetEventToMerge()->GetNumberOfCaloClusters(), aodIH->GetEventToMerge()->GetEMCALCells()->GetNumberOfCells()));
690 AliDebug(1,Form(
"\t OutputEvent N Clusters %d, N Cells %d",
691 AODEvent()->GetNumberOfCaloClusters(), AODEvent()->GetEMCALCells()->GetNumberOfCells()));
707 AliError(
"Event not available");
742 AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
768 Int_t nClusters =
fEvent->GetNumberOfCaloClusters();
769 Int_t nClustersOrg = 0;
771 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
772 if(aodIH && aodIH->GetEventToMerge())
773 nClusters = aodIH->GetEventToMerge()->GetNumberOfCaloClusters();
781 for (
Int_t i = 0; i < nClusters; i++)
783 AliVCluster *clus = 0;
784 if(aodIH && aodIH->GetEventToMerge())
785 clus = aodIH->GetEventToMerge()->GetCaloCluster(i);
787 clus =
fEvent->GetCaloCluster(i);
793 if(!clus->IsEMCAL())
continue;
795 Int_t label = clus->GetLabel();
797 if (clus->GetNLabels() >=2 ) label2 = clus->GetLabelAt(1) ;
807 UShort_t * index = clus->GetCellsAbsId() ;
808 for(
Int_t icell=0; icell < clus->GetNCells(); icell++ )
811 fCellTime[index[icell]] = clus->GetTOF();
835 Int_t bc = InputEvent()->GetBunchCrossNumber();
845 if( amp < fRecParam->GetMinECut() ||
847 time <
fRecParam->GetTimeMin() ) accept = kFALSE;
864 AliDebug(2,Form(
"Remove channel absId %d, index %d of %d, amp %f, time %f",
865 id,icell,
fCaloCells->GetNumberOfCells(), amp, time*1.e9));
903 if (mcLabel > 0 && efrac < 1.e-6) efrac = 1;
918 AliVCluster *clus = 0;
923 AliInfo(
"Negative original cluster index, skip \n");
927 if(aodIH && aodIH->GetEventToMerge())
928 clus = aodIH->GetEventToMerge()->GetCaloCluster(iclus);
930 clus =
fEvent->GetCaloCluster(iclus);
932 fRecoUtils->RecalculateCellLabelsRemoveAddedGenerator(
id, clus, MCEvent(), amp, labeArr, eDepArr);
933 nLabels = labeArr.GetSize();
948 if(amp <= 0.01) continue ;
952 AliEMCALDigit* digit =
new((*fDigitsArr)[idigit]) AliEMCALDigit( mcLabel, mcLabel,
id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, eDep);
955 digit->SetListOfParents(nLabels,labeArr.GetArray(),eDepArr.GetArray());
981 AliWarning(Form(
"No array with CaloClusters, input RecPoints entries %d",
fClusterArr->GetEntriesFast()));
985 AliDebug(1,Form(
"N clusters: before recluster %d, after recluster %d, recpoints %d",
1005 Int_t cellMCLabel = 0;
1007 Int_t nClustersOrg = 0;
1010 for (
Int_t i = 0; i <
fEvent->GetNumberOfCaloClusters(); i++)
1012 AliVCluster *clus =
fEvent->GetCaloCluster(i);
1016 if(
fRecoUtils->ClusterContainsBadChannel(
fGeom,clus->GetCellsAbsId(), clus->GetNCells()))
1027 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1029 if (
fCaloCells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
1032 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1033 fGeom->GetCellIndex(cellNumber,imod,iTower,iIphi,iIeta);
1034 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1037 if(
fRecoUtils->IsBadChannelsRemovalSwitchedOn() &&
1038 fRecoUtils->GetEMCALChannelStatus(imod, ieta, iphi))
1041 fCaloCells->SetCell(icell, cellNumber, cellAmplitude*
fRecoUtils->GetEMCALChannelRecalibrationFactor(imod,ieta,iphi),cellTime);
1047 AliESDCaloCluster * esdCluster =
dynamic_cast<AliESDCaloCluster*
> (clus);
1048 AliAODCaloCluster * aodCluster =
dynamic_cast<AliAODCaloCluster*
> (clus);
1059 AliWarning(
"Wrong CaloCluster type?");
1090 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - **** Start ***\n");
1099 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Remove exotics in EMCAL\n");
1105 fRecoUtils->SetExoticCellMinAmplitudeCut(4.);
1110 if(bRecalE && ! bMC)
1112 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on energy recalibration in EMCAL\n");
1121 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on bad channels removal in EMCAL\n");
1123 fRecoUtils->SwitchOnDistToBadChannelRecalculation();
1128 if(bRecalT && ! bMC)
1130 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on time recalibration in EMCAL\n");
1132 fRecoUtils->SwitchOnL1PhaseInTimeRecalibration() ;
1137 fRecoUtils->SetPositionAlgorithm(AliEMCALRecoUtils::kPosTowerGlobal);
1145 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kBeamTestCorrected xxx\n");
1146 fRecoUtils->SetNonLinearityFunction(AliEMCALRecoUtils::kBeamTestCorrectedv3);
1150 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kPi0MCv3 xxx\n");
1151 fRecoUtils->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0MCv3);
1156 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx DON'T SET Non linearity correction xxx\n");
1157 fRecoUtils->SetNonLinearityFunction(AliEMCALRecoUtils::kNoCorrection);
1167 AliVCaloCells &eventEMcells = *(
fEvent->GetEMCALCells());
1168 Int_t nEMcell = eventEMcells.GetNumberOfCells() ;
1170 AliAODCaloCells &aodEMcells = *(AODEvent()->GetEMCALCells());
1171 aodEMcells.CreateContainer(nEMcell);
1172 aodEMcells.SetType(AliVCaloCells::kEMCALCell);
1174 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1176 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1177 fGeom->GetCellIndex(eventEMcells.GetCellNumber(iCell),imod,iTower,iIphi,iIeta);
1178 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1182 calibFactor =
fRecoUtils->GetEMCALChannelRecalibrationFactor(imod,ieta,iphi);
1185 if(!
fRecoUtils->GetEMCALChannelStatus(imod, ieta, iphi))
1187 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),eventEMcells.GetAmplitude(iCell)*calibFactor,
1188 eventEMcells.GetTime(iCell),eventEMcells.GetMCLabel(iCell),eventEMcells.GetEFraction(iCell));
1192 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),0,-1,-1,0);
1209 for (
Int_t i = 0; i < 6; i++) covVtx[i] = 0.;
1211 AliAODHeader* header =
dynamic_cast<AliAODHeader*
>(AODEvent()->GetHeader());
1212 if(!header) AliFatal(
"Not a standard AOD");
1213 header->SetRunNumber(
fRun);
1217 TTree* tree = fInputHandler->GetTree();
1220 TFile*
file = tree->GetCurrentFile();
1221 if (file) header->SetESDFileName(file->GetName());
1224 else if (aodevent) {
1225 AliAODHeader * aodheader =
dynamic_cast<AliAODHeader*
>(aodevent->GetHeader());
1226 if(!aodheader) AliFatal(
"Not a standard AOD");
1227 header->SetESDFileName(aodheader->GetESDFileName());
1230 header->SetBunchCrossNumber(
fEvent->GetBunchCrossNumber());
1231 header->SetOrbitNumber(
fEvent->GetOrbitNumber());
1232 header->SetPeriodNumber(
fEvent->GetPeriodNumber());
1233 header->SetEventType(
fEvent->GetEventType());
1238 if(
fEvent->GetCentrality())
1239 header->SetCentrality(
new AliCentrality(*(
fEvent->GetCentrality())));
1241 header->SetCentrality(0);
1245 header->SetOfflineTrigger(fInputHandler->IsEventSelected());
1247 header->SetFiredTriggerClasses(
fEvent->GetFiredTriggerClasses());
1249 header->SetTriggerMask(
fEvent->GetTriggerMask());
1250 header->SetTriggerCluster(
fEvent->GetTriggerCluster());
1254 header->SetL0TriggerInputs(esdevent->GetHeader()->GetL0TriggerInputs());
1255 header->SetL1TriggerInputs(esdevent->GetHeader()->GetL1TriggerInputs());
1256 header->SetL2TriggerInputs(esdevent->GetHeader()->GetL2TriggerInputs());
1260 header->SetL0TriggerInputs(aodevent->GetHeader()->GetL0TriggerInputs());
1261 header->SetL1TriggerInputs(aodevent->GetHeader()->GetL1TriggerInputs());
1262 header->SetL2TriggerInputs(aodevent->GetHeader()->GetL2TriggerInputs());
1265 header->SetMagneticField(
fEvent->GetMagneticField());
1268 header->SetZDCN1Energy(
fEvent->GetZDCN1Energy());
1269 header->SetZDCP1Energy(
fEvent->GetZDCP1Energy());
1270 header->SetZDCN2Energy(
fEvent->GetZDCN2Energy());
1271 header->SetZDCP2Energy(
fEvent->GetZDCP2Energy());
1272 header->SetZDCEMEnergy(
fEvent->GetZDCEMEnergy(0),
fEvent->GetZDCEMEnergy(1));
1276 fEvent->GetDiamondCovXY(diamcov);
1277 header->SetDiamond(diamxy,diamcov);
1278 if (esdevent) header->SetDiamondZ(esdevent->GetDiamondZ(),esdevent->GetSigma2DiamondZ());
1279 else if (aodevent) header->SetDiamondZ(aodevent->GetDiamondZ(),aodevent->GetSigma2DiamondZ());
1282 Int_t nVertices = 1 ;;
1283 Int_t nCaloClus =
fEvent->GetNumberOfCaloClusters();
1285 AODEvent()->ResetStd(0, nVertices, 0, 0, 0, nCaloClus, 0, 0);
1288 TClonesArray &vertices = *(AODEvent()->GetVertices());
1293 fEvent->GetPrimaryVertex()->GetXYZ(pos);
1297 esdevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1298 chi = esdevent->GetPrimaryVertex()->GetChi2toNDF();
1302 aodevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1303 chi = aodevent->GetPrimaryVertex()->GetChi2perNDF();
1306 AliAODVertex * primary =
new(vertices[jVertices++])
1308 primary->SetName(
fEvent->GetPrimaryVertex()->GetName());
1309 primary->SetTitle(
fEvent->GetPrimaryVertex()->GetTitle());
1329 for(
Int_t i = 0; i < kNumberOfCaloClusters; i++)
1331 AliAODCaloCluster *newCluster = (AliAODCaloCluster *)
fCaloClusterArr->At(i);
1333 newCluster->SetID(i);
1336 newCluster->SetE(
fRecoUtils->CorrectClusterEnergyLinearity(newCluster));
1344 newCluster->AddTrackMatched(
fEvent->GetTrack(trackIndex));
1345 AliDebug(2,Form(
"Matched Track index %d to new cluster %d",trackIndex,i));
1349 fRecoUtils->GetMatchedResiduals(newCluster->GetID(),dZ,dR);
1350 newCluster->SetTrackDistance(dR,dZ);
1354 Int_t absId0 = newCluster->GetCellsAbsId()[0];
1373 new((*fOutputAODBranch)[i]) AliAODCaloCluster(*newCluster);
1375 AliDebug(2,Form(
"New cluster %d of %d, energy %f, mc label %d",
1376 newCluster->GetID(), kNumberOfCaloClusters, newCluster->E(), newCluster->GetLabel()));
1408 if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1410 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Pointer to tree = 0, returning null");
1414 if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1416 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Null pointer input file, returning null");
1420 TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1421 if (pass.Contains(
"ass1"))
return TString(
"pass1");
1422 else if (pass.Contains(
"ass2"))
return TString(
"pass2");
1423 else if (pass.Contains(
"ass3"))
return TString(
"pass3");
1424 else if (pass.Contains(
"ass4"))
return TString(
"pass4");
1425 else if (pass.Contains(
"ass5"))
return TString(
"pass5");
1426 else if (pass.Contains(
"LHC11c") && pass.Contains(
"spc_calo") )
return TString(
"spc_calo");
1427 else if (pass.Contains(
"calo") || pass.Contains(
"high_lumi"))
1429 AliInfo(
"Path contains <calo> or <high-lumi>, set as <pass1>");
1432 else if (pass.Contains(
"LHC14a1a"))
1434 AliInfo(
"Enable EMCal energy calibration for this MC production!!");
1442 AliInfo(
"Pass number string not found");
1453 if(fDebug >=0) (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
1457 fBranchNames =
"ESD:AliESDHeader.,EMCALCells.";
1475 AliInfo(Form(
"Configure analysis with %s",
fConfigName.Data()));
1514 if (
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv1)
1516 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv2)
1518 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerNxN)
1526 AliFatal(Form(
"Clusterizer < %d > not available",
fRecParam->GetClusterizerFlag()));
1551 for (i = 0; i < 8; i++)
1556 for (i = 0; i < 3; i++)
1581 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
1582 AliInfo(Form(
"Get EMCAL geometry name <%s> for run %d",
fGeom->GetName(),
fRun));
1587 AliInfo(Form(
"Set EMCAL geometry name to <%s>",
fGeomName.Data()));
1607 AliDebug(1,Form(
"Init for run=%d",
fRun));
1608 if (!gGeoManager) AliDebug(1,
"Careful!, gGeoManager not loaded, load misalign matrices");
1613 AliInfo(
"Load user defined EMCAL geometry matrices");
1616 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
1618 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
1620 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
1624 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1629 AliDebug(2,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
1632 fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
1637 if(DebugLevel() > 1)
1642 else if(gGeoManager)
1644 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
1645 fGeom->SetMisalMatrix(
fGeom->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
1649 AliError(Form(
"Alignment atrix for SM %d is not available",mod));
1656 else if(!gGeoManager)
1658 AliInfo(
"Get geo matrices from data");
1660 if(!strcmp(
fEvent->GetName(),
"AliAODEvent"))
1662 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
1666 AliDebug(1,
"Load Misaligned matrices");
1672 AliError(
"This event does not contain ESDs?");
1673 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
1677 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1679 if(DebugLevel() > 1)
1680 esd->GetEMCALMatrix(mod)->Print();
1682 if(esd->GetEMCALMatrix(mod))
fGeom->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
1705 Int_t bc = InputEvent()->GetBunchCrossNumber();
1726 if(totCellE < 1)
return kTRUE;
1739 if(run < 146858 || run > 146860)
return kFALSE ;
1742 Int_t ncellsSM3 = 0;
1745 if (
fCaloCells->GetAmplitude (icell) > 0.1 &&
1746 fCaloCells->GetCellNumber(icell)/(24*48)==3 ) ncellsSM3++;
1751 Int_t ncellcut = 21;
1752 if(triggerclasses.Contains(
"EMC")) ncellcut = 35;
1754 if( ncellsSM3 >= ncellcut)
1756 AliInfo(Form(
"Reject event %d with ncells in SM3 %d",(
Int_t)Entry(),ncellsSM3));
1757 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
1775 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1784 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1785 fGeom->GetCellIndex(
id,imod,iTower,iIphi,iIeta);
1786 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1795 AliDebug(1,Form(
"Reference cell absId %d, iEta %d, iPhi %d, amp %2.3f",
id,ieta,iphi,amp));
1802 Int_t absIDuplr = -1;
1803 Int_t absIDdolr = -1;
1805 Int_t absIDup2 = -1;
1806 Int_t absIDup2lr = -1;
1807 Int_t absIDdo2 = -1;
1808 Int_t absIDdo2lr = -1;
1812 if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
1813 if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
1815 absIDlr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
1818 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
1820 absIDup =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1821 absIDuplr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
1826 absIDdo =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1827 absIDdolr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
1831 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
1833 absIDup2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
1834 absIDup2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
1839 absIDdo2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
1840 absIDdo2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
1844 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
1845 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
1846 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
1847 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
1861 AliDebug(1,Form(
"Same T-Card cells:\n \t up %d (%d), down %d (%d), left-right %d (%d), up-lr %d (%d), down-lr %d (%d)\n" 1862 "\t up2 %d (%d), down2 %d (%d), up2-lr %d (%d), down2-lr %d (%d)",
1863 absIDup ,okup ,absIDdo ,okdo ,absIDlr,oklr,absIDuplr ,okuplr ,absIDdolr ,okdolr ,
1864 absIDup2,okup2,absIDdo2,okdo2, absIDup2lr,okup2lr,absIDdo2lr,okdo2lr));
1874 AliDebug(1,Form(
"Fraction for SM %d (min %2.3f, max %2.3f):\n" 1875 "\t up-down : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1876 "\t up-down-lr: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1877 "\t left-right: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1878 "\t 2nd row : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f",
1902 AliDebug(1,Form(
"Randomized fraction: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1903 fracupdown,fracupdownleri,fracleri,frac2nd));
1912 AliDebug(1,Form(
"Induced energy: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1913 indEupdown,indEupdownleri,indEleri,indE2nd));
1921 AliDebug(1,Form(
"Induced energy, saturated?: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1922 indEupdown,indEupdownleri,indEleri,indE2nd));
2013 AliInfo(Form(
"Geometry: name <%s>, matrix set <%d>, load matrix <%d>, import geo <%d> from path <%s>",
2022 AliInfo(Form(
"Just Unfold clusters <%d>, new clusters list name <%s>, new cells name <%s>",
2027 AliInfo(Form(
"Use cell time for cluster <%d>, Apply constant time shift <%2.2f>, Do track-matching <%d>, Update cells <%d>, Input from ESD filter <%d>",
2033 AliInfo(Form(
"Centrality bin [%2.2f,%2.2f], class <%s>, use AliCentrality? <%d>",
2039 AliInfo(Form(
"MC label from cluster <%d>, Use EdepFrac <%d>, remap AODs <%d>",
2050 AliInfo(
"T-Card emulation not activated");
2054 AliInfo(Form(
"T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:",
2057 AliInfo(Form(
"T-Card emulation super-modules fraction: Min cell E %2.2f Max induced E %2.2f",
2060 for(
Int_t ism = 0; ism < 22; ism++)
2062 printf(
"\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
2065 for(
Int_t icell = 0; icell < 4; icell++)
2067 printf(
"\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
2084 AliEMCALRecPoint *recPoint = (AliEMCALRecPoint*)
fClusterArr->At(i);
2086 const Int_t ncells = recPoint->GetMultiplicity();
2087 Int_t ncellsTrue = 0;
2089 if(recPoint->GetEnergy() <
fRecParam->GetClusteringThreshold())
continue;
2093 Double32_t ratios[ncells];
2096 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2101 AliEMCALDigit *digit = (AliEMCALDigit*)
fDigitsArr->At(recPoint->GetDigitsList()[
c]);
2103 absIds[ncellsTrue] = digit->GetId();
2104 ratios[ncellsTrue] = recPoint->GetEnergiesList()[
c]/digit->GetAmplitude();
2106 if ( !
fRecParam->GetUnfold() && (ratios[ncellsTrue] > 1 || ratios[ncellsTrue] < 1) )
2107 AliWarning(Form(
"recpoint cell E %2.3f but digit E %2.3f and no unfolding", recPoint->GetEnergiesList()[
c], digit->GetAmplitude()));
2115 AliDebug(2,Form(
"Too small energy in cell of cluster: cluster cell %f, digit %f",
2116 recPoint->GetEnergiesList()[
c],digit->GetAmplitude()));
2122 clusterE +=recPoint->GetEnergiesList()[
c];
2125 if (aodIH && aodIH->GetMergeEvents())
2128 AliVCaloCells* meEMCALCells = aodIH->GetEventToMerge()->GetEMCALCells();
2129 AliVCaloCells* ouEMCALCells = AODEvent()->GetEMCALCells();
2131 Float_t sigAmplitude = meEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2133 Float_t sumAmplitude = ouEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2136 if(sumAmplitude > 0) ratios[ncellsTrue] = sigAmplitude/sumAmplitude;
2147 AliDebug(2,Form(
"Skipping cluster with no cells avobe threshold E = %f, ncells %d",
2148 recPoint->GetEnergy(), ncells));
2154 if(clusterE < fRecParam->GetClusteringThreshold())
2156 AliDebug(2,Form(
"Remove cluster with energy below seed threshold %f",clusterE));
2166 recPoint->GetGlobalPosition(gpos);
2171 (*fCaloClusterArr)[j] =
new AliAODCaloCluster() ;
2172 AliAODCaloCluster *clus =
dynamic_cast<AliAODCaloCluster *
>(
fCaloClusterArr->At(j) ) ;
2174 clus->SetType(AliVCluster::kEMCALClusterv1);
2175 clus->SetE(clusterE);
2176 clus->SetPosition(g);
2177 clus->SetNCells(ncellsTrue);
2178 clus->SetCellsAbsId(absIds);
2179 clus->SetCellsAmplitudeFraction(ratios);
2181 clus->SetTOF(recPoint->GetTime()) ;
2182 clus->SetNExMax(recPoint->GetNExMax());
2183 clus->SetDistanceToBadChannel(recPoint->GetDistanceToBadTower());
2185 if(ncells == ncellsTrue)
2188 recPoint->GetElipsAxis(elipAxis);
2189 clus->SetM02(elipAxis[0]*elipAxis[0]) ;
2190 clus->SetM20(elipAxis[1]*elipAxis[1]) ;
2191 clus->SetDispersion(recPoint->GetDispersion());
2197 AliDebug(2,Form(
"Cells removed from cluster (ncells %d, ncellsTrue %d), recalculate Shower Shape",ncells,ncellsTrue));
2199 AliVCaloCells* cells = 0x0;
2200 if (aodIH && aodIH->GetMergeEvents()) cells = AODEvent() ->GetEMCALCells();
2201 else cells = InputEvent()->GetEMCALCells();
2203 fRecoUtils->RecalculateClusterShowerShapeParameters(
fGeom,cells,clus);
2217 Int_t parentMult = 0;
2218 Int_t *parentList = recPoint->GetParents(parentMult);
2219 Float_t *parentListDE = recPoint->GetParentsDE();
2221 clus->SetLabel(parentList, parentMult);
2223 clus->SetClusterMCEdepFractionFromEdepArray(parentListDE);
2237 for(
Int_t icell = 0; icell < ncellsTrue ; icell++)
2241 const AliEMCALDigit * dig = (
const AliEMCALDigit*)
fDigitsArr->At(idigit);
2246 mcEdepFracPerCell[icell] = 0;
2248 Int_t nparents = dig->GetNiparent();
2251 Int_t digLabel =-1 ;
2254 Float_t mcEDepFrac[4] = {0,0,0,0};
2257 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2259 digLabel = dig->GetIparent (jndex+1);
2260 edep = dig->GetDEParent(jndex+1);
2263 if ( digLabel == parentList[0] ) mcEDepFrac[0] = edep;
2264 else if ( digLabel == parentList[1] ) mcEDepFrac[1] = edep;
2265 else if ( digLabel == parentList[2] ) mcEDepFrac[2] = edep;
2266 else if ( digLabel == parentList[3] ) mcEDepFrac[3] = edep;
2273 mcEdepFracPerCell[icell] = clus->PackMCEdepFraction(mcEDepFrac);
2278 clus->SetCellsMCEdepFractionMap(mcEdepFracPerCell);
2280 delete [] mcEdepFracPerCell;
2293 if(label < 0) return ;
2298 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(evt->FindListObject(
"mcparticles")) ;
2301 if(label < arr->GetEntriesFast())
2303 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(label));
2304 if(!particle) return ;
2306 if(label == particle->Label())
return ;
2312 for(
Int_t ind = 0; ind < arr->GetEntriesFast(); ind++ )
2314 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(ind));
2315 if(!particle) continue ;
2317 if(label == particle->Label())
2355 AliAODCaloCluster * clus)
2357 Int_t parentMult = 0;
2358 Int_t *parentList = recPoint->GetParents(parentMult);
2359 clus->SetLabel(parentList, parentMult);
2363 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2366 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2370 for (
UInt_t iLoopLabels = 0 ; iLoopLabels < clus->GetNLabels() ; iLoopLabels++ )
2373 if (
fCellSecondLabels[idCell] == clus->GetLabelAt(iLoopLabels) ) iNewLabel = 0;
2377 Int_t * newLabelArray =
new Int_t[clus->GetNLabels()+1] ;
2378 for (
UInt_t iLoopNewLabels = 0 ; iLoopNewLabels < clus->GetNLabels() ; iLoopNewLabels++ )
2380 newLabelArray[iLoopNewLabels] = clus->GetLabelAt(iLoopNewLabels) ;
2384 clus->SetLabel(newLabelArray,clus->GetNLabels()+1) ;
2385 delete [] newLabelArray;
2401 Int_t nLabTotOrg = 0;
2405 AliVEvent *
event =
fEvent;
2408 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2409 if(aodIH && aodIH->GetEventToMerge())
2410 event = aodIH->GetEventToMerge();
2414 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2416 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2423 for(
Int_t icl =0; icl < nClu; icl++)
2425 if(((
Int_t)clArray.GetAt(icl))==-1 )
continue;
2426 if( idCluster == ((
Int_t)clArray.GetAt(icl)) )
set = kFALSE;
2430 if(
set && idCluster >= 0)
2432 clArray.SetAt(idCluster,nClu++);
2434 nLabTotOrg+=(
event->GetCaloCluster(idCluster))->GetNLabels();
2439 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2441 if(emax < clOrg->E())
2450 if(nClu==0 || nLabTotOrg == 0)
2458 if(idMax != ((
Int_t)clArray.GetAt(0)))
2460 Int_t maxIndex = -1;
2461 Int_t firstCluster = ((
Int_t)clArray.GetAt(0));
2462 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2464 if(idMax == ((
Int_t)clArray.GetAt(iLoopCluster))) maxIndex = iLoopCluster;
2467 if(firstCluster >=0 && idMax >=0)
2469 clArray.SetAt(idMax,0);
2470 clArray.SetAt(firstCluster,maxIndex);
2475 TArrayI clMCArray(nLabTotOrg) ;
2479 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2481 Int_t idCluster = (
Int_t) clArray.GetAt(iLoopCluster);
2483 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2484 Int_t nLab = clOrg->GetNLabels();
2486 for (
Int_t iLab = 0 ; iLab < nLab ; iLab++ )
2488 Int_t lab = clOrg->GetLabelAt(iLab) ;
2493 for(
Int_t iLabTot =0; iLabTot < nLabTot; iLabTot++)
2495 if( lab == ((
Int_t)clMCArray.GetAt(iLabTot)) )
set = kFALSE;
2499 if(
set ) clMCArray.SetAt(lab,nLabTot++);
2506 clus->SetLabel(clMCArray.GetArray(), nLabTot);
2531 AliInfo(
"Cluster branch name not set, set it to newEMCALClustersArray");
2562 if(!
fRecoUtils->IsBadChannelsRemovalSwitchedOn() &&
2566 !
fRecoUtils->IsL1PhaseInTimeRecalibrationOn() &&
2577 else if ( ncells != ndigis )
2583 for (
Int_t idigit = 0; idigit < ndigis; ++idigit)
2585 AliEMCALDigit *digit =
static_cast<AliEMCALDigit*
>(
fDigitsArr->At(idigit));
2587 Double_t cellAmplitude = digit->GetAmplitude();
2588 Short_t cellNumber = digit->GetId();
2589 Double_t cellTime = digit->GetTime();
2591 Bool_t highGain = kFALSE;
2592 if( digit->GetType() == AliEMCALDigit::kHG ) highGain = kTRUE;
2597 Int_t nparents = digit->GetNiparent();
2598 Int_t cellMcEDepFrac =-1 ;
2602 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2604 if(cellMcEDepFrac >= digit->GetDEParent(jndex+1))
continue ;
2606 cellMcLabel = digit->GetIparent (jndex+1);
2607 cellMcEDepFrac= digit->GetDEParent(jndex+1);
2611 if ( cellMcEDepFrac < 0 ) cellMcEDepFrac = 0.;
2614 fCaloCells ->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2616 fOutputAODCells->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2658 fRun = InputEvent()->GetRunNumber();
2662 AliInfo(Form(
"Set run to %d",
fRun));
2672 AliDebug(1,Form(
"Skip Event %d", (
Int_t) Entry()));
TString fOutputAODCellsName
New of output cells AOD branch name.
void FillAODCaloCells()
Put calo cells in standard branch.
Float_t fTCardCorrMinAmp
Minimum cell energy to induce signal on adjacent cells.
AliVCaloCells * fCaloCells
! CaloCells container
Bool_t fTCardCorrEmulation
Activate T-Card cells energy correlation.
Float_t fTCardCorrInduceEnerFracP1[4][22]
Induced energy loss gauss fraction param1 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
virtual void ResetArrays()
Reset arrays containing information for all possible cells.
TString GetPass()
Get or guess pass number/string from path of filename.
Bool_t fSetCellMCLabelFromEdepFrac
Bool_t fFillAODHeader
Copy header to standard branch.
TClonesArray * fDigitsArr
! Digits array
Bool_t fTCardCorrClusEnerConserv
When making correlation, subtract from the reference cell the induced energy on the neighbour cells...
AliEMCALClusterizer * fClusterizer
! EMCAL clusterizer
AliAnalysisTaskEMCALClusterize()
Constructor.
Bool_t fJustUnfold
Just unfold, do not recluster.
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t fSelectCell
Reject cells from cluster if energy is too low and recalculate position/energy and other...
TString fConfigName
Name of analysis configuration file.
Float_t fTCardCorrInduceEnerFracMax[22]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the maximum fraction of induced energy per S...
void PrintTCardParam()
Print parameters for T-Card correlation emulation.
Int_t fCellSecondLabels[fgkNEMCalCells]
Array with Second MC label to be passed to digit.
TRandom3 fRandom
Random generator.
void MakeCellTCardCorrelation()
void SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint *recPoint, AliAODCaloCluster *clus)
Int_t fSetCellMCLabelFromCluster
Float_t fCellMatchdEta[fgkNEMCalCells]
Array with cluster-track dPhi.
TClonesArray * fOutputAODBranch
! AOD Branch with output clusters
TString fOADBFilePath
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
Float_t fTCardCorrCellsEner[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells.
virtual ~AliAnalysisTaskEMCALClusterize()
Destructor.
TString fImportGeometryFilePath
path fo geometry.root file
Float_t fTCardCorrInduceEnerFrac[4][22]
Induced energy loss gauss fraction param0 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
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)
Bool_t fPrintOnce
Print once analysis parameters.
Bool_t fSelectEMCALEvent
Process the event if there is some high energy cluster.
Bool_t AcceptEventEMCAL()
Float_t fTCardCorrMaxInduced
Maximum induced energy signal on adjacent cells.
Float_t GetEventCentrality() const
Get centrality/multiplicity percentile.
Bool_t fInputFromFilter
Get the input from AODs from the filter.
TString fOutputAODBranchName
New of output clusters AOD branch.
AliEMCALGeometry * fGeom
EMCAL geometry.
void ClusterUnfolding()
Take the event clusters and unfold them.
Bool_t fAccessOADB
Get calibration from OADB for EMCAL.
Bool_t fRemoveLEDEvents
Remove LED events, use only for LHC11a.
AliEMCALRecoUtils * fRecoUtils
Access to factorized reconstruction algorithms.
Bool_t fRejectBelowThreshold
split (false-default) or reject (true) cell energy below threshold after UF
Float_t fConstantTimeShift
Apply a 600 ns time shift in case of simulation, shift in ns.
void SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster *clus)
Bool_t fUpdateCell
On/Off the upate of the CaloCells container.
Float_t fSelectCellMinE
Min energy cell threshold, after unfolding.
Bool_t fOADBSet
AODB parameters already set.
AliAODCaloCells * fOutputAODCells
! AOD Branch with output cells
virtual void UserCreateOutputObjects()
Float_t fTCardCorrInduceEner[4][22]
Induced energy loss gauss constant on 0-same row, diff col, 1-up/down cells left/right col 2-left/rig...
virtual void FillCaloClusterInEvent()
Int_t fCellLabels[fgkNEMCalCells]
Array with MC label to be passed to digit.
Bool_t fRemoveExoticEvents
Remove exotic events.
void AddNewTCardInducedCellsToDigit()
Bool_t fDoTrackMatching
On/Off the matching recalculation to speed up analysis in PbPb.
virtual void UserExec(Option_t *option)
Float_t fCellMatchdPhi[fgkNEMCalCells]
Array with cluster-track dEta.
Float_t fTCardCorrInduceEnerProb[22]
Probability to induce energy loss per SM.
AliMultSelection * GetMultSelCen() const
TString fInputCaloCellsName
Input cells branch name, if different from default branch.
TGeoHMatrix * fGeomMatrix[22]
Geometry matrices with alignments.
Bool_t IsLEDEvent(const Int_t run)
Check if event is LED, is so remove it. Affected LHC11a runs.
AliEMCALRecParam * fRecParam
Reconstruction parameters container.
TString fGeomName
Name of geometry to use.
Bool_t fOutputAODBranchSet
Set the AOD clusters branch in the input event once.
void PrintParam()
Print clusterization task parameters.
void RemapMCLabelForAODs(Int_t &label)
TString fOCDBpath
Path with OCDB location.
AliEMCALAfterBurnerUF * fUnfolder
! Unfolding procedure
Bool_t fGeomMatrixSet
Set geometry matrices only once, for the first event.
Float_t fCentralityBin[2]
Minimum and maximum value of the centrality for the analysis.
Int_t fMaxEvent
Set a maximum event.
Bool_t fFillAODCaloCells
Copy calocells to standard branch.
TObjArray * fCaloClusterArr
! CaloClusters array
Double_t fCellTime[fgkNEMCalCells]
Array with cluster time to be passed to digit in case of AODs.
AliCentrality * GetCentrality() const
TString fCentralityClass
Name of selected centrality class.
TFile * file
TList with histograms for a given trigger.
Bool_t fAccessOCDB
Need to access info from OCDB (not really)
TObjArray * fClusterArr
! Recpoints array
Bool_t fRecalibrateWithClusterTime
Use fCellTime to store time of cells in cluster.
Int_t GetRunNumber(TString)
void InitClusterization()
void FillAODHeader()
Put event header information in standard AOD branch.
static const Int_t fgkNEMCalCells
Total number of cells in the calorimeter, 10*48*24 (EMCal) + 4*48*8 (EMCal/DCal 1/3) + 6*32*24 (DCal)...
Float_t fTCardCorrInduceEnerFracMin[22]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the minimum fraction of induced energy per S...
virtual void RecPoints2Clusters()
Int_t fEMCALNcellsCut
At least an EMCAL cluster with fNCellsCut cells over fEnergyCut.
Reclusterize EMCal clusters, put them in a new branch for other following analysis.
Bool_t fTCardCorrCellsNew[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells, that before had no signal.
Bool_t fLoadGeomMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
Float_t fEMCALEnergyCut
At least an EMCAL cluster with this energy in the event.
Bool_t fRandomizeTCard
Use random induced energy.
Bool_t fUseAliCentrality
Use the centrality estimator from AliCentrality or AliMultSelection.
Float_t fTCardCorrInduceEnerFracWidth[4][22]
Induced energy loss gauss witdth on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ ...
Int_t fOrgClusterCellId[fgkNEMCalCells]
Array ID of cluster to wich the cell belongs in unmodified clusters.
Float_t fSelectCellMinFrac
Min fraction of cell energy after unfolding cut.
Bool_t fRemapMCLabelForAODs
Remap AOD cells MC label. Needed in old AOD productions.
Bool_t AcceptCell(Int_t absID)