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), fMinEvent(0)
84 , fDoTrackMatching(0), fUpdateCell(0)
85 , fSelectCell(kFALSE), fSelectCellMinE(0), fSelectCellMinFrac(0)
86 , fRejectBelowThreshold(kFALSE)
87 , fRemoveLEDEvents(kTRUE),fRemoveExoticEvents(kFALSE)
88 , fImportGeometryFromFile(kTRUE), fImportGeometryFilePath(
"")
89 , fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(
"")
90 , fConstantTimeShift(0)
91 , fCentralityClass(
""), fUseAliCentrality(0), fSelectEMCALEvent(0)
92 , fEMCALEnergyCut(0.), fEMCALNcellsCut (0)
93 , fSetCellMCLabelFromCluster(0)
94 , fSetCellMCLabelFromEdepFrac(0)
95 , fRemapMCLabelForAODs(0)
97 , fTCardCorrEmulation(0), fTCardCorrClusEnerConserv(0)
98 , fRandom(0), fRandomizeTCard(1)
99 , fTCardCorrMinAmp(0.01), fTCardCorrMaxInduced(100)
103 for(
Int_t i = 0; i < 22; i++)
110 for(
Int_t j = 0; j < 4 ; j++)
166 for(
Int_t i = 0; i < 22; i++)
173 for(
Int_t j = 0; j < 4 ; j++)
227 if ( absID < 0 || absID >= 24*48*
fGeom->GetNumberOfSuperModules() )
230 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
231 if (!
fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
237 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
258 Int_t nCluster =
fEvent -> GetNumberOfCaloClusters();
261 for(
Int_t icalo = 0; icalo < nCluster; icalo++)
263 AliVCluster *clus = (AliVCluster*) (
fEvent->GetCaloCluster(icalo));
269 AliDebug(1, Form(
"Accept : E %2.2f > %2.2f, nCells %d > %d",
277 AliDebug(1,
"Reject");
293 AliInfo(Form(
"Get AODB parameters from EMCAL in %s for run %d, and <%s>",
fOADBFilePath.Data(),
fRun,pass.Data()));
300 AliOADBContainer *contBC=
new AliOADBContainer(
"");
302 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fOADBFilePath.Data()),
"AliEMCALBadChannels");
304 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"AliEMCALBadChannels");
311 AliInfo(
"Remove EMCAL bad cells");
313 for (
Int_t i=0; i < nSM; ++i)
320 hbm=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
324 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
328 hbm->SetDirectory(0);
332 }
else AliInfo(
"Do NOT remove EMCAL bad channels");
340 AliOADBContainer *contRF=
new AliOADBContainer(
"");
343 contRF->InitFromFile(Form(
"%s/EMCALRecalib.root",
fOADBFilePath.Data()),
"AliEMCALRecalib");
345 contRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALRecalib.root").data(),
"AliEMCALRecalib");
359 AliInfo(
"Recalibrate EMCAL");
360 for (
Int_t i=0; i<nSM; ++i)
367 h = (
TH2F*)recalib->FindObject(Form(
"EMCALRecalFactors_SM%d",i));
371 AliError(Form(
"Could not load EMCALRecalFactors_SM%d",i));
379 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params object array");
380 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for pass");
381 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for run");
389 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
392 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
394 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
396 TH1S *htd=(TH1S*)contRFTD->GetObject(
fRun);
401 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",
fRun));
405 Int_t maxEntry = contRFTD->GetNumberOfEntries();
407 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) <
fRun) ) {
412 Int_t closest = lower;
413 if ( (ic<maxEntry) &&
414 (contRFTD->LowerLimit(ic)-
fRun) < (
fRun - contRFTD->UpperLimit(lower)) ) {
418 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
419 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
424 AliInfo(
"Recalibrate (Temperature) EMCAL");
426 for (
Int_t ism=0; ism<nSM; ++ism)
428 for (
Int_t icol=0; icol<48; ++icol)
430 for (
Int_t irow=0; irow<24; ++irow)
434 Int_t absID =
fGeom->GetAbsCellIdFromCellIndexes(ism, irow, icol);
435 factor *= htd->GetBinContent(absID) / 10000. ;
442 }
else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
450 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
453 contTRF->InitFromFile(Form(
"%s/EMCALTimeCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeCalib");
455 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeCalib.root").data(),
"AliEMCALTimeCalib");
463 if ( pass==
"spc_calo" ) passM =
"pass3";
464 if (
fRun > 209121 ) passM =
"pass1";
465 if ( pass ==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
472 AliInfo(
"Time Recalibrate EMCAL");
473 for (
Int_t ibc = 0; ibc < 4; ++ibc)
480 h = (TH1F*)trecalpass->FindObject(Form(
"hAllTimeAvBC%d",ibc));
484 AliError(Form(
"Could not load hAllTimeAvBC%d",ibc));
492 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for pass");
493 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for run");
505 AliOADBContainer *contBC =
new AliOADBContainer(
"");
509 timeFile =
new TFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"read");
511 timeFile =
new TFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"read");
513 if (!timeFile || timeFile->IsZombie())
515 AliFatal(Form(
"EMCALTimeL1PhaseCalib.root was not found in the path provided: %s",
fOADBFilePath.Data()));
519 if (timeFile)
delete timeFile;
522 contBC->InitFromFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeL1PhaseCalib");
524 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"AliEMCALTimeL1PhaseCalib");
529 AliError(Form(
"No external L1 phase in time calibration set for run number: %d",
fRun));
537 if ( pass==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
543 AliError(Form(
"No external L1 phase in time calibration set for: %d -%s",
fRun,pass2.Data()));
546 else AliInfo(
"Recalibrate L1 Phase time");
550 if ( DebugLevel()>0 ) arrayBCpass->Print();
555 h = (TH1C*)arrayBCpass->FindObject(Form(
"h%d",
fRun));
559 AliFatal(Form(
"There is no calibration histogram h%d for this run",
fRun));
586 AliCDBManager *cdb = AliCDBManager::Instance();
590 cdb->SetDefaultStorage(
fOCDBpath.Data());
591 AliInfo(Form(
"Default storage %s",
fOCDBpath.Data()));
600 cdb->SetSpecificStorage(
"EMCAL/Calib/Data",
"raw://");
601 cdb->SetSpecificStorage(
"EMCAL/Calib/Time",
"raw://");
602 cdb->SetSpecificStorage(
"EMCAL/Calib/Pedestals",
"raw://");
605 TString path = cdb->GetDefaultStorage()->GetBaseFolder();
642 new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j,
fTCardCorrCellsEner[j], fixTime,AliEMCALDigit::kHG,idigit, 0, 0, 0);
661 Int_t eventN = Entry();
663 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
> 664 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
667 if ( eventN <= 0 && aodIH)
668 eventN = aodIH->GetReadEntry();
678 if (aodIH && aodIH->GetMergeEvents())
682 if(!aodIH->GetMergeEMCALCells())
683 AliFatal(
"Events merged but not EMCAL cells, check analysis settings!");
685 AliDebug(1,
"Use embedded events");
687 AliDebug(1,Form(
"\t InputEvent N Clusters %d, N Cells %d",
688 InputEvent()->GetNumberOfCaloClusters(),InputEvent()->GetEMCALCells()->GetNumberOfCells()));
690 AliDebug(1,Form(
"\t MergedEvent N Clusters %d, N Cells %d",
691 aodIH->GetEventToMerge()->GetNumberOfCaloClusters(), aodIH->GetEventToMerge()->GetEMCALCells()->GetNumberOfCells()));
702 AliDebug(1,Form(
"\t OutputEvent N Clusters %d, N Cells %d",
703 AODEvent()->GetNumberOfCaloClusters(), AODEvent()->GetEMCALCells()->GetNumberOfCells()));
719 AliError(
"Event not available");
754 AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
780 Int_t nClusters =
fEvent->GetNumberOfCaloClusters();
781 Int_t nClustersOrg = 0;
783 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
784 if(aodIH && aodIH->GetEventToMerge())
785 nClusters = aodIH->GetEventToMerge()->GetNumberOfCaloClusters();
793 for (
Int_t i = 0; i < nClusters; i++)
795 AliVCluster *clus = 0;
796 if(aodIH && aodIH->GetEventToMerge())
797 clus = aodIH->GetEventToMerge()->GetCaloCluster(i);
799 clus =
fEvent->GetCaloCluster(i);
805 if(!clus->IsEMCAL())
continue;
807 Int_t label = clus->GetLabel();
809 if (clus->GetNLabels() >=2 ) label2 = clus->GetLabelAt(1) ;
819 UShort_t * index = clus->GetCellsAbsId() ;
820 for(
Int_t icell=0; icell < clus->GetNCells(); icell++ )
823 fCellTime[index[icell]] = clus->GetTOF();
847 Int_t bc = InputEvent()->GetBunchCrossNumber();
878 AliDebug(2,Form(
"Remove channel absId %d, index %d of %d, amp %f, time %f",
879 id,icell,
fCaloCells->GetNumberOfCells(), amp, time*1.e9));
917 if (mcLabel > 0 && efrac < 1.e-6) efrac = 1;
932 AliVCluster *clus = 0;
937 AliInfo(
"Negative original cluster index, skip \n");
941 if(aodIH && aodIH->GetEventToMerge())
942 clus = aodIH->GetEventToMerge()->GetCaloCluster(iclus);
944 clus =
fEvent->GetCaloCluster(iclus);
947 nLabels = labeArr.GetSize();
962 if(amp <= 0.01) continue ;
966 AliEMCALDigit* digit =
new((*fDigitsArr)[idigit]) AliEMCALDigit( mcLabel, mcLabel,
id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, eDep);
969 digit->SetListOfParents(nLabels,labeArr.GetArray(),eDepArr.GetArray());
995 AliWarning(Form(
"No array with CaloClusters, input RecPoints entries %d",
fClusterArr->GetEntriesFast()));
999 AliDebug(1,Form(
"N clusters: before recluster %d, after recluster %d, recpoints %d",
1019 Int_t cellMCLabel = 0;
1021 Int_t nClustersOrg = 0;
1024 for (
Int_t i = 0; i <
fEvent->GetNumberOfCaloClusters(); i++)
1026 AliVCluster *clus =
fEvent->GetCaloCluster(i);
1041 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1043 if (
fCaloCells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
1046 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1047 fGeom->GetCellIndex(cellNumber,imod,iTower,iIphi,iIeta);
1048 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1061 AliESDCaloCluster * esdCluster =
dynamic_cast<AliESDCaloCluster*
> (clus);
1062 AliAODCaloCluster * aodCluster =
dynamic_cast<AliAODCaloCluster*
> (clus);
1073 AliWarning(
"Wrong CaloCluster type?");
1104 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - **** Start ***\n");
1113 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Remove exotics in EMCAL\n");
1124 if(bRecalE && ! bMC)
1126 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on energy recalibration in EMCAL\n");
1135 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on bad channels removal in EMCAL\n");
1142 if(bRecalT && ! bMC)
1144 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on time recalibration in EMCAL\n");
1159 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kBeamTestCorrected xxx\n");
1164 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kPi0MCv3 xxx\n");
1170 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx DON'T SET Non linearity correction xxx\n");
1181 AliVCaloCells &eventEMcells = *(
fEvent->GetEMCALCells());
1182 Int_t nEMcell = eventEMcells.GetNumberOfCells() ;
1184 AliAODCaloCells &aodEMcells = *(AODEvent()->GetEMCALCells());
1185 aodEMcells.CreateContainer(nEMcell);
1186 aodEMcells.SetType(AliVCaloCells::kEMCALCell);
1188 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1190 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1191 fGeom->GetCellIndex(eventEMcells.GetCellNumber(iCell),imod,iTower,iIphi,iIeta);
1192 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1201 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),eventEMcells.GetAmplitude(iCell)*calibFactor,
1202 eventEMcells.GetTime(iCell),eventEMcells.GetMCLabel(iCell),eventEMcells.GetEFraction(iCell));
1206 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),0,-1,-1,0);
1223 for (
Int_t i = 0; i < 6; i++) covVtx[i] = 0.;
1225 AliAODHeader* header =
dynamic_cast<AliAODHeader*
>(AODEvent()->GetHeader());
1226 if(!header) AliFatal(
"Not a standard AOD");
1227 header->SetRunNumber(
fRun);
1231 TTree* tree = fInputHandler->GetTree();
1234 TFile*
file = tree->GetCurrentFile();
1235 if (file) header->SetESDFileName(file->GetName());
1238 else if (aodevent) {
1239 AliAODHeader * aodheader =
dynamic_cast<AliAODHeader*
>(aodevent->GetHeader());
1240 if(!aodheader) AliFatal(
"Not a standard AOD");
1241 header->SetESDFileName(aodheader->GetESDFileName());
1244 header->SetBunchCrossNumber(
fEvent->GetBunchCrossNumber());
1245 header->SetOrbitNumber(
fEvent->GetOrbitNumber());
1246 header->SetPeriodNumber(
fEvent->GetPeriodNumber());
1247 header->SetEventType(
fEvent->GetEventType());
1252 if(
fEvent->GetCentrality())
1253 header->SetCentrality(
new AliCentrality(*(
fEvent->GetCentrality())));
1255 header->SetCentrality(0);
1259 header->SetOfflineTrigger(fInputHandler->IsEventSelected());
1261 header->SetFiredTriggerClasses(
fEvent->GetFiredTriggerClasses());
1263 header->SetTriggerMask(
fEvent->GetTriggerMask());
1264 header->SetTriggerCluster(
fEvent->GetTriggerCluster());
1268 header->SetL0TriggerInputs(esdevent->GetHeader()->GetL0TriggerInputs());
1269 header->SetL1TriggerInputs(esdevent->GetHeader()->GetL1TriggerInputs());
1270 header->SetL2TriggerInputs(esdevent->GetHeader()->GetL2TriggerInputs());
1274 header->SetL0TriggerInputs(aodevent->GetHeader()->GetL0TriggerInputs());
1275 header->SetL1TriggerInputs(aodevent->GetHeader()->GetL1TriggerInputs());
1276 header->SetL2TriggerInputs(aodevent->GetHeader()->GetL2TriggerInputs());
1279 header->SetMagneticField(
fEvent->GetMagneticField());
1282 header->SetZDCN1Energy(
fEvent->GetZDCN1Energy());
1283 header->SetZDCP1Energy(
fEvent->GetZDCP1Energy());
1284 header->SetZDCN2Energy(
fEvent->GetZDCN2Energy());
1285 header->SetZDCP2Energy(
fEvent->GetZDCP2Energy());
1286 header->SetZDCEMEnergy(
fEvent->GetZDCEMEnergy(0),
fEvent->GetZDCEMEnergy(1));
1290 fEvent->GetDiamondCovXY(diamcov);
1291 header->SetDiamond(diamxy,diamcov);
1292 if (esdevent) header->SetDiamondZ(esdevent->GetDiamondZ(),esdevent->GetSigma2DiamondZ());
1293 else if (aodevent) header->SetDiamondZ(aodevent->GetDiamondZ(),aodevent->GetSigma2DiamondZ());
1296 Int_t nVertices = 1 ;;
1297 Int_t nCaloClus =
fEvent->GetNumberOfCaloClusters();
1299 AODEvent()->ResetStd(0, nVertices, 0, 0, 0, nCaloClus, 0, 0);
1302 TClonesArray &vertices = *(AODEvent()->GetVertices());
1307 fEvent->GetPrimaryVertex()->GetXYZ(pos);
1311 esdevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1312 chi = esdevent->GetPrimaryVertex()->GetChi2toNDF();
1316 aodevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1317 chi = aodevent->GetPrimaryVertex()->GetChi2perNDF();
1320 AliAODVertex * primary =
new(vertices[jVertices++])
1322 primary->SetName(
fEvent->GetPrimaryVertex()->GetName());
1323 primary->SetTitle(
fEvent->GetPrimaryVertex()->GetTitle());
1343 for(
Int_t i = 0; i < kNumberOfCaloClusters; i++)
1345 AliAODCaloCluster *newCluster = (AliAODCaloCluster *)
fCaloClusterArr->At(i);
1347 newCluster->SetID(i);
1358 newCluster->AddTrackMatched(
fEvent->GetTrack(trackIndex));
1359 AliDebug(2,Form(
"Matched Track index %d to new cluster %d",trackIndex,i));
1364 newCluster->SetTrackDistance(dR,dZ);
1368 Int_t absId0 = newCluster->GetCellsAbsId()[0];
1387 new((*fOutputAODBranch)[i]) AliAODCaloCluster(*newCluster);
1389 AliDebug(2,Form(
"New cluster %d of %d, energy %f, mc label %d",
1390 newCluster->GetID(), kNumberOfCaloClusters, newCluster->E(), newCluster->GetLabel()));
1422 if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1424 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Pointer to tree = 0, returning null");
1428 if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1430 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Null pointer input file, returning null");
1434 TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1435 if (pass.Contains(
"ass1"))
return TString(
"pass1");
1436 else if (pass.Contains(
"ass2"))
return TString(
"pass2");
1437 else if (pass.Contains(
"ass3"))
return TString(
"pass3");
1438 else if (pass.Contains(
"ass4"))
return TString(
"pass4");
1439 else if (pass.Contains(
"ass5"))
return TString(
"pass5");
1440 else if (pass.Contains(
"LHC11c") && pass.Contains(
"spc_calo") )
return TString(
"spc_calo");
1441 else if (pass.Contains(
"calo") || pass.Contains(
"high_lumi"))
1443 AliInfo(
"Path contains <calo> or <high-lumi>, set as <pass1>");
1446 else if (pass.Contains(
"LHC14a1a"))
1448 AliInfo(
"Enable EMCal energy calibration for this MC production!!");
1456 AliInfo(
"Pass number string not found");
1467 if(fDebug >=0) (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
1471 fBranchNames =
"ESD:AliESDHeader.,EMCALCells.";
1489 AliInfo(Form(
"Configure analysis with %s",
fConfigName.Data()));
1529 if (
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv1)
1531 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv2)
1533 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerNxN)
1541 AliFatal(Form(
"Clusterizer < %d > not available",
fRecParam->GetClusterizerFlag()));
1566 for (i = 0; i < 8; i++)
1571 for (i = 0; i < 3; i++)
1596 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
1597 AliInfo(Form(
"Get EMCAL geometry name <%s> for run %d",
fGeom->GetName(),
fRun));
1602 AliInfo(Form(
"Set EMCAL geometry name to <%s>",
fGeomName.Data()));
1622 AliDebug(1,Form(
"Init for run=%d",
fRun));
1623 if (!gGeoManager) AliDebug(1,
"Careful!, gGeoManager not loaded, load misalign matrices");
1628 AliInfo(
"Load user defined EMCAL geometry matrices");
1631 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
1633 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
1635 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
1639 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1644 AliDebug(2,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
1647 fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
1652 if(DebugLevel() > 1)
1657 else if(gGeoManager)
1659 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
1660 fGeom->SetMisalMatrix(
fGeom->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
1664 AliError(Form(
"Alignment atrix for SM %d is not available",mod));
1671 else if(!gGeoManager)
1673 AliInfo(
"Get geo matrices from data");
1675 if(!strcmp(
fEvent->GetName(),
"AliAODEvent"))
1677 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
1681 AliDebug(1,
"Load Misaligned matrices");
1687 AliError(
"This event does not contain ESDs?");
1688 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
1692 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1694 if(DebugLevel() > 1)
1695 esd->GetEMCALMatrix(mod)->Print();
1697 if(esd->GetEMCALMatrix(mod))
fGeom->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
1720 Int_t bc = InputEvent()->GetBunchCrossNumber();
1741 if(totCellE < 1)
return kTRUE;
1754 if(run < 146858 || run > 146860)
return kFALSE ;
1757 Int_t ncellsSM3 = 0;
1760 if (
fCaloCells->GetAmplitude (icell) > 0.1 &&
1761 fCaloCells->GetCellNumber(icell)/(24*48)==3 ) ncellsSM3++;
1766 Int_t ncellcut = 21;
1767 if(triggerclasses.Contains(
"EMC")) ncellcut = 35;
1769 if( ncellsSM3 >= ncellcut)
1771 AliInfo(Form(
"Reject event %d with ncells in SM3 %d",(
Int_t)Entry(),ncellsSM3));
1772 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
1790 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1799 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1800 fGeom->GetCellIndex(
id,imod,iTower,iIphi,iIeta);
1801 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1813 AliDebug(1,Form(
"Reference cell absId %d, iEta %d, iPhi %d, amp %2.3f",
id,ieta,iphi,amp));
1820 Int_t absIDuplr = -1;
1821 Int_t absIDdolr = -1;
1823 Int_t absIDup2 = -1;
1824 Int_t absIDup2lr = -1;
1825 Int_t absIDdo2 = -1;
1826 Int_t absIDdo2lr = -1;
1830 if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
1831 if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
1833 absIDlr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
1836 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
1838 absIDup =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1839 absIDuplr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
1844 absIDdo =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1845 absIDdolr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
1849 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
1851 absIDup2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
1852 absIDup2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
1857 absIDdo2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
1858 absIDdo2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
1862 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
1863 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
1864 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
1865 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
1879 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" 1880 "\t up2 %d (%d), down2 %d (%d), up2-lr %d (%d), down2-lr %d (%d)",
1881 absIDup ,okup ,absIDdo ,okdo ,absIDlr,oklr,absIDuplr ,okuplr ,absIDdolr ,okdolr ,
1882 absIDup2,okup2,absIDdo2,okdo2, absIDup2lr,okup2lr,absIDdo2lr,okdo2lr));
1892 AliDebug(1,Form(
"Fraction for SM %d (min %2.3f, max %2.3f):\n" 1893 "\t up-down : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1894 "\t up-down-lr: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1895 "\t left-right: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 1896 "\t 2nd row : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f",
1920 AliDebug(1,Form(
"Randomized fraction: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1921 fracupdown,fracupdownleri,fracleri,frac2nd));
1930 AliDebug(1,Form(
"Induced energy: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1931 indEupdown,indEupdownleri,indEleri,indE2nd));
1939 AliDebug(1,Form(
"Induced energy, saturated?: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
1940 indEupdown,indEupdownleri,indEleri,indE2nd));
2031 AliInfo(Form(
"Geometry: name <%s>, matrix set <%d>, load matrix <%d>, import geo <%d> from path <%s>",
2040 AliInfo(Form(
"Just Unfold clusters <%d>, new clusters list name <%s>, new cells name <%s>",
2045 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>",
2048 AliInfo(Form(
"Reject events out of range: %d < N event < %d, LED <%d>, exotics <%d>",
2052 AliInfo(Form(
"Centrality bin [%2.2f,%2.2f], class <%s>, use AliCentrality? <%d>",
2058 AliInfo(Form(
"MC label from cluster <%d>, Use EdepFrac <%d>, remap AODs <%d>",
2069 AliInfo(
"T-Card emulation not activated");
2073 AliInfo(Form(
"T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:",
2076 AliInfo(Form(
"T-Card emulation super-modules fraction: Min cell E %2.2f Max induced E %2.2f",
2079 for(
Int_t ism = 0; ism < 22; ism++)
2081 printf(
"\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
2084 for(
Int_t icell = 0; icell < 4; icell++)
2086 printf(
"\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
2103 AliEMCALRecPoint *recPoint = (AliEMCALRecPoint*)
fClusterArr->At(i);
2105 const Int_t ncells = recPoint->GetMultiplicity();
2106 Int_t ncellsTrue = 0;
2108 if(recPoint->GetEnergy() <
fRecParam->GetClusteringThreshold())
continue;
2112 Double32_t ratios[ncells];
2115 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2120 AliEMCALDigit *digit = (AliEMCALDigit*)
fDigitsArr->At(recPoint->GetDigitsList()[
c]);
2122 absIds[ncellsTrue] = digit->GetId();
2123 ratios[ncellsTrue] = recPoint->GetEnergiesList()[
c]/digit->GetAmplitude();
2125 if ( !
fRecParam->GetUnfold() && (ratios[ncellsTrue] > 1 || ratios[ncellsTrue] < 1) )
2126 AliWarning(Form(
"recpoint cell E %2.3f but digit E %2.3f and no unfolding", recPoint->GetEnergiesList()[
c], digit->GetAmplitude()));
2134 AliDebug(2,Form(
"Too small energy in cell of cluster: cluster cell %f, digit %f",
2135 recPoint->GetEnergiesList()[
c],digit->GetAmplitude()));
2141 clusterE +=recPoint->GetEnergiesList()[
c];
2144 if (aodIH && aodIH->GetMergeEvents())
2147 AliVCaloCells* meEMCALCells = aodIH->GetEventToMerge()->GetEMCALCells();
2148 AliVCaloCells* ouEMCALCells = AODEvent()->GetEMCALCells();
2150 Float_t sigAmplitude = meEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2152 Float_t sumAmplitude = ouEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2155 if(sumAmplitude > 0) ratios[ncellsTrue] = sigAmplitude/sumAmplitude;
2166 AliDebug(2,Form(
"Skipping cluster with no cells avobe threshold E = %f, ncells %d",
2167 recPoint->GetEnergy(), ncells));
2173 if(clusterE < fRecParam->GetClusteringThreshold())
2175 AliDebug(2,Form(
"Remove cluster with energy below seed threshold %f",clusterE));
2185 recPoint->GetGlobalPosition(gpos);
2190 (*fCaloClusterArr)[j] =
new AliAODCaloCluster() ;
2191 AliAODCaloCluster *clus =
dynamic_cast<AliAODCaloCluster *
>(
fCaloClusterArr->At(j) ) ;
2193 clus->SetType(AliVCluster::kEMCALClusterv1);
2194 clus->SetE(clusterE);
2195 clus->SetPosition(g);
2196 clus->SetNCells(ncellsTrue);
2197 clus->SetCellsAbsId(absIds);
2198 clus->SetCellsAmplitudeFraction(ratios);
2200 clus->SetTOF(recPoint->GetTime()) ;
2201 clus->SetNExMax(recPoint->GetNExMax());
2202 clus->SetDistanceToBadChannel(recPoint->GetDistanceToBadTower());
2204 if(ncells == ncellsTrue)
2207 recPoint->GetElipsAxis(elipAxis);
2208 clus->SetM02(elipAxis[0]*elipAxis[0]) ;
2209 clus->SetM20(elipAxis[1]*elipAxis[1]) ;
2210 clus->SetDispersion(recPoint->GetDispersion());
2216 AliDebug(2,Form(
"Cells removed from cluster (ncells %d, ncellsTrue %d), recalculate Shower Shape",ncells,ncellsTrue));
2218 AliVCaloCells* cells = 0x0;
2219 if (aodIH && aodIH->GetMergeEvents()) cells = AODEvent() ->GetEMCALCells();
2220 else cells = InputEvent()->GetEMCALCells();
2236 Int_t parentMult = 0;
2237 Int_t *parentList = recPoint->GetParents(parentMult);
2238 Float_t *parentListDE = recPoint->GetParentsDE();
2240 clus->SetLabel(parentList, parentMult);
2242 clus->SetClusterMCEdepFractionFromEdepArray(parentListDE);
2256 for(
Int_t icell = 0; icell < ncellsTrue ; icell++)
2260 const AliEMCALDigit * dig = (
const AliEMCALDigit*)
fDigitsArr->At(idigit);
2265 mcEdepFracPerCell[icell] = 0;
2267 Int_t nparents = dig->GetNiparent();
2270 Int_t digLabel =-1 ;
2273 Float_t mcEDepFrac[4] = {0,0,0,0};
2276 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2278 digLabel = dig->GetIparent (jndex+1);
2279 edep = dig->GetDEParent(jndex+1);
2282 if ( digLabel == parentList[0] ) mcEDepFrac[0] = edep;
2283 else if ( digLabel == parentList[1] ) mcEDepFrac[1] = edep;
2284 else if ( digLabel == parentList[2] ) mcEDepFrac[2] = edep;
2285 else if ( digLabel == parentList[3] ) mcEDepFrac[3] = edep;
2292 mcEdepFracPerCell[icell] = clus->PackMCEdepFraction(mcEDepFrac);
2297 clus->SetCellsMCEdepFractionMap(mcEdepFracPerCell);
2299 delete [] mcEdepFracPerCell;
2312 if(label < 0) return ;
2317 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(evt->FindListObject(
"mcparticles")) ;
2320 if(label < arr->GetEntriesFast())
2322 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(label));
2323 if(!particle) return ;
2325 if(label == particle->Label())
return ;
2331 for(
Int_t ind = 0; ind < arr->GetEntriesFast(); ind++ )
2333 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(ind));
2334 if(!particle) continue ;
2336 if(label == particle->Label())
2374 AliAODCaloCluster * clus)
2376 Int_t parentMult = 0;
2377 Int_t *parentList = recPoint->GetParents(parentMult);
2378 clus->SetLabel(parentList, parentMult);
2382 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2385 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2389 for (
UInt_t iLoopLabels = 0 ; iLoopLabels < clus->GetNLabels() ; iLoopLabels++ )
2392 if (
fCellSecondLabels[idCell] == clus->GetLabelAt(iLoopLabels) ) iNewLabel = 0;
2396 Int_t * newLabelArray =
new Int_t[clus->GetNLabels()+1] ;
2397 for (
UInt_t iLoopNewLabels = 0 ; iLoopNewLabels < clus->GetNLabels() ; iLoopNewLabels++ )
2399 newLabelArray[iLoopNewLabels] = clus->GetLabelAt(iLoopNewLabels) ;
2403 clus->SetLabel(newLabelArray,clus->GetNLabels()+1) ;
2404 delete [] newLabelArray;
2420 Int_t nLabTotOrg = 0;
2424 AliVEvent *
event =
fEvent;
2427 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2428 if(aodIH && aodIH->GetEventToMerge())
2429 event = aodIH->GetEventToMerge();
2433 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2435 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2442 for(
Int_t icl =0; icl < nClu; icl++)
2444 if(((
Int_t)clArray.GetAt(icl))==-1 )
continue;
2445 if( idCluster == ((
Int_t)clArray.GetAt(icl)) )
set = kFALSE;
2449 if(
set && idCluster >= 0)
2451 clArray.SetAt(idCluster,nClu++);
2453 nLabTotOrg+=(
event->GetCaloCluster(idCluster))->GetNLabels();
2458 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2460 if(emax < clOrg->E())
2469 if(nClu==0 || nLabTotOrg == 0)
2477 if(idMax != ((
Int_t)clArray.GetAt(0)))
2479 Int_t maxIndex = -1;
2480 Int_t firstCluster = ((
Int_t)clArray.GetAt(0));
2481 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2483 if(idMax == ((
Int_t)clArray.GetAt(iLoopCluster))) maxIndex = iLoopCluster;
2486 if(firstCluster >=0 && idMax >=0)
2488 clArray.SetAt(idMax,0);
2489 clArray.SetAt(firstCluster,maxIndex);
2494 TArrayI clMCArray(nLabTotOrg) ;
2498 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2500 Int_t idCluster = (
Int_t) clArray.GetAt(iLoopCluster);
2502 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2503 Int_t nLab = clOrg->GetNLabels();
2505 for (
Int_t iLab = 0 ; iLab < nLab ; iLab++ )
2507 Int_t lab = clOrg->GetLabelAt(iLab) ;
2512 for(
Int_t iLabTot =0; iLabTot < nLabTot; iLabTot++)
2514 if( lab == ((
Int_t)clMCArray.GetAt(iLabTot)) )
set = kFALSE;
2518 if(
set ) clMCArray.SetAt(lab,nLabTot++);
2525 clus->SetLabel(clMCArray.GetArray(), nLabTot);
2550 AliInfo(
"Cluster branch name not set, set it to newEMCALClustersArray");
2596 else if ( ncells != ndigis )
2602 for (
Int_t idigit = 0; idigit < ndigis; ++idigit)
2604 AliEMCALDigit *digit =
static_cast<AliEMCALDigit*
>(
fDigitsArr->At(idigit));
2606 Double_t cellAmplitude = digit->GetAmplitude();
2607 Short_t cellNumber = digit->GetId();
2608 Double_t cellTime = digit->GetTime();
2610 Bool_t highGain = kFALSE;
2611 if( digit->GetType() == AliEMCALDigit::kHG ) highGain = kTRUE;
2616 Int_t nparents = digit->GetNiparent();
2617 Int_t cellMcEDepFrac =-1 ;
2621 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2623 if(cellMcEDepFrac >= digit->GetDEParent(jndex+1))
continue ;
2625 cellMcLabel = digit->GetIparent (jndex+1);
2626 cellMcEDepFrac= digit->GetDEParent(jndex+1);
2630 if ( cellMcEDepFrac < 0 ) cellMcEDepFrac = 0.;
2633 fCaloCells ->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2635 fOutputAODCells->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2638 if ( ncells != ndigis )
2685 fRun = InputEvent()->GetRunNumber();
2689 AliInfo(Form(
"Set run to %d",
fRun));
2699 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
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)
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
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow) 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 SwitchOffL1PhaseInTimeRecalibration()
void PrintParam()
Print clusterization task parameters.
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)...
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.