-
- new((*fDigitsArr)[idigit]) AliEMCALDigit( mcLabel, mcLabel, id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, 1);
+
+ Float_t efrac = cells->GetEFraction(icell);
+
+ //When checking the MC of digits, give weight to cells with embedded signal
+ if (mcLabel > 0 && efrac < 1.e-6) efrac = 1;
+
+ //printf("******* Cell %d, id %d, e %f, fraction %f, MC label %d, used MC label %d\n",icell,id,amp,cells->GetEFraction(icell),cells->GetMCLabel(icell),mcLabel);
+
+ new((*fDigitsArr)[idigit]) AliEMCALDigit( mcLabel, mcLabel, id, amp, time,AliEMCALDigit::kHG,idigit, 0, 0, amp*efrac);
+ // Last parameter should be MC deposited energy, since it is not available, add just the cell amplitude so that
+ // we give more weight to the MC label of the cell with highest energy in the cluster