message: move array sort before addition of TCard induced cells; add a contant time value for the induced cells different from 0; add a check on the recpoin-digit energy
diff: @@ -545,6 +545,8 @@ void AliAnalysisTaskEMCALClusterize::AddNewTCardInducedCellsToDigit()
  // Get the number of stored digits, to assign the index of the new ones
  Int_t idigit = fDigitsArr->GetEntriesFast();
  + Double_t fixTime = 615.*1e-9;
  +
  for(Int_t j = 0; j < fgkNEMCalCells; j++)
  {
  // Newly created?
  @@ -563,7 +565,7 @@ void AliAnalysisTaskEMCALClusterize::AddNewTCardInducedCellsToDigit()
  // Now add the cell to the digits list
  //AliEMCALDigit* digit =
  - new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j, fTCardCorrCellsEner[j],0,AliEMCALDigit::kHG,idigit, 0, 0, 0);
  + new((*fDigitsArr)[idigit]) AliEMCALDigit( -2, -2, j, fTCardCorrCellsEner[j], fixTime,AliEMCALDigit::kHG,idigit, 0, 0, 0);
  //digit->SetListOfParents(0,0x0,0x0); // not needed
  @@ -872,9 +874,11 @@ void AliAnalysisTaskEMCALClusterize::ClusterizeCells()
  }
  + fDigitsArr->Sort();
  +
  + // Call after Sort, if not it screws up digits index order in clusterization
  if ( fTCardCorrEmulation ) AddNewTCardInducedCellsToDigit();
  - fDigitsArr->Sort();
  //-------------------------------------------------------------------------------------
  // Do the clusterization
  @@ -1766,6 +1770,9 @@ void AliAnalysisTaskEMCALClusterize::RecPoints2Clusters()
  absIds[ncellsTrue] = digit->GetId();
  ratios[ncellsTrue] = recPoint->GetEnergiesList()[c]/digit->GetAmplitude();
  + if ( !fRecParam->GetUnfold() && (ratios[ncellsTrue] > 1 || ratios[ncellsTrue] < 1) )
  + AliWarning(Form("recpoint cell E %2.3f but digit E %2.3f and no unfolding", recPoint->GetEnergiesList()[c], digit->GetAmplitude()));
  +
  // In case of unfolding, remove digits with unfolded energy too low
  if(fSelectCell)
  {
  