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), fTCardCorrMinInduced(0)
100 , fTCardCorrMaxInducedLowE(0), fTCardCorrMaxInduced(100)
104 for(
Int_t i = 0; i < 22; i++)
111 for(
Int_t j = 0; j < 4 ; j++)
168 for(
Int_t i = 0; i < 22; i++)
175 for(
Int_t j = 0; j < 4 ; j++)
229 if ( absID < 0 || absID >= 24*48*
fGeom->GetNumberOfSuperModules() )
232 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status = 0;
233 if (!
fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
239 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
260 Int_t nCluster =
fEvent -> GetNumberOfCaloClusters();
263 for(
Int_t icalo = 0; icalo < nCluster; icalo++)
265 AliVCluster *clus = (AliVCluster*) (
fEvent->GetCaloCluster(icalo));
271 AliDebug(1, Form(
"Accept : E %2.2f > %2.2f, nCells %d > %d",
279 AliDebug(1,
"Reject");
295 AliInfo(Form(
"Get AODB parameters from EMCAL in %s for run %d, and <%s>",
fOADBFilePath.Data(),
fRun,pass.Data()));
302 AliOADBContainer *contBC=
new AliOADBContainer(
"");
304 contBC->InitFromFile(Form(
"%s/EMCALBadChannels.root",
fOADBFilePath.Data()),
"AliEMCALBadChannels");
306 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALBadChannels.root").data(),
"AliEMCALBadChannels");
313 AliInfo(
"Remove EMCAL bad cells");
315 for (
Int_t i=0; i < nSM; ++i)
322 hbm=(TH2I*)arrayBC->FindObject(Form(
"EMCALBadChannelMap_Mod%d",i));
326 AliError(Form(
"Can not get EMCALBadChannelMap_Mod%d",i));
330 hbm->SetDirectory(0);
334 }
else AliInfo(
"Do NOT remove EMCAL bad channels");
342 AliOADBContainer *contRF=
new AliOADBContainer(
"");
345 contRF->InitFromFile(Form(
"%s/EMCALRecalib.root",
fOADBFilePath.Data()),
"AliEMCALRecalib");
347 contRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALRecalib.root").data(),
"AliEMCALRecalib");
361 AliInfo(
"Recalibrate EMCAL");
362 for (
Int_t i=0; i<nSM; ++i)
369 h = (
TH2F*)recalib->FindObject(Form(
"EMCALRecalFactors_SM%d",i));
373 AliError(Form(
"Could not load EMCALRecalFactors_SM%d",i));
381 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params object array");
382 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for pass");
383 }
else AliInfo(
"Do NOT recalibrate EMCAL, no params for run");
391 AliInfo(Form(
"Switch off Temperature corrections for Run %d (remember to remove when Run2 T corrections available!)",
fRun));
397 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
400 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
402 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
404 TH1S *htd=(TH1S*)contRFTD->GetObject(
fRun);
409 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",
fRun));
413 Int_t maxEntry = contRFTD->GetNumberOfEntries();
415 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) <
fRun) ) {
420 Int_t closest = lower;
421 if ( (ic<maxEntry) &&
422 (contRFTD->LowerLimit(ic)-
fRun) < (
fRun - contRFTD->UpperLimit(lower)) ) {
426 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d", closest, contRFTD->LowerLimit(closest)));
427 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
432 AliInfo(
"Recalibrate (Temperature) EMCAL");
434 for (
Int_t ism=0; ism<nSM; ++ism)
436 for (
Int_t icol=0; icol<48; ++icol)
438 for (
Int_t irow=0; irow<24; ++irow)
442 Int_t absID =
fGeom->GetAbsCellIdFromCellIndexes(ism, irow, icol);
443 factor *= htd->GetBinContent(absID) / 10000. ;
450 }
else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
458 AliOADBContainer *contTRF=
new AliOADBContainer(
"");
461 contTRF->InitFromFile(Form(
"%s/EMCALTimeCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeCalib");
463 contTRF->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeCalib.root").data(),
"AliEMCALTimeCalib");
471 if ( pass==
"spc_calo" ) passM =
"pass3";
472 if (
fRun > 209121 ) passM =
"pass1";
473 if ( pass ==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
480 AliInfo(
"Time Recalibrate EMCAL");
481 for (
Int_t ibc = 0; ibc < 4; ++ibc)
488 h = (TH1F*)trecalpass->FindObject(Form(
"hAllTimeAvBC%d",ibc));
492 AliError(Form(
"Could not load hAllTimeAvBC%d",ibc));
500 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for pass");
501 }
else AliInfo(
"Do NOT recalibrate time EMCAL, no params for run");
513 AliOADBContainer *contBC =
new AliOADBContainer(
"");
517 timeFile =
new TFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"read");
519 timeFile =
new TFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"read");
521 if (!timeFile || timeFile->IsZombie())
523 AliFatal(Form(
"EMCALTimeL1PhaseCalib.root was not found in the path provided: %s",
fOADBFilePath.Data()));
527 if (timeFile)
delete timeFile;
530 contBC->InitFromFile(Form(
"%s/EMCALTimeL1PhaseCalib.root",
fOADBFilePath.Data()),
"AliEMCALTimeL1PhaseCalib");
532 contBC->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTimeL1PhaseCalib.root").data(),
"AliEMCALTimeL1PhaseCalib");
537 AliError(Form(
"No external L1 phase in time calibration set for run number: %d",
fRun));
545 if ( pass==
"muon_calo_pass1" &&
fRun > 209121 &&
fRun < 244284 )
551 AliError(Form(
"No external L1 phase in time calibration set for: %d -%s",
fRun,pass2.Data()));
554 else AliInfo(
"Recalibrate L1 Phase time");
558 if ( DebugLevel()>0 ) arrayBCpass->Print();
563 h = (TH1C*)arrayBCpass->FindObject(Form(
"h%d",
fRun));
567 AliFatal(Form(
"There is no calibration histogram h%d for this run",
fRun));
594 AliCDBManager *cdb = AliCDBManager::Instance();
598 cdb->SetDefaultStorage(
fOCDBpath.Data());
599 AliInfo(Form(
"Default storage %s",
fOCDBpath.Data()));
608 cdb->SetSpecificStorage(
"EMCAL/Calib/Data",
"raw://");
609 cdb->SetSpecificStorage(
"EMCAL/Calib/Time",
"raw://");
610 cdb->SetSpecificStorage(
"EMCAL/Calib/Pedestals",
"raw://");
613 TString path = cdb->GetDefaultStorage()->GetBaseFolder();
650 new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j,
fTCardCorrCellsEner[j], fixTime,AliEMCALDigit::kHG,idigit, 0, 0, 0);
669 Int_t eventN = Entry();
671 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
> 672 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
675 if ( eventN <= 0 && aodIH)
676 eventN = aodIH->GetReadEntry();
686 if (aodIH && aodIH->GetMergeEvents())
690 if(!aodIH->GetMergeEMCALCells())
691 AliFatal(
"Events merged but not EMCAL cells, check analysis settings!");
693 AliDebug(1,
"Use embedded events");
695 AliDebug(1,Form(
"\t InputEvent N Clusters %d, N Cells %d",
696 InputEvent()->GetNumberOfCaloClusters(),InputEvent()->GetEMCALCells()->GetNumberOfCells()));
698 AliDebug(1,Form(
"\t MergedEvent N Clusters %d, N Cells %d",
699 aodIH->GetEventToMerge()->GetNumberOfCaloClusters(), aodIH->GetEventToMerge()->GetEMCALCells()->GetNumberOfCells()));
710 AliDebug(1,Form(
"\t OutputEvent N Clusters %d, N Cells %d",
711 AODEvent()->GetNumberOfCaloClusters(), AODEvent()->GetEMCALCells()->GetNumberOfCells()));
727 AliError(
"Event not available");
762 AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
788 Int_t nClusters =
fEvent->GetNumberOfCaloClusters();
789 Int_t nClustersOrg = 0;
791 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
792 if(aodIH && aodIH->GetEventToMerge())
793 nClusters = aodIH->GetEventToMerge()->GetNumberOfCaloClusters();
802 for (
Int_t i = 0; i < nClusters; i++)
804 AliVCluster *clus = 0;
805 if(aodIH && aodIH->GetEventToMerge())
806 clus = aodIH->GetEventToMerge()->GetCaloCluster(i);
808 clus =
fEvent->GetCaloCluster(i);
810 if ( !clus )
continue;
812 if ( !clus || !clus->IsEMCAL() )
continue;
816 Int_t label = clus->GetLabel();
818 if (clus->GetNLabels() >=2 ) label2 = clus->GetLabelAt(1) ;
820 AliDebug(2, Form(
"recover original cluster %d info: Id %d, E %2.3f, N cells %d, TOF %3.2f, N labels %d, label %d;",
821 i,clus->GetID(), clus->E(),clus->GetNCells(),clus->GetTOF()*1e9, clus->GetNLabels(), label) );
825 for(
Int_t imc = 0; imc < clus->GetNLabels(); imc++)
827 printf(
"\t mc %d) Label %d, E dep frac %1.3f; ",
828 imc, clus->GetLabelAt(imc),clus->GetClusterMCEdepFraction(imc));
833 UShort_t * index = clus->GetCellsAbsId() ;
834 for(
Int_t icell=0; icell < clus->GetNCells(); icell++ )
837 fCellTime[index[icell]] = clus->GetTOF();
847 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",
853 AliDebug(2, Form(
"N original cluster %d",nClustersOrg) );
867 Int_t bc = InputEvent()->GetBunchCrossNumber();
898 AliDebug(2,Form(
"Remove channel absId %d, index %d of %d, amp %f, time %f",
899 id,icell,
fCaloCells->GetNumberOfCells(), amp, time*1.e9));
937 if (mcLabel > 0 && efrac < 1.e-6) efrac = 1;
949 AliVCluster *clus = 0;
952 AliDebug(1, Form(
"EdepFrac use for : absId %d, idigit %d, iclus %d, amp %2.3f",
id,idigit,iclus,amp) );
954 if(aodIH && aodIH->GetEventToMerge())
955 clus = aodIH->GetEventToMerge()->GetCaloCluster(iclus);
957 clus =
fEvent->GetCaloCluster(iclus);
960 nLabels = labeArr.GetSize();
962 AliDebug(1, Form(
"N labels after EdepFrac info use: %d, amp %2.3f (check changes)",nLabels,amp) );
977 if(amp <= 0.01) continue ;
979 AliDebug(5,Form(
"*** Add digit *** digit %d, AbsId %d, amp %2.3f, time %3.2f, nlabels %d, label %d",
980 idigit,
id, amp, time*1.e9,nLabels,mcLabel));
982 AliEMCALDigit* digit =
new((*fDigitsArr)[idigit])
983 AliEMCALDigit( mcLabel, mcLabel,
id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, eDep);
986 digit->SetListOfParents(nLabels,labeArr.GetArray(),eDepArr.GetArray());
1012 AliWarning(Form(
"No array with CaloClusters, input RecPoints entries %d",
fClusterArr->GetEntriesFast()));
1016 AliDebug(1,Form(
"N clusters: before recluster %d, after recluster %d, recpoints %d",
1036 Int_t cellMCLabel = 0;
1038 Int_t nClustersOrg = 0;
1041 for (
Int_t i = 0; i <
fEvent->GetNumberOfCaloClusters(); i++)
1043 AliVCluster *clus =
fEvent->GetCaloCluster(i);
1058 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1060 if (
fCaloCells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
1063 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1, status = 0;
1064 fGeom->GetCellIndex(cellNumber,imod,iTower,iIphi,iIeta);
1065 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1078 AliESDCaloCluster * esdCluster =
dynamic_cast<AliESDCaloCluster*
> (clus);
1079 AliAODCaloCluster * aodCluster =
dynamic_cast<AliAODCaloCluster*
> (clus);
1090 AliWarning(
"Wrong CaloCluster type?");
1121 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - **** Start ***\n");
1130 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Remove exotics in EMCAL\n");
1141 if(bRecalE && ! bMC)
1143 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on energy recalibration in EMCAL\n");
1152 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on bad channels removal in EMCAL\n");
1159 if(bRecalT && ! bMC)
1161 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() - Switch on time recalibration in EMCAL\n");
1176 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kBeamTestCorrected xxx\n");
1181 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx SET Non linearity correction kPi0MCv3 xxx\n");
1187 if ( debug > 0 ) printf(
"ConfigureEMCALRecoUtils() xxx DON'T SET Non linearity correction xxx\n");
1198 AliVCaloCells &eventEMcells = *(
fEvent->GetEMCALCells());
1199 Int_t nEMcell = eventEMcells.GetNumberOfCells() ;
1201 AliAODCaloCells &aodEMcells = *(AODEvent()->GetEMCALCells());
1202 aodEMcells.CreateContainer(nEMcell);
1203 aodEMcells.SetType(AliVCaloCells::kEMCALCell);
1206 for (
Int_t iCell = 0; iCell < nEMcell; iCell++)
1208 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1209 fGeom->GetCellIndex(eventEMcells.GetCellNumber(iCell),imod,iTower,iIphi,iIeta);
1210 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1220 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),eventEMcells.GetAmplitude(iCell)*calibFactor,
1221 eventEMcells.GetTime(iCell),eventEMcells.GetMCLabel(iCell),eventEMcells.GetEFraction(iCell));
1225 aodEMcells.SetCell(iCell,eventEMcells.GetCellNumber(iCell),0,-1,-1,0);
1242 for (
Int_t i = 0; i < 6; i++) covVtx[i] = 0.;
1244 AliAODHeader* header =
dynamic_cast<AliAODHeader*
>(AODEvent()->GetHeader());
1245 if(!header) AliFatal(
"Not a standard AOD");
1246 header->SetRunNumber(
fRun);
1250 TTree* tree = fInputHandler->GetTree();
1253 TFile*
file = tree->GetCurrentFile();
1254 if (file) header->SetESDFileName(file->GetName());
1257 else if (aodevent) {
1258 AliAODHeader * aodheader =
dynamic_cast<AliAODHeader*
>(aodevent->GetHeader());
1259 if(!aodheader) AliFatal(
"Not a standard AOD");
1260 header->SetESDFileName(aodheader->GetESDFileName());
1263 header->SetBunchCrossNumber(
fEvent->GetBunchCrossNumber());
1264 header->SetOrbitNumber(
fEvent->GetOrbitNumber());
1265 header->SetPeriodNumber(
fEvent->GetPeriodNumber());
1266 header->SetEventType(
fEvent->GetEventType());
1271 if(
fEvent->GetCentrality())
1272 header->SetCentrality(
new AliCentrality(*(
fEvent->GetCentrality())));
1274 header->SetCentrality(0);
1278 header->SetOfflineTrigger(fInputHandler->IsEventSelected());
1280 header->SetFiredTriggerClasses(
fEvent->GetFiredTriggerClasses());
1282 header->SetTriggerMask(
fEvent->GetTriggerMask());
1283 header->SetTriggerCluster(
fEvent->GetTriggerCluster());
1287 header->SetL0TriggerInputs(esdevent->GetHeader()->GetL0TriggerInputs());
1288 header->SetL1TriggerInputs(esdevent->GetHeader()->GetL1TriggerInputs());
1289 header->SetL2TriggerInputs(esdevent->GetHeader()->GetL2TriggerInputs());
1293 header->SetL0TriggerInputs(aodevent->GetHeader()->GetL0TriggerInputs());
1294 header->SetL1TriggerInputs(aodevent->GetHeader()->GetL1TriggerInputs());
1295 header->SetL2TriggerInputs(aodevent->GetHeader()->GetL2TriggerInputs());
1298 header->SetMagneticField(
fEvent->GetMagneticField());
1301 header->SetZDCN1Energy(
fEvent->GetZDCN1Energy());
1302 header->SetZDCP1Energy(
fEvent->GetZDCP1Energy());
1303 header->SetZDCN2Energy(
fEvent->GetZDCN2Energy());
1304 header->SetZDCP2Energy(
fEvent->GetZDCP2Energy());
1305 header->SetZDCEMEnergy(
fEvent->GetZDCEMEnergy(0),
fEvent->GetZDCEMEnergy(1));
1309 fEvent->GetDiamondCovXY(diamcov);
1310 header->SetDiamond(diamxy,diamcov);
1311 if (esdevent) header->SetDiamondZ(esdevent->GetDiamondZ(),esdevent->GetSigma2DiamondZ());
1312 else if (aodevent) header->SetDiamondZ(aodevent->GetDiamondZ(),aodevent->GetSigma2DiamondZ());
1315 Int_t nVertices = 1 ;;
1316 Int_t nCaloClus =
fEvent->GetNumberOfCaloClusters();
1318 AODEvent()->ResetStd(0, nVertices, 0, 0, 0, nCaloClus, 0, 0);
1321 TClonesArray &vertices = *(AODEvent()->GetVertices());
1326 fEvent->GetPrimaryVertex()->GetXYZ(pos);
1330 esdevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1331 chi = esdevent->GetPrimaryVertex()->GetChi2toNDF();
1335 aodevent->GetPrimaryVertex()->GetCovMatrix(covVtx);
1336 chi = aodevent->GetPrimaryVertex()->GetChi2perNDF();
1339 AliAODVertex * primary =
new(vertices[jVertices++])
1341 primary->SetName(
fEvent->GetPrimaryVertex()->GetName());
1342 primary->SetTitle(
fEvent->GetPrimaryVertex()->GetTitle());
1362 for(
Int_t i = 0; i < kNumberOfCaloClusters; i++)
1364 AliAODCaloCluster *newCluster = (AliAODCaloCluster *)
fCaloClusterArr->At(i);
1366 newCluster->SetID(i);
1377 newCluster->AddTrackMatched(
fEvent->GetTrack(trackIndex));
1378 AliDebug(2,Form(
"Matched Track index %d to new cluster %d",trackIndex,i));
1383 newCluster->SetTrackDistance(dR,dZ);
1387 Int_t absId0 = newCluster->GetCellsAbsId()[0];
1406 new((*fOutputAODBranch)[i]) AliAODCaloCluster(*newCluster);
1408 AliDebug(2,Form(
"New cluster %d of %d, energy %f, mc label %d",
1409 newCluster->GetID(), kNumberOfCaloClusters, newCluster->E(), newCluster->GetLabel()));
1441 if (!AliAnalysisManager::GetAnalysisManager()->GetTree())
1443 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Pointer to tree = 0, returning null");
1447 if (!AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile())
1449 AliError(
"AliAnalysisTaskEMCALClusterize::GetPass() - Null pointer input file, returning null");
1453 TString pass(AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile()->GetName());
1454 if (pass.Contains(
"ass1"))
return TString(
"pass1");
1455 else if (pass.Contains(
"ass2"))
return TString(
"pass2");
1456 else if (pass.Contains(
"ass3"))
return TString(
"pass3");
1457 else if (pass.Contains(
"ass4"))
return TString(
"pass4");
1458 else if (pass.Contains(
"ass5"))
return TString(
"pass5");
1459 else if (pass.Contains(
"LHC11c") && pass.Contains(
"spc_calo") )
return TString(
"spc_calo");
1460 else if (pass.Contains(
"calo") || pass.Contains(
"high_lumi"))
1462 AliInfo(
"Path contains <calo> or <high-lumi>, set as <pass1>");
1465 else if (pass.Contains(
"LHC14a1a"))
1467 AliInfo(
"Enable EMCal energy calibration for this MC production!!");
1475 AliInfo(
"Pass number string not found");
1486 if(fDebug >=0) (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fDebug);
1490 fBranchNames =
"ESD:AliESDHeader.,EMCALCells.";
1508 AliInfo(Form(
"Configure analysis with %s",
fConfigName.Data()));
1548 if (
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv1)
1550 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerv2)
1552 else if(
fRecParam->GetClusterizerFlag() == AliEMCALRecParam::kClusterizerNxN)
1560 AliFatal(Form(
"Clusterizer < %d > not available",
fRecParam->GetClusterizerFlag()));
1585 for (i = 0; i < 8; i++)
1590 for (i = 0; i < 3; i++)
1615 fGeom = AliEMCALGeometry::GetInstanceFromRunNumber(
fRun);
1616 AliInfo(Form(
"Get EMCAL geometry name <%s> for run %d",
fGeom->GetName(),
fRun));
1621 AliInfo(Form(
"Set EMCAL geometry name to <%s>",
fGeomName.Data()));
1641 AliDebug(1,Form(
"Init for run=%d",
fRun));
1642 if (!gGeoManager) AliDebug(1,
"Careful!, gGeoManager not loaded, load misalign matrices");
1647 AliInfo(
"Load user defined EMCAL geometry matrices");
1650 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
1652 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
1654 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
1658 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1663 AliDebug(2,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
1666 fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
1671 if(DebugLevel() > 1)
1676 else if(gGeoManager)
1678 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
1679 fGeom->SetMisalMatrix(
fGeom->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
1683 AliError(Form(
"Alignment atrix for SM %d is not available",mod));
1690 else if(!gGeoManager)
1692 AliInfo(
"Get geo matrices from data");
1694 if(!strcmp(
fEvent->GetName(),
"AliAODEvent"))
1696 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
1700 AliDebug(1,
"Load Misaligned matrices");
1706 AliError(
"This event does not contain ESDs?");
1707 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
1711 for(
Int_t mod=0; mod < (
fGeom->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
1713 if(DebugLevel() > 1)
1714 esd->GetEMCALMatrix(mod)->Print();
1716 if(esd->GetEMCALMatrix(mod))
fGeom->SetMisalMatrix(esd->GetEMCALMatrix(mod),mod) ;
1739 Int_t bc = InputEvent()->GetBunchCrossNumber();
1760 if(totCellE < 1)
return kTRUE;
1773 if(run < 146858 || run > 146860)
return kFALSE ;
1776 Int_t ncellsSM3 = 0;
1779 if (
fCaloCells->GetAmplitude (icell) > 0.1 &&
1780 fCaloCells->GetCellNumber(icell)/(24*48)==3 ) ncellsSM3++;
1785 Int_t ncellcut = 21;
1786 if(triggerclasses.Contains(
"EMC")) ncellcut = 35;
1788 if( ncellsSM3 >= ncellcut)
1790 AliInfo(Form(
"Reject event %d with ncells in SM3 %d",(
Int_t)Entry(),ncellsSM3));
1791 if(
fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
1821 AliDebug(1,Form(
"\t fraction %2.3f",frac));
1828 AliDebug(1,Form(
"\t randomized fraction %2.3f",frac));
1832 if ( frac < 0.0001 )
return;
1840 AliDebug(1,Form(
"\t induced E %2.3f",inducedE));
1871 for (
Int_t icell = 0; icell <
fCaloCells->GetNumberOfCells(); icell++)
1880 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
1881 fGeom->GetCellIndex(
id,imod,iTower,iIphi,iIeta);
1882 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1893 AliDebug(1,Form(
"Do not difuse E of cell %d, sm %d, amp %2.2f: SM fraction %2.2f > %2.2f",
1899 AliDebug(1,Form(
"Reference cell absId %d, iEta %d, iPhi %d, sm %d, amp %2.2f",
id,ieta,iphi,imod,amp));
1906 Int_t absIDuplr = -1;
1907 Int_t absIDdolr = -1;
1908 Int_t absIDup2 = -1;
1909 Int_t absIDup2lr = -1;
1910 Int_t absIDdo2 = -1;
1911 Int_t absIDdo2lr = -1;
1915 if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
1916 if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
1918 absIDlr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
1921 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
1923 absIDup =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1924 absIDuplr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
1929 absIDdo =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1930 absIDdolr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
1934 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
1936 absIDup2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
1937 absIDup2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
1942 absIDdo2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
1943 absIDdo2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
1947 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
1948 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
1949 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
1950 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
1954 AliDebug(1,Form(
"cell up %d:" ,absIDup));
1956 AliDebug(1,Form(
"cell down %d:",absIDdo));
1959 AliDebug(1,Form(
"cell up left-right %d:" ,absIDuplr));
1961 AliDebug(1,Form(
"cell down left-right %d:",absIDdolr));
1964 AliDebug(1,Form(
"cell left-right %d:",absIDlr));
1967 AliDebug(1,Form(
"cell up 2nd row %d:" ,absIDup2));
1969 AliDebug(1,Form(
"cell down 2nd row %d:",absIDdo2));
1972 AliDebug(1,Form(
"cell up left-right 2nd row %d:" ,absIDup2lr));
1974 AliDebug(1,Form(
"cell down left-right 2nd row %d:",absIDdo2lr));
1986 AliInfo(Form(
"Geometry: name <%s>, matrix set <%d>, load matrix <%d>, import geo <%d> from path <%s>",
1995 AliInfo(Form(
"Just Unfold clusters <%d>, new clusters list name <%s>, new cells name <%s>",
2000 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>",
2003 AliInfo(Form(
"Reject events out of range: %d < N event < %d, LED <%d>, exotics <%d>",
2007 AliInfo(Form(
"Centrality bin [%2.2f,%2.2f], class <%s>, use AliCentrality? <%d>",
2013 AliInfo(Form(
"MC label from cluster <%d>, Use EdepFrac <%d>, remap AODs <%d>",
2024 AliInfo(
"T-Card emulation not activated");
2028 AliInfo(Form(
"T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:",
2031 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",
2034 for(
Int_t ism = 0; ism < 22; ism++)
2036 printf(
"\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
2039 for(
Int_t icell = 0; icell < 4; icell++)
2041 printf(
"\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
2058 AliEMCALRecPoint *recPoint = (AliEMCALRecPoint*)
fClusterArr->At(i);
2060 const Int_t ncells = recPoint->GetMultiplicity();
2061 Int_t ncellsTrue = 0;
2063 if(recPoint->GetEnergy() <
fRecParam->GetClusteringThreshold())
continue;
2067 Double32_t ratios[ncells];
2070 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2075 AliEMCALDigit *digit = (AliEMCALDigit*)
fDigitsArr->At(recPoint->GetDigitsList()[
c]);
2077 absIds[ncellsTrue] = digit->GetId();
2078 ratios[ncellsTrue] = recPoint->GetEnergiesList()[
c]/digit->GetAmplitude();
2080 if ( !
fRecParam->GetUnfold() && (ratios[ncellsTrue] > 1 || ratios[ncellsTrue] < 1) )
2081 AliWarning(Form(
"recpoint cell E %2.3f but digit E %2.3f and no unfolding", recPoint->GetEnergiesList()[
c], digit->GetAmplitude()));
2089 AliDebug(2,Form(
"Too small energy in cell of cluster: cluster cell %f, digit %f",
2090 recPoint->GetEnergiesList()[
c],digit->GetAmplitude()));
2096 clusterE +=recPoint->GetEnergiesList()[
c];
2099 if (aodIH && aodIH->GetMergeEvents())
2102 AliVCaloCells* meEMCALCells = aodIH->GetEventToMerge()->GetEMCALCells();
2103 AliVCaloCells* ouEMCALCells = AODEvent()->GetEMCALCells();
2105 Float_t sigAmplitude = meEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2107 Float_t sumAmplitude = ouEMCALCells->GetCellAmplitude(absIds[ncellsTrue]);
2110 if(sumAmplitude > 0) ratios[ncellsTrue] = sigAmplitude/sumAmplitude;
2121 AliDebug(2,Form(
"Skipping cluster with no cells avobe threshold E = %f, ncells %d",
2122 recPoint->GetEnergy(), ncells));
2128 if(clusterE < fRecParam->GetClusteringThreshold())
2130 AliDebug(2,Form(
"Remove cluster with energy below seed threshold %f",clusterE));
2140 recPoint->GetGlobalPosition(gpos);
2145 (*fCaloClusterArr)[j] =
new AliAODCaloCluster() ;
2146 AliAODCaloCluster *clus =
dynamic_cast<AliAODCaloCluster *
>(
fCaloClusterArr->At(j) ) ;
2148 clus->SetType(AliVCluster::kEMCALClusterv1);
2149 clus->SetE(clusterE);
2150 clus->SetPosition(g);
2151 clus->SetNCells(ncellsTrue);
2152 clus->SetCellsAbsId(absIds);
2153 clus->SetCellsAmplitudeFraction(ratios);
2155 clus->SetTOF(recPoint->GetTime()) ;
2156 clus->SetNExMax(recPoint->GetNExMax());
2157 clus->SetDistanceToBadChannel(recPoint->GetDistanceToBadTower());
2159 if(ncells == ncellsTrue)
2162 recPoint->GetElipsAxis(elipAxis);
2163 clus->SetM02(elipAxis[0]*elipAxis[0]) ;
2164 clus->SetM20(elipAxis[1]*elipAxis[1]) ;
2165 clus->SetDispersion(recPoint->GetDispersion());
2171 AliDebug(2,Form(
"Cells removed from cluster (ncells %d, ncellsTrue %d), recalculate Shower Shape",ncells,ncellsTrue));
2173 AliVCaloCells* cells = 0x0;
2174 if (aodIH && aodIH->GetMergeEvents()) cells = AODEvent() ->GetEMCALCells();
2175 else cells = InputEvent()->GetEMCALCells();
2191 Int_t parentMult = 0;
2192 Int_t *parentList = recPoint->GetParents(parentMult);
2193 Float_t *parentListDE = recPoint->GetParentsDE();
2195 clus->SetLabel(parentList, parentMult);
2197 clus->SetClusterMCEdepFractionFromEdepArray(parentListDE);
2211 for(
Int_t icell = 0; icell < ncellsTrue ; icell++)
2215 const AliEMCALDigit * dig = (
const AliEMCALDigit*)
fDigitsArr->At(idigit);
2220 mcEdepFracPerCell[icell] = 0;
2222 Int_t nparents = dig->GetNiparent();
2225 Int_t digLabel =-1 ;
2228 Float_t mcEDepFrac[4] = {0,0,0,0};
2231 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2233 digLabel = dig->GetIparent (jndex+1);
2234 edep = dig->GetDEParent(jndex+1);
2237 if ( digLabel == parentList[0] ) mcEDepFrac[0] = edep;
2238 else if ( digLabel == parentList[1] ) mcEDepFrac[1] = edep;
2239 else if ( digLabel == parentList[2] ) mcEDepFrac[2] = edep;
2240 else if ( digLabel == parentList[3] ) mcEDepFrac[3] = edep;
2247 mcEdepFracPerCell[icell] = clus->PackMCEdepFraction(mcEDepFrac);
2252 clus->SetCellsMCEdepFractionMap(mcEdepFracPerCell);
2254 delete [] mcEdepFracPerCell;
2267 if(label < 0) return ;
2272 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(evt->FindListObject(
"mcparticles")) ;
2275 if(label < arr->GetEntriesFast())
2277 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(label));
2278 if(!particle) return ;
2280 if(label == particle->Label())
return ;
2286 for(
Int_t ind = 0; ind < arr->GetEntriesFast(); ind++ )
2288 AliAODMCParticle * particle =
dynamic_cast<AliAODMCParticle *
>(arr->At(ind));
2289 if(!particle) continue ;
2291 if(label == particle->Label())
2329 AliAODCaloCluster * clus)
2331 Int_t parentMult = 0;
2332 Int_t *parentList = recPoint->GetParents(parentMult);
2333 clus->SetLabel(parentList, parentMult);
2337 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2340 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2344 for (
UInt_t iLoopLabels = 0 ; iLoopLabels < clus->GetNLabels() ; iLoopLabels++ )
2347 if (
fCellSecondLabels[idCell] == clus->GetLabelAt(iLoopLabels) ) iNewLabel = 0;
2351 Int_t * newLabelArray =
new Int_t[clus->GetNLabels()+1] ;
2352 for (
UInt_t iLoopNewLabels = 0 ; iLoopNewLabels < clus->GetNLabels() ; iLoopNewLabels++ )
2354 newLabelArray[iLoopNewLabels] = clus->GetLabelAt(iLoopNewLabels) ;
2358 clus->SetLabel(newLabelArray,clus->GetNLabels()+1) ;
2359 delete [] newLabelArray;
2375 Int_t nLabTotOrg = 0;
2379 AliVEvent *
event =
fEvent;
2382 AliAODInputHandler* aodIH =
dynamic_cast<AliAODInputHandler*
>((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
2383 if(aodIH && aodIH->GetEventToMerge())
2384 event = aodIH->GetEventToMerge();
2388 for (
Int_t iLoopCell = 0 ; iLoopCell < clus->GetNCells() ; iLoopCell++ )
2390 Int_t idCell = clus->GetCellAbsId(iLoopCell) ;
2397 for(
Int_t icl =0; icl < nClu; icl++)
2399 if(((
Int_t)clArray.GetAt(icl))==-1 )
continue;
2400 if( idCluster == ((
Int_t)clArray.GetAt(icl)) )
set = kFALSE;
2404 if(
set && idCluster >= 0)
2406 clArray.SetAt(idCluster,nClu++);
2408 nLabTotOrg+=(
event->GetCaloCluster(idCluster))->GetNLabels();
2413 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2415 if(emax < clOrg->E())
2424 if(nClu==0 || nLabTotOrg == 0)
2432 if(idMax != ((
Int_t)clArray.GetAt(0)))
2434 Int_t maxIndex = -1;
2435 Int_t firstCluster = ((
Int_t)clArray.GetAt(0));
2436 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2438 if(idMax == ((
Int_t)clArray.GetAt(iLoopCluster))) maxIndex = iLoopCluster;
2441 if(firstCluster >=0 && idMax >=0)
2443 clArray.SetAt(idMax,0);
2444 clArray.SetAt(firstCluster,maxIndex);
2449 TArrayI clMCArray(nLabTotOrg) ;
2453 for (
Int_t iLoopCluster = 0 ; iLoopCluster < nClu ; iLoopCluster++ )
2455 Int_t idCluster = (
Int_t) clArray.GetAt(iLoopCluster);
2457 AliVCluster * clOrg =
event->GetCaloCluster(idCluster);
2458 Int_t nLab = clOrg->GetNLabels();
2460 for (
Int_t iLab = 0 ; iLab < nLab ; iLab++ )
2462 Int_t lab = clOrg->GetLabelAt(iLab) ;
2467 for(
Int_t iLabTot =0; iLabTot < nLabTot; iLabTot++)
2469 if( lab == ((
Int_t)clMCArray.GetAt(iLabTot)) )
set = kFALSE;
2473 if(
set ) clMCArray.SetAt(lab,nLabTot++);
2480 clus->SetLabel(clMCArray.GetArray(), nLabTot);
2505 AliInfo(
"Cluster branch name not set, set it to newEMCALClustersArray");
2551 else if ( ncells != ndigis )
2557 for (
Int_t idigit = 0; idigit < ndigis; ++idigit)
2559 AliEMCALDigit *digit =
static_cast<AliEMCALDigit*
>(
fDigitsArr->At(idigit));
2561 Double_t cellAmplitude = digit->GetAmplitude();
2562 Short_t cellNumber = digit->GetId();
2563 Double_t cellTime = digit->GetTime();
2565 Bool_t highGain = kFALSE;
2566 if( digit->GetType() == AliEMCALDigit::kHG ) highGain = kTRUE;
2571 Int_t nparents = digit->GetNiparent();
2572 Int_t cellMcEDepFrac =-1 ;
2576 for (
Int_t jndex = 0 ; jndex < nparents ; jndex++ )
2578 if(cellMcEDepFrac >= digit->GetDEParent(jndex+1))
continue ;
2580 cellMcLabel = digit->GetIparent (jndex+1);
2581 cellMcEDepFrac= digit->GetDEParent(jndex+1);
2585 if ( cellMcEDepFrac < 0 ) cellMcEDepFrac = 0.;
2588 fCaloCells ->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2590 fOutputAODCells->SetCell(idigit, cellNumber, cellAmplitude, cellTime, cellMcLabel, cellMcEDepFrac, highGain);
2593 if ( ncells != ndigis )
2640 fRun = InputEvent()->GetRunNumber();
2644 AliInfo(Form(
"Set run to %d",
fRun));
2654 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.