//____________________________________________________________________________
AliEMCALClusterizerNxN::AliEMCALClusterizerNxN()
-: AliEMCALClusterizer(), fNRowDiff(1), fNColDiff(1)
+ : AliEMCALClusterizer(), fNRowDiff(1), fNColDiff(1), fEnergyGrad(0)
{
// ctor with the indication of the file where header Tree and digits Tree are stored
}
//____________________________________________________________________________
AliEMCALClusterizerNxN::AliEMCALClusterizerNxN(AliEMCALGeometry* geometry)
- : AliEMCALClusterizer(geometry), fNRowDiff(1), fNColDiff(1)
+ : AliEMCALClusterizer(geometry), fNRowDiff(1), fNColDiff(1), fEnergyGrad(0)
{
// ctor with the indication of the file where header Tree and digits Tree are stored
// use this contructor to avoid usage of Init() which uses runloader
//____________________________________________________________________________
AliEMCALClusterizerNxN::AliEMCALClusterizerNxN(AliEMCALGeometry* geometry, AliEMCALCalibData * calib, AliCaloCalibPedestal * caloped)
-: AliEMCALClusterizer(geometry, calib, caloped), fNRowDiff(1), fNColDiff(1)
+: AliEMCALClusterizer(geometry, calib, caloped), fNRowDiff(1), fNColDiff(1), fEnergyGrad(0)
{
// ctor, geometry and calibration are initialized elsewhere.
}
// The order of d1 and d2 is important: first (d1) should be a digit already in a cluster
// which is compared to a digit (d2) not yet in a cluster
+ if (fEnergyGrad) { //false by default
+ if (d2->GetCalibAmp()>d1->GetCalibAmp())
+ return 3; // energy of neighboring cell should be smaller in order to become a neighbor
+ }
+
Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0;
Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0;
Int_t rowdiff=0, coldiff=0;
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 > 0.0) // no threshold!
- {
+ 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