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 "AliEMCALClusterizerv3.h" 52 #include "AliEMCALRecPoint.h" 53 #include "AliEMCALDigit.h" 67 , fGeom(0), fGeomName(
"")
68 , fGeomMatrixSet(kFALSE), fLoadGeomMatrices(kFALSE)
69 , fOCDBpath(
""), fAccessOCDB(kFALSE)
70 , fDigitsArr(0), fClusterArr(0)
71 , fCaloClusterArr(0), fCaloCells(0)
72 , fRecParam(0), fClusterizer(0)
73 , fUnfolder(0), fJustUnfold(kFALSE)
74 , fOutputAODBranch(0), fOutputAODBranchName(
"")
75 , fOutputAODCells (0), fOutputAODCellsName (
""), fInputCaloCellsName (
"")
76 , fOutputAODBranchSet(0)
77 , fFillAODFile(kFALSE), fFillAODHeader(0)
78 , fFillAODCaloCells(0), fRun(-1)
79 , fRecoUtils(0), fConfigName(
"")
81 , fCellLabels(), fCellSecondLabels(), fCellTime()
82 , fCellMatchdEta(), fCellMatchdPhi()
83 , fRecalibrateWithClusterTime(0)
84 , fMaxEvent(0), fMinEvent(0)
85 , fDoTrackMatching(0), fUpdateCell(0)
86 , fSelectCell(kFALSE), fSelectCellMinE(0), fSelectCellMinFrac(0)
87 , fRejectBelowThreshold(kFALSE)
88 , fRemoveLEDEvents(kTRUE),fRemoveExoticEvents(kFALSE)
89 , fImportGeometryFromFile(kTRUE), fImportGeometryFilePath(
"")
90 , fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(
"")
91 , fConstantTimeShift(0)
92 , fCentralityClass(
""), fUseAliCentrality(0), fSelectEMCALEvent(0)
93 , fEMCALEnergyCut(0.), fEMCALNcellsCut (0)
94 , fSetCellMCLabelFromCluster(0)
95 , fSetCellMCLabelFromEdepFrac(0)
96 , fRemapMCLabelForAODs(0)
98 , fTCardCorrEmulation(0), fTCardCorrClusEnerConserv(0)
99 , fRandom(0), fRandomizeTCard(1)
100 , fTCardCorrMinAmp(0.01), fTCardCorrMinInduced(0)
101 , fTCardCorrMaxInducedLowE(0), fTCardCorrMaxInduced(100)
105 for(
Int_t i = 0; i < 22; i++)
112 for(
Int_t j = 0; j < 4 ; j++)
169 for(
Int_t i = 0; i < 22; i++)
176 for(
Int_t j = 0; j < 4 ; j++)
230 if ( absID < 0 || absID >= 24*48*
fGeom->GetNumberOfSuperModules() )
233 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status = 0;
234 if (!
fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
240 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
261 Int_t nCluster =
fEvent -> GetNumberOfCaloClusters();
264 for(
Int_t icalo = 0; icalo < nCluster; icalo++)
266 AliVCluster *clus = (AliVCluster*) (
fEvent->GetCaloCluster(icalo));
272 AliDebug(1, Form(
"Accept : E %2.2f > %2.2f, nCells %d > %d",
280 AliDebug(1,
"Reject");
296 AliInfo(Form(
"Get AODB parameters from EMCAL in %s for run %d, and <%s>",
fOADBFilePath.Data(),
fRun,pass.Data()));
303 AliOADBContainer *contBC=
new AliOADBContainer(
"");
305 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fOADBFilePath.Data()),
"AliEMCALBadChannels");
307 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"AliEMCALBadChannels");
314 AliInfo(
"Remove EMCAL bad cells");
316 for (
Int_t i=0; i < nSM; ++i)
323 hbm=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
327 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
331 hbm->SetDirectory(0);
335 }
else AliInfo(
"Do NOT remove EMCAL bad channels");
343 AliOADBContainer *contRF=
new AliOADBContainer(
"");
346 contRF->InitFromFile(Form(
"%s/EMCALRecalib.root",
fOADBFilePath.Data()),
"AliEMCALRecalib");
348 contRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALRecalib.root").data(),
"AliEMCALRecalib");
362 AliInfo(
"Recalibrate EMCAL");
363 for (
Int_t i=0; i<nSM; ++i)
370 h = (
TH2F*)recalib->FindObject(Form(
"EMCALRecalFactors_SM%d",i));
374 AliError(Form(
"Could not load EMCALRecalFactors_SM%d",i));
382 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params object array");
383 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for pass");
384 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for run");
392 AliInfo(Form(
"Switch off Temperature corrections for Run %d (remember to remove when Run2 T corrections available!)",
fRun));
398 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
401 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
403 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
405 TH1S *htd=(TH1S*)contRFTD->GetObject(
fRun);
410 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",
fRun));
414 Int_t maxEntry = contRFTD->GetNumberOfEntries();
416 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) <
fRun) ) {
421 Int_t closest = lower;
422 if ( (ic<maxEntry) &&
423 (contRFTD->LowerLimit(ic)-
fRun) < (
fRun - contRFTD->UpperLimit(lower)) ) {
427 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
428 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
433 AliInfo(
"Recalibrate (Temperature) EMCAL");
435 for (
Int_t ism=0; ism<nSM; ++ism)
437 for (
Int_t icol=0; icol<48; ++icol)
439 for (
Int_t irow=0; irow<24; ++irow)
443 Int_t absID =
fGeom->GetAbsCellIdFromCellIndexes(ism, irow, icol);
444 factor *= htd->GetBinContent(absID) / 10000. ;
451 }
else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
459 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
462 contTRF->InitFromFile(Form(
"%s/EMCALTimeCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeCalib");
464 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeCalib.root").data(),
"AliEMCALTimeCalib");
472 if ( pass==
"spc_calo" ) passM =
"pass3";
473 if (
fRun > 209121 ) passM =
"pass1";
474 if ( pass ==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
481 AliInfo(
"Time Recalibrate EMCAL");
482 for (
Int_t ibc = 0; ibc < 4; ++ibc)
489 h = (TH1F*)trecalpass->FindObject(Form(
"hAllTimeAvBC%d",ibc));
493 AliError(Form(
"Could not load hAllTimeAvBC%d",ibc));
501 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for pass");
502 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for run");
514 AliOADBContainer *contBC =
new AliOADBContainer(
"");
518 timeFile =
new TFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"read");
520 timeFile =
new TFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"read");
522 if (!timeFile || timeFile->IsZombie())
524 AliFatal(Form(
"EMCALTimeL1PhaseCalib.root was not found in the path provided: %s",
fOADBFilePath.Data()));
528 if (timeFile)
delete timeFile;
531 contBC->InitFromFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeL1PhaseCalib");
533 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"AliEMCALTimeL1PhaseCalib");
538 AliError(Form(
"No external L1 phase in time calibration set for run number: %d",
fRun));
546 if ( pass==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
552 AliError(Form(
"No external L1 phase in time calibration set for: %d -%s",
fRun,pass2.Data()));
555 else AliInfo(
"Recalibrate L1 Phase time");
559 if ( DebugLevel()>0 ) arrayBCpass->Print();
564 h = (TH1C*)arrayBCpass->FindObject(Form(
"h%d",
fRun));
568 AliFatal(Form(
"There is no calibration histogram h%d for this run",
fRun));
595 AliCDBManager *cdb = AliCDBManager::Instance();
599 cdb->SetDefaultStorage(
fOCDBpath.Data());
600 AliInfo(Form(
"Default storage %s",
fOCDBpath.Data()));
609 cdb->SetSpecificStorage(
"EMCAL/Calib/Data",
"raw://");
610 cdb->SetSpecificStorage(
"EMCAL/Calib/Time",
"raw://");
611 cdb->SetSpecificStorage(
"EMCAL/Calib/Pedestals",
"raw://");
614 TString path = cdb->GetDefaultStorage()->GetBaseFolder();
651 new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j,
fTCardCorrCellsEner[j], fixTime,AliEMCALDigit::kHG,idigit, 0, 0, 0);
670 Int_t eventN = Entry();
672 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
> 673 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
676 if ( eventN <= 0 && aodIH)
677 eventN = aodIH->GetReadEntry();
687 if (aodIH && aodIH->GetMergeEvents())
691 if(!aodIH->GetMergeEMCALCells())
692 AliFatal(
"Events merged but not EMCAL cells, check analysis settings!");
694 AliDebug(1,
"Use embedded events");
696 AliDebug(1,Form(
"\t InputEvent N Clusters %d, N Cells %d",
697 InputEvent()->GetNumberOfCaloClusters(),InputEvent()->GetEMCALCells()->GetNumberOfCells()));
699 AliDebug(1,Form(
"\t MergedEvent N Clusters %d, N Cells %d",
700 aodIH->GetEventToMerge()->GetNumberOfCaloClusters(), aodIH->GetEventToMerge()->GetEMCALCells()->GetNumberOfCells()));
711 AliDebug(1,Form(
"\t OutputEvent N Clusters %d, N Cells %d",
712 AODEvent()->GetNumberOfCaloClusters(), AODEvent()->GetEMCALCells()->GetNumberOfCells()));
728 AliError(
"Event not available");
763 AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
789 Int_t nClusters =
fEvent->GetNumberOfCaloClusters();
790 Int_t nClustersOrg = 0;
792 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
793 if(aodIH && aodIH->GetEventToMerge())
794 nClusters = aodIH->GetEventToMerge()->GetNumberOfCaloClusters();
803 for (
Int_t i = 0; i < nClusters; i++)
805 AliVCluster *clus = 0;
806 if(aodIH && aodIH->GetEventToMerge())
807 clus = aodIH->GetEventToMerge()->GetCaloCluster(i);
809 clus =
fEvent->GetCaloCluster(i);
811 if ( !clus )
continue;
813 if ( !clus || !clus->IsEMCAL() )
continue;
817 Int_t label = clus->GetLabel();
819 if (clus->GetNLabels() >=2 ) label2 = clus->GetLabelAt(1) ;
821 AliDebug(2, Form(
"recover original cluster %d info: Id %d, E %2.3f, N cells %d, TOF %3.2f, N labels %d, label %d;",
822 i,clus->GetID(), clus->E(),clus->GetNCells(),clus->GetTOF()*1e9, clus->GetNLabels(), label) );
826 for(
Int_t imc = 0; imc < clus->GetNLabels(); imc++)
828 printf(
"\t mc %d) Label %d, E dep frac %1.3f; ",
829 imc, clus->GetLabelAt(imc),clus->GetClusterMCEdepFraction(imc));
834 UShort_t * index = clus->GetCellsAbsId() ;
835 for(
Int_t icell=0; icell < clus->GetNCells(); icell++ )
838 fCellTime[index[icell]] = clus->GetTOF();
848 AliDebug(2, Form(
"\t : cell %d Id %d, clus %d, time %2.3e, MatchEta %2.3f, MatchPhi %2.3f; 1st label %d, 2nd label %d",
854 AliDebug(2, Form(
"N original cluster %d",nClustersOrg) );
868 Int_t bc = InputEvent()->GetBunchCrossNumber();
899 AliDebug(2,Form(
"Remove channel absId %d, index %d of %d, amp %f, time %f",
900 id,icell,
fCaloCells->GetNumberOfCells(), amp, time*1.e9));
938 if (mcLabel > 0 && efrac < 1.e-6) efrac = 1;
950 AliVCluster *clus = 0;
953 AliDebug(1, Form(
"EdepFrac use for : absId %d, idigit %d, iclus %d, amp %2.3f",
id,idigit,iclus,amp) );
955 if(aodIH && aodIH->GetEventToMerge())
956 clus = aodIH->GetEventToMerge()->GetCaloCluster(iclus);
958 clus =
fEvent->GetCaloCluster(iclus);
961 nLabels = labeArr.GetSize();
963 AliDebug(1, Form(
"N labels after EdepFrac info use: %d, amp %2.3f (check changes)",nLabels,amp) );
978 if(amp <= 0.01) continue ;
980 AliDebug(5,Form(
"*** Add digit *** digit %d, AbsId %d, amp %2.3f, time %3.2f, nlabels %d, label %d",
981 idigit,
id, amp, time*1.e9,nLabels,mcLabel));
983 AliEMCALDigit* digit =
new((*fDigitsArr)[idigit])
984 AliEMCALDigit( mcLabel, mcLabel,
id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, eDep);
987 digit->SetListOfParents(nLabels,labeArr.GetArray(),eDepArr.GetArray());
1013 AliWarning(Form(
"No array with CaloClusters, input RecPoints entries %d",
fClusterArr->GetEntriesFast()));
1017 AliDebug(1,Form(
"N clusters: before recluster %d, after recluster %d, recpoints %d",
1037 Int_t cellMCLabel = 0;
1039 Int_t nClustersOrg = 0;
1042 for (
Int_t i = 0; i <
fEvent->GetNumberOfCaloClusters(); i++)
1044 AliVCluster *clus =
fEvent->GetCaloCluster(i);
1059 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1061 if (
fCaloCells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
1064 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status = 0;
1065 fGeom->GetCellIndex(cellNumber,imod,iTower,iIphi,iIeta);
1066 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1079 AliESDCaloCluster * esdCluster =
dynamic_cast<AliESDCaloCluster*
> (clus);
1080 AliAODCaloCluster * aodCluster =
dynamic_cast<AliAODCaloCluster*
> (clus);
1091 AliWarning(
"Wrong CaloCluster type?");
1122 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - **** Start ***\n");
1131 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Remove exotics in EMCAL\n");
1142 if(bRecalE && ! bMC)
1144 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on energy recalibration in EMCAL\n");
1153 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on bad channels removal in EMCAL\n");
1160 if(bRecalT && ! bMC)
1162 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on time recalibration in EMCAL\n");
1177 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kBeamTestCorrected xxx\n");
1182 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kPi0MCv3 xxx\n");
1188 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx DON'T SET Non linearity correction xxx\n");
1199 AliVCaloCells &eventEMcells = *(
fEvent->GetEMCALCells());
1200 Int_t nEMcell = eventEMcells.GetNumberOfCells() ;
1202 AliAODCaloCells &aodEMcells = *(AODEvent()->GetEMCALCells());
1203 aodEMcells.CreateContainer(nEMcell);
1204 aodEMcells.SetType(AliVCaloCells::kEMCALCell);
1207 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1209 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1210 fGeom->GetCellIndex(eventEMcells.GetCellNumber(iCell),imod,iTower,iIphi,iIeta);
1211 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1221 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),eventEMcells.GetAmplitude(iCell)*calibFactor,
1222 eventEMcells.GetTime(iCell),eventEMcells.GetMCLabel(iCell),eventEMcells.GetEFraction(iCell));
1226 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),0,-1,-1,0);
1243 for (
Int_t i = 0; i < 6; i++) covVtx[i] = 0.;
1245 AliAODHeader* header =
dynamic_cast<AliAODHeader*
>(AODEvent()->GetHeader());
1246 if(!header) AliFatal(
"Not a standard AOD");
1247 header->SetRunNumber(
fRun);
1251 TTree* tree = fInputHandler->GetTree();
1254 TFile*
file = tree->GetCurrentFile();
1255 if (file) header->SetESDFileName(file->GetName());
1258 else if (aodevent) {
1259 AliAODHeader * aodheader =
dynamic_cast<AliAODHeader*
>(aodevent->GetHeader());
1260 if(!aodheader) AliFatal(
"Not a standard AOD");
1261 header->SetESDFileName(aodheader->GetESDFileName());
1264 header->SetBunchCrossNumber(
fEvent->GetBunchCrossNumber());
1265 header->SetOrbitNumber(
fEvent->GetOrbitNumber());
1266 header->SetPeriodNumber(
fEvent->GetPeriodNumber());
1267 header->SetEventType(
fEvent->GetEventType());
1272 if(
fEvent->GetCentrality())
1273 header->SetCentrality(
new AliCentrality(*(
fEvent->GetCentrality())));
1275 header->SetCentrality(0);
1279 header->SetOfflineTrigger(fInputHandler->IsEventSelected());
1281 header->SetFiredTriggerClasses(
fEvent->GetFiredTriggerClasses());
1283 header->SetTriggerMask(
fEvent->GetTriggerMask());
1284 header->SetTriggerCluster(
fEvent->GetTriggerCluster());
1288 header->SetL0TriggerInputs(esdevent->GetHeader()->GetL0TriggerInputs());
1289 header->SetL1TriggerInputs(esdevent->GetHeader()->GetL1TriggerInputs());
1290 header->SetL2TriggerInputs(esdevent->GetHeader()->GetL2TriggerInputs());
1294 header->SetL0TriggerInputs(aodevent->GetHeader()->GetL0TriggerInputs());
1295 header->SetL1TriggerInputs(aodevent->GetHeader()->GetL1TriggerInputs());
1296 header->SetL2TriggerInputs(aodevent->GetHeader()->GetL2TriggerInputs());
1299 header->SetMagneticField(
fEvent->GetMagneticField());
1302 header->SetZDCN1Energy(
fEvent->GetZDCN1Energy());
1303 header->SetZDCP1Energy(
fEvent->GetZDCP1Energy());
1304 header->SetZDCN2Energy(
fEvent->GetZDCN2Energy());
1305 header->SetZDCP2Energy(
fEvent->GetZDCP2Energy());
1306 header->SetZDCEMEnergy(
fEvent->GetZDCEMEnergy(0),
fEvent->GetZDCEMEnergy(1));
1310 fEvent->GetDiamondCovXY(diamcov);
1311 header->SetDiamond(diamxy,diamcov);
1312 if (esdevent) header->SetDiamondZ(esdevent->GetDiamondZ(),esdevent->GetSigma2DiamondZ());
1313 else if (aodevent) header->SetDiamondZ(aodevent->GetDiamondZ(),aodevent->GetSigma2DiamondZ());
1316 Int_t nVertices = 1 ;;
1317 Int_t nCaloClus =
fEvent->GetNumberOfCaloClusters();
1319 AODEvent()->ResetStd(0, nVertices, 0, 0, 0, nCaloClus, 0, 0);
1322 TClonesArray &vertices = *(AODEvent()->GetVertices());
1327 fEvent->GetPrimaryVertex()->GetXYZ(pos);
1331 esdevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1332 chi = esdevent->GetPrimaryVertex()->GetChi2toNDF();
1336 aodevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1337 chi = aodevent->GetPrimaryVertex()->GetChi2perNDF();
1340 AliAODVertex * primary =
new(vertices[jVertices++])
1342 primary->SetName(
fEvent->GetPrimaryVertex()->GetName());
1343 primary->SetTitle(
fEvent->GetPrimaryVertex()->GetTitle());
1363 for(
Int_t i = 0; i < kNumberOfCaloClusters; i++)
1365 AliAODCaloCluster *newCluster = (AliAODCaloCluster *)
fCaloClusterArr->At(i);
1367 newCluster->SetID(i);
1378 newCluster->AddTrackMatched(
fEvent->GetTrack(trackIndex));
1379 AliDebug(2,Form(
"Matched Track index %d to new cluster %d",trackIndex,i));
1384 newCluster->SetTrackDistance(dR,dZ);
1388 Int_t absId0 = newCluster->GetCellsAbsId()[0];
1407 new((*fOutputAODBranch)[i]) AliAODCaloCluster(*newCluster);
1409 AliDebug(2,Form(
"New cluster %d of %d, energy %f, mc label %d",
1410 newCluster->GetID(), kNumberOfCaloClusters, newCluster->E(), newCluster->GetLabel()));
1442 if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1444 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Pointer to tree = 0, returning null");
1448 if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1450 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Null pointer input file, returning null");
1454 TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1455 if (pass.Contains(
"ass1"))
return TString(
"pass1");
1456 else if (pass.Contains(
"ass2"))
return TString(
"pass2");
1457 else if (pass.Contains(
"ass3"))
return TString(
"pass3");
1458 else if (pass.Contains(
"ass4"))
return TString(
"pass4");
1459 else if (pass.Contains(
"ass5"))
return TString(
"pass5");
1460 else if (pass.Contains(
"LHC11c") && pass.Contains(
"spc_calo") )
return TString(
"spc_calo");
1461 else if (pass.Contains(
"calo") || pass.Contains(
"high_lumi"))
1463 AliInfo(
"Path contains <calo> or <high-lumi>, set as <pass1>");
1466 else if (pass.Contains(
"LHC14a1a"))
1468 AliInfo(
"Enable EMCal energy calibration for this MC production!!");
1476 AliInfo(
"Pass number string not found");
1487 if(fDebug >=0) (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
1491 fBranchNames =
"ESD:AliESDHeader.,EMCALCells.";
1509 AliInfo(Form(
"Configure analysis with %s",
fConfigName.Data()));
1549 if (
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv1)
1551 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv2)
1553 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv3)
1555 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerNxN)
1563 AliFatal(Form(
"Clusterizer < %d > not available",
fRecParam->GetClusterizerFlag()));
1588 for (i = 0; i < 8; i++)
1593 for (i = 0; i < 3; i++)
1618 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
1619 AliInfo(Form(
"Get EMCAL geometry name <%s> for run %d",
fGeom->GetName(),
fRun));
1624 AliInfo(Form(
"Set EMCAL geometry name to <%s>",
fGeomName.Data()));
1644 AliDebug(1,Form(
"Init for run=%d",
fRun));
1645 if (!gGeoManager) AliDebug(1,
"Careful!, gGeoManager not loaded, load misalign matrices");
1650 AliInfo(
"Load user defined EMCAL geometry matrices");
1653 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
1655 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
1657 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
1661 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1666 AliDebug(2,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
1669 fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
1674 if(DebugLevel() > 1)
1679 else if(gGeoManager)
1681 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
1682 fGeom->SetMisalMatrix(
fGeom->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
1686 AliError(Form(
"Alignment atrix for SM %d is not available",mod));
1693 else if(!gGeoManager)
1695 AliInfo(
"Get geo matrices from data");
1697 if(!strcmp(
fEvent->GetName(),
"AliAODEvent"))
1699 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
1703 AliDebug(1,
"Load Misaligned matrices");
1709 AliError(
"This event does not contain ESDs?");
1710 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
1714 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1716 if(DebugLevel() > 1)
1717 esd->GetEMCALMatrix(mod)->Print();
1719 if(esd->GetEMCALMatrix(mod))
fGeom->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
1742 Int_t bc = InputEvent()->GetBunchCrossNumber();
1763 if(totCellE < 1)
return kTRUE;
1776 if(run < 146858 || run > 146860)
return kFALSE ;
1779 Int_t ncellsSM3 = 0;
1782 if (
fCaloCells->GetAmplitude (icell) > 0.1 &&
1783 fCaloCells->GetCellNumber(icell)/(24*48)==3 ) ncellsSM3++;
1788 Int_t ncellcut = 21;
1789 if(triggerclasses.Contains(
"EMC")) ncellcut = 35;
1791 if( ncellsSM3 >= ncellcut)
1793 AliInfo(Form(
"Reject event %d with ncells in SM3 %d",(
Int_t)Entry(),ncellsSM3));
1794 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
1824 AliDebug(1,Form(
"\t fraction %2.3f",frac));
1831 AliDebug(1,Form(
"\t randomized fraction %2.3f",frac));
1835 if ( frac < 0.0001 )
return;
1843 AliDebug(1,Form(
"\t induced E %2.3f",inducedE));
1874 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1883 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1884 fGeom->GetCellIndex(
id,imod,iTower,iIphi,iIeta);
1885 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1896 AliDebug(1,Form(
"Do not difuse E of cell %d, sm %d, amp %2.2f: SM fraction %2.2f > %2.2f",
1902 AliDebug(1,Form(
"Reference cell absId %d, iEta %d, iPhi %d, sm %d, amp %2.2f",
id,ieta,iphi,imod,amp));
1909 Int_t absIDuplr = -1;
1910 Int_t absIDdolr = -1;
1911 Int_t absIDup2 = -1;
1912 Int_t absIDup2lr = -1;
1913 Int_t absIDdo2 = -1;
1914 Int_t absIDdo2lr = -1;
1918 if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
1919 if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
1921 absIDlr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
1924 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
1926 absIDup =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1927 absIDuplr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
1932 absIDdo =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1933 absIDdolr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
1937 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
1939 absIDup2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
1940 absIDup2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
1945 absIDdo2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
1946 absIDdo2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
1950 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
1951 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
1952 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
1953 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
1957 AliDebug(1,Form(
"cell up %d:" ,absIDup));
1959 AliDebug(1,Form(
"cell down %d:",absIDdo));
1962 AliDebug(1,Form(
"cell up left-right %d:" ,absIDuplr));
1964 AliDebug(1,Form(
"cell down left-right %d:",absIDdolr));
1967 AliDebug(1,Form(
"cell left-right %d:",absIDlr));
1970 AliDebug(1,Form(
"cell up 2nd row %d:" ,absIDup2));
1972 AliDebug(1,Form(
"cell down 2nd row %d:",absIDdo2));
1975 AliDebug(1,Form(
"cell up left-right 2nd row %d:" ,absIDup2lr));
1977 AliDebug(1,Form(
"cell down left-right 2nd row %d:",absIDdo2lr));
1989 AliInfo(Form(
"Geometry: name <%s>, matrix set <%d>, load matrix <%d>, import geo <%d> from path <%s>",
1998 AliInfo(Form(
"Just Unfold clusters <%d>, new clusters list name <%s>, new cells name <%s>",
2003 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>",
2006 AliInfo(Form(
"Reject events out of range: %d < N event < %d, LED <%d>, exotics <%d>",
2010 AliInfo(Form(
"Centrality bin [%2.2f,%2.2f], class <%s>, use AliCentrality? <%d>",
2016 AliInfo(Form(
"MC label from cluster <%d>, Use EdepFrac <%d>, remap AODs <%d>",
2027 AliInfo(
"T-Card emulation not activated");
2031 AliInfo(Form(
"T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:",
2034 AliInfo(Form(
"T-Card emulation super-modules fraction: Min cell E %2.1f MeV; induced Min E %2.1f MeV; Max at low E %2.1f MeV; Max E %2.2f GeV",
2037 for(
Int_t ism = 0; ism < 22; ism++)
2039 printf(
"\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
2042 for(
Int_t icell = 0; icell < 4; icell++)
2044 printf(
"\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
2061 AliEMCALRecPoint *recPoint = (AliEMCALRecPoint*)
fClusterArr->At(i);
2063 const Int_t ncells = recPoint->GetMultiplicity();
2064 Int_t ncellsTrue = 0;
2066 if(recPoint->GetEnergy() <
fRecParam->GetClusteringThreshold())
continue;
2070 Double32_t ratios[ncells];
2073 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2078 AliEMCALDigit *digit = (AliEMCALDigit*)
fDigitsArr->At(recPoint->GetDigitsList()[
c]);
2080 absIds[ncellsTrue] = digit->GetId();
2081 ratios[ncellsTrue] = recPoint->GetEnergiesList()[
c]/digit->GetAmplitude();
2083 if ( !
fRecParam->GetUnfold() && (ratios[ncellsTrue] > 1 || ratios[ncellsTrue] < 1) )
2084 AliWarning(Form(
"recpoint cell E %2.3f but digit E %2.3f and no unfolding", recPoint->GetEnergiesList()[
c], digit->GetAmplitude()));
2092 AliDebug(2,Form(
"Too small energy in cell of cluster: cluster cell %f, digit %f",
2093 recPoint->GetEnergiesList()[
c],digit->GetAmplitude()));
2099 clusterE +=recPoint->GetEnergiesList()[
c];
2102 if (aodIH && aodIH->GetMergeEvents())
2105 AliVCaloCells* meEMCALCells = aodIH->GetEventToMerge()->GetEMCALCells();
2106 AliVCaloCells* ouEMCALCells = AODEvent()->GetEMCALCells();
2108 Float_t sigAmplitude = meEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2110 Float_t sumAmplitude = ouEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2113 if(sumAmplitude > 0) ratios[ncellsTrue] = sigAmplitude/sumAmplitude;
2124 AliDebug(2,Form(
"Skipping cluster with no cells avobe threshold E = %f, ncells %d",
2125 recPoint->GetEnergy(), ncells));
2131 if(clusterE < fRecParam->GetClusteringThreshold())
2133 AliDebug(2,Form(
"Remove cluster with energy below seed threshold %f",clusterE));
2143 recPoint->GetGlobalPosition(gpos);
2148 (*fCaloClusterArr)[j] =
new AliAODCaloCluster() ;
2149 AliAODCaloCluster *clus =
dynamic_cast<AliAODCaloCluster *
>(
fCaloClusterArr->At(j) ) ;
2151 clus->SetType(AliVCluster::kEMCALClusterv1);
2152 clus->SetE(clusterE);
2153 clus->SetPosition(g);
2154 clus->SetNCells(ncellsTrue);
2155 clus->SetCellsAbsId(absIds);
2156 clus->SetCellsAmplitudeFraction(ratios);
2158 clus->SetTOF(recPoint->GetTime()) ;
2159 clus->SetNExMax(recPoint->GetNExMax());
2160 clus->SetDistanceToBadChannel(recPoint->GetDistanceToBadTower());
2162 if(ncells == ncellsTrue)
2165 recPoint->GetElipsAxis(elipAxis);
2166 clus->SetM02(elipAxis[0]*elipAxis[0]) ;
2167 clus->SetM20(elipAxis[1]*elipAxis[1]) ;
2168 clus->SetDispersion(recPoint->GetDispersion());
2174 AliDebug(2,Form(
"Cells removed from cluster (ncells %d, ncellsTrue %d), recalculate Shower Shape",ncells,ncellsTrue));
2176 AliVCaloCells* cells = 0x0;
2177 if (aodIH && aodIH->GetMergeEvents()) cells = AODEvent() ->GetEMCALCells();
2178 else cells = InputEvent()->GetEMCALCells();
2194 Int_t parentMult = 0;
2195 Int_t *parentList = recPoint->GetParents(parentMult);
2196 Float_t *parentListDE = recPoint->GetParentsDE();
2198 clus->SetLabel(parentList, parentMult);
2200 clus->SetClusterMCEdepFractionFromEdepArray(parentListDE);
2214 for(
Int_t icell = 0; icell < ncellsTrue ; icell++)
2218 const AliEMCALDigit * dig = (
const AliEMCALDigit*)
fDigitsArr->At(idigit);
2223 mcEdepFracPerCell[icell] = 0;
2225 Int_t nparents = dig->GetNiparent();
2228 Int_t digLabel =-1 ;
2231 Float_t mcEDepFrac[4] = {0,0,0,0};
2234 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2236 digLabel = dig->GetIparent (jndex+1);
2237 edep = dig->GetDEParent(jndex+1);
2240 if ( digLabel == parentList[0] ) mcEDepFrac[0] = edep;
2241 else if ( digLabel == parentList[1] ) mcEDepFrac[1] = edep;
2242 else if ( digLabel == parentList[2] ) mcEDepFrac[2] = edep;
2243 else if ( digLabel == parentList[3] ) mcEDepFrac[3] = edep;
2250 mcEdepFracPerCell[icell] = clus->PackMCEdepFraction(mcEDepFrac);
2255 clus->SetCellsMCEdepFractionMap(mcEdepFracPerCell);
2257 delete [] mcEdepFracPerCell;
2270 if(label < 0) return ;
2275 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(evt->FindListObject(
"mcparticles")) ;
2278 if(label < arr->GetEntriesFast())
2280 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(label));
2281 if(!particle) return ;
2283 if(label == particle->Label())
return ;
2289 for(
Int_t ind = 0; ind < arr->GetEntriesFast(); ind++ )
2291 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(ind));
2292 if(!particle) continue ;
2294 if(label == particle->Label())
2332 AliAODCaloCluster * clus)
2334 Int_t parentMult = 0;
2335 Int_t *parentList = recPoint->GetParents(parentMult);
2336 clus->SetLabel(parentList, parentMult);
2340 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2343 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2347 for (
UInt_t iLoopLabels = 0 ; iLoopLabels < clus->GetNLabels() ; iLoopLabels++ )
2350 if (
fCellSecondLabels[idCell] == clus->GetLabelAt(iLoopLabels) ) iNewLabel = 0;
2354 Int_t * newLabelArray =
new Int_t[clus->GetNLabels()+1] ;
2355 for (
UInt_t iLoopNewLabels = 0 ; iLoopNewLabels < clus->GetNLabels() ; iLoopNewLabels++ )
2357 newLabelArray[iLoopNewLabels] = clus->GetLabelAt(iLoopNewLabels) ;
2361 clus->SetLabel(newLabelArray,clus->GetNLabels()+1) ;
2362 delete [] newLabelArray;
2378 Int_t nLabTotOrg = 0;
2382 AliVEvent *
event =
fEvent;
2385 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2386 if(aodIH && aodIH->GetEventToMerge())
2387 event = aodIH->GetEventToMerge();
2391 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2393 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2400 for(
Int_t icl =0; icl < nClu; icl++)
2402 if(((
Int_t)clArray.GetAt(icl))==-1 )
continue;
2403 if( idCluster == ((
Int_t)clArray.GetAt(icl)) )
set = kFALSE;
2407 if(
set && idCluster >= 0)
2409 clArray.SetAt(idCluster,nClu++);
2411 nLabTotOrg+=(
event->GetCaloCluster(idCluster))->GetNLabels();
2416 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2418 if(emax < clOrg->E())
2427 if(nClu==0 || nLabTotOrg == 0)
2435 if(idMax != ((
Int_t)clArray.GetAt(0)))
2437 Int_t maxIndex = -1;
2438 Int_t firstCluster = ((
Int_t)clArray.GetAt(0));
2439 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2441 if(idMax == ((
Int_t)clArray.GetAt(iLoopCluster))) maxIndex = iLoopCluster;
2444 if(firstCluster >=0 && idMax >=0)
2446 clArray.SetAt(idMax,0);
2447 clArray.SetAt(firstCluster,maxIndex);
2452 TArrayI clMCArray(nLabTotOrg) ;
2456 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2458 Int_t idCluster = (
Int_t) clArray.GetAt(iLoopCluster);
2460 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2461 Int_t nLab = clOrg->GetNLabels();
2463 for (
Int_t iLab = 0 ; iLab < nLab ; iLab++ )
2465 Int_t lab = clOrg->GetLabelAt(iLab) ;
2470 for(
Int_t iLabTot =0; iLabTot < nLabTot; iLabTot++)
2472 if( lab == ((
Int_t)clMCArray.GetAt(iLabTot)) )
set = kFALSE;
2476 if(
set ) clMCArray.SetAt(lab,nLabTot++);
2483 clus->SetLabel(clMCArray.GetArray(), nLabTot);
2508 AliInfo(
"Cluster branch name not set, set it to newEMCALClustersArray");
2554 else if ( ncells != ndigis )
2560 for (
Int_t idigit = 0; idigit < ndigis; ++idigit)
2562 AliEMCALDigit *digit =
static_cast<AliEMCALDigit*
>(
fDigitsArr->At(idigit));
2564 Double_t cellAmplitude = digit->GetAmplitude();
2565 Short_t cellNumber = digit->GetId();
2566 Double_t cellTime = digit->GetTime();
2568 Bool_t highGain = kFALSE;
2569 if( digit->GetType() == AliEMCALDigit::kHG ) highGain = kTRUE;
2574 Int_t nparents = digit->GetNiparent();
2575 Int_t cellMcEDepFrac =-1 ;
2579 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2581 if(cellMcEDepFrac >= digit->GetDEParent(jndex+1))
continue ;
2583 cellMcLabel = digit->GetIparent (jndex+1);
2584 cellMcEDepFrac= digit->GetDEParent(jndex+1);
2588 if ( cellMcEDepFrac < 0 ) cellMcEDepFrac = 0.;
2591 fCaloCells ->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2593 fOutputAODCells->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2596 if ( ncells != ndigis )
2643 fRun = InputEvent()->GetRunNumber();
2647 AliInfo(Form(
"Set run to %d",
fRun));
2657 AliDebug(1,Form(
"Skip Event %d", (
Int_t) Entry()));
Bool_t IsRunDepRecalibrationOn() const
void RecalculateCellLabelsRemoveAddedGenerator(Int_t absID, AliVCluster *clus, AliMCEvent *mc, Float_t &, TArrayI &labeArr, TArrayF &eDepArr) const
TString fOutputAODCellsName
New of output cells AOD branch name.
TH1F * GetEMCALChannelTimeRecalibrationFactors(Int_t bc) const
void FillAODCaloCells()
Put calo cells in standard branch.
Float_t fTCardCorrMinAmp
Minimum cell energy to induce signal on adjacent cells.
Bool_t IsL1PhaseInTimeRecalibrationOn() const
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.
TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const
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...
void InitEMCALL1PhaseInTimeRecalibration()
AliEMCALClusterizer * fClusterizer
! EMCAL clusterizer
AliAnalysisTaskEMCALClusterize()
Constructor.
TH1C * GetEMCALL1PhaseInTimeRecalibrationForAllSM() const
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
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)
Bool_t IsBadChannelsRemovalSwitchedOn() const
Bool_t IsExoticCell(Int_t absId, AliVCaloCells *cells, Int_t bc=-1)
Int_t fSetCellMCLabelFromCluster
void SetNonLinearityFunction(Int_t fun)
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.
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
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...
TObjArray * GetEMCALL1PhaseInTimeRecalibrationArray() 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)
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.
void RecalculateClusterDistanceToBadChannel(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
TH2I * GetEMCALChannelStatusMap(Int_t iSM) const
void SwitchOnBadChannelsRemoval()
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
Float_t fTCardCorrMaxInducedLowE
Maximum value of induced energy signal that is always accepted, order of ADC, tipically 10 MeV...
Bool_t fInputFromFilter
Get the input from AODs from the filter.
TString fOutputAODBranchName
New of output clusters AOD branch.
Int_t GetMatchedTrackIndex(Int_t clsIndex)
AliEMCALGeometry * fGeom
EMCAL geometry.
void SwitchOnL1PhaseInTimeRecalibration()
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.
Bool_t AcceptCalibrateCell(Int_t absId, Int_t bc, Float_t &, Double_t &time, AliVCaloCells *cells)
Bool_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow, Int_t &status) const
AliEMCALRecoUtils * fRecoUtils
Access to factorized reconstruction algorithms.
void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
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()
Bool_t IsTimeRecalibrationOn() const
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.
void SwitchOnRecalibration()
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
void RecalibrateClusterEnergy(const AliEMCALGeometry *geom, AliVCluster *cluster, AliVCaloCells *cells, Int_t bc=-1)
void GetMatchedResiduals(Int_t clsIndex, Float_t &dEta, Float_t &dPhi)
TString fInputCaloCellsName
Input cells branch name, if different from default branch.
TGeoHMatrix * fGeomMatrix[22]
Geometry matrices with alignments.
Bool_t AcceptCell(Int_t absID, Bool_t badmap=kTRUE)
Bool_t IsLEDEvent(const Int_t run)
Check if event is LED, is so remove it. Affected LHC11a runs.
AliEMCALRecParam * fRecParam
Reconstruction parameters container.
void SetPositionAlgorithm(Int_t alg)
Int_t fMinEvent
Set a minimum event number, for testing.
TString fGeomName
Name of geometry to use.
Bool_t fOutputAODBranchSet
Set the AOD clusters branch in the input event once.
void SwitchOffRunDepCorrection()
void SwitchOffL1PhaseInTimeRecalibration()
void PrintParam()
Print clusterization task parameters.
Float_t fTCardCorrMinInduced
Minimum induced energy signal on adjacent cells, sum of induced plus original energy, use same as cell energy clusterization cut.
void RemapMCLabelForAODs(Int_t &label)
TString fOCDBpath
Path with OCDB location.
AliEMCALAfterBurnerUF * fUnfolder
! Unfolding procedure
void SwitchOnDistToBadChannelRecalculation()
Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, AliVCaloCells *cells, Int_t bc=-1)
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 number, for testing.
Bool_t fFillAODCaloCells
Copy calocells to standard branch.
TObjArray * fCaloClusterArr
! CaloClusters array
void RecalculateClusterPosition(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
Double_t fCellTime[fgkNEMCalCells]
Array with cluster time to be passed to digit in case of AODs.
void SwitchOnRunDepCorrection()
AliCentrality * GetCentrality() const
void RecalculateClusterPID(AliVCluster *cluster)
TString fCentralityClass
Name of selected centrality class.
void SetEMCALL1PhaseInTimeRecalibrationForAllSM(const TObjArray *map)
void SwitchOnRejectExoticCluster()
TFile * file
TList with histograms for a given trigger.
void SetExoticCellMinAmplitudeCut(Float_t ma)
Bool_t fAccessOCDB
Need to access info from OCDB (not really)
TObjArray * fClusterArr
! Recpoints array
void FindMatches(AliVEvent *event, TObjArray *clusterArr=0x0, const AliEMCALGeometry *geom=0x0, AliMCEvent *mc=0x0)
void SetExoticCellFractionCut(Float_t f)
Bool_t fRecalibrateWithClusterTime
Use fCellTime to store time of cells in cluster.
void SetEMCALChannelTimeRecalibrationFactors(const TObjArray *map)
Int_t GetRunNumber(TString)
void InitClusterization()
Float_t CorrectClusterEnergyLinearity(AliVCluster *clu)
void FillAODHeader()
Put event header information in standard AOD branch.
Bool_t ClusterContainsBadChannel(const AliEMCALGeometry *geom, const UShort_t *cellList, Int_t nCells)
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)...
void CalculateInducedEnergyInTCardCell(Int_t absId, Int_t absIdRef, Int_t sm, Float_t ampRef, Int_t cellCase)
Float_t fTCardCorrInduceEnerFracMin[22]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the minimum fraction of induced energy per S...
void SetEMCALChannelRecalibrationFactors(const TObjArray *map)
virtual void RecPoints2Clusters()
Int_t fEMCALNcellsCut
At least an EMCAL cluster with fNCellsCut cells over fEnergyCut.
void SwitchOnTimeRecalibration()
void SetEMCALChannelStatusMap(const TObjArray *map)
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 ...
void RecalibrateCellTime(Int_t absId, Int_t bc, Double_t &time, Bool_t isLGon=kFALSE) const
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.
void SwitchOnRejectExoticCell()
Bool_t fRemapMCLabelForAODs
Remap AOD cells MC label. Needed in old AOD productions.