+ // Fill trigger hists
+ AliEMCALHistoUtilities::FillTriggersListOfHists(fList,&triggerPosition,&triggerAmplitudes);
+
+ //########################################
+ //##############Fill CaloCells###############
+ //########################################
+
+ TClonesArray *digits = new TClonesArray("AliEMCALDigit",1000);
+ TBranch *branchdig = digitsTree->GetBranch("EMCAL");
+ if (!branchdig) {
+ AliError("can't get the branch with the PHOS digits !");
+ return;
+ }
+ branchdig->SetAddress(&digits);
+ digitsTree->GetEvent(0);
+ Int_t nDigits = digits->GetEntries(), idignew = 0 ;
+ AliDebug(1,Form("%d digits",nDigits));
+
+ AliESDCaloCells &emcCells = *(esd->GetEMCALCells());
+ emcCells.CreateContainer(nDigits);
+ emcCells.SetType(AliESDCaloCells::kEMCALCell);
+ for (Int_t idig = 0 ; idig < nDigits ; idig++) {
+ const AliEMCALDigit * dig = (const AliEMCALDigit*)digits->At(idig);
+ if(dig->GetAmp() > 0 ){
+ emcCells.SetCell(idignew,dig->GetId(),dig->GetAmp(), dig->GetTime());
+ idignew++;
+ }
+ }
+ emcCells.SetNumberOfCells(idignew);
+ emcCells.Sort();
+
+ //------------------------------------------------------------
+ //-----------------CLUSTERS-----------------------------
+ //------------------------------------------------------------
+ TObjArray *clusters = new TObjArray(100);
+ TBranch *branch = clustersTree->GetBranch("EMCALECARP");
+ branch->SetAddress(&clusters);
+ clustersTree->GetEvent(0);
+
+ Int_t nClusters = clusters->GetEntries(), nClustersNew=0;
+ AliDebug(1,Form("%d clusters",nClusters));
+ esd->SetFirstEMCALCluster(esd->GetNumberOfCaloClusters()); // Put after Phos clusters
+
+