fNumberOfECAClusters = 0;
fRecPoints->Delete();
- // Set up TObjArray with pointers to digits to work on
+ // Set up TObjArray with pointers to digits to work on, calibrate digits
TObjArray digitsC;
TIter nextdigit(fDigitsArr);
AliEMCALDigit *digit = 0;
while ( (digit = static_cast<AliEMCALDigit*>(nextdigit())) ) {
- Float_t dEnergyCalibrated = Calibrate(digit->GetAmplitude(), digit->GetTime(),digit->GetId());
+ Float_t dEnergyCalibrated = digit->GetAmplitude();
+ Float_t time = digit->GetTime();
+ Calibrate(dEnergyCalibrated,time ,digit->GetId());
digit->SetCalibAmp(dEnergyCalibrated);
+ digit->SetTime(time);
digitsC.AddLast(digit);
}
while ( (digit = static_cast<AliEMCALDigit *>(nextdigitC())) )
{ // scan over the list of digitsC
Float_t dEnergyCalibrated = digit->GetCalibAmp();
-
- if (fGeom->CheckAbsCellId(digit->GetId()) && dEnergyCalibrated > fMinECut) // no threshold by default!
- { // needs to be set in OCDB!
+ Float_t time = digit->GetTime();
+ if (fGeom->CheckAbsCellId(digit->GetId()) &&
+ dEnergyCalibrated > fMinECut &&
+ time < fTimeMax &&
+ time > fTimeMin ) // no threshold by default!
+ { // needs to be set in OCDB!
if (dEnergyCalibrated > dMaxEnergyDigit)
{
dMaxEnergyDigit = dEnergyCalibrated;
if (fNumberOfECAClusters >= fRecPoints->GetSize())
fRecPoints->Expand(2*fNumberOfECAClusters+1);
- AliEMCALRecPoint *recPoint = new AliEMCALRecPoint("");
- fRecPoints->AddAt(recPoint, fNumberOfECAClusters);
- recPoint = static_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters));
+ (*fRecPoints)[fNumberOfECAClusters] = new AliEMCALRecPoint("") ;
+ AliEMCALRecPoint *recPoint = dynamic_cast<AliEMCALRecPoint *>( fRecPoints->At(fNumberOfECAClusters) ) ;
+ // AliEMCALRecPoint *recPoint = new AliEMCALRecPoint("");
+ // fRecPoints->AddAt(recPoint, fNumberOfECAClusters);
+ // recPoint = static_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters));
if (recPoint) {
fNumberOfECAClusters++;
recPoint->SetClusterType(AliVCluster::kEMCALClusterv1);
for (Int_t idig = 0; idig < clusterDigitList.GetEntries(); idig++)
{
digit = (AliEMCALDigit*)clusterDigitList.At(idig);
- Float_t dEnergyCalibrated = digit->GetCalibAmp();
AliDebug(5, Form(" Adding digit %d", digit->GetId()));
// note: this way the sharing info is lost!
- recPoint->AddDigit(*digit, dEnergyCalibrated, kFALSE); //Time or TimeR?
+ recPoint->AddDigit(*digit, digit->GetCalibAmp(), kFALSE); //Time or TimeR?
digitsC.Remove(digit);
}
}// recpoint