// This is to take care of switched off super modules
if (!digitsIn->HasData()) continue;
digitsIn->Expand();
+ digitsIn->DeleteNegatives(); // Restore digits array to >=0 values
AliTRDSignalIndex* indexes = fDigitsManager->GetIndexes(i);
if (indexes->IsAllocated() == kFALSE){
fDigitsManager->BuildIndexes(i);
return status;
}
+//_____________________________________________________________________________
+void AliTRDclusterizer::SetPadStatus(UChar_t status, UChar_t &out){
+ //
+ // Set the pad status into out
+ // First three bits are needed for the position encoding
+ //
+ status = status << 3;
+ out |= status;
+}
+
+//_____________________________________________________________________________
+UChar_t AliTRDclusterizer::GetPadStatus(UChar_t encoding){
+ //
+ // return the staus encoding of the corrupted pad
+ //
+ return static_cast<UChar_t>(encoding >> 3);
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDclusterizer::GetCorruption(UChar_t encoding){
+ //
+ // Return the position of the corruption
+ //
+ return encoding & 7;
+}
+
//_____________________________________________________________________________
Bool_t AliTRDclusterizer::MakeClusters(Int_t det)
{
UChar_t status[3]={0, 0, 0}, ipos = 0;
fIndexesOut->ResetCounters();
while (fIndexesOut->NextRCTbinIndex(row, col, time)) {
+ // reset pad status
+ ipos = 0; for(Int_t is=3; is--;) status[is] = 0;
Float_t signalM = TMath::Abs(digitsOut->GetData(row,col,time));
status[1] = digitsIn->GetPadStatus(row,col,time);
// Maximum found, mark the position by a negative signal
digitsOut->SetData(row,col,time,-signalM);
fIndexesMaxima->AddIndexTBin(row,col,time);
- padStatus.SetData(row, col, time, ipos);
+ padStatus.SetData(row, col, time, ipos); // No corruption
}
}
}
- }
- else { // one of the neighbouring pads are bad
+ } else { // one of the neighbouring pads are bad
if (status[0] && signalR < signalM && signalR >= sigThresh) {
digitsOut->SetData(row,col,time,-signalM);
digitsOut->SetData(row, col, time+1, 0.);
fIndexesMaxima->AddIndexTBin(row,col,time);
+ SetPadStatus(status[0], ipos);
padStatus.SetData(row, col, time, ipos);
}
else if (status[2] && signalL <= signalM && signalL >= sigThresh) {
digitsOut->SetData(row,col,time,-signalM);
digitsOut->SetData(row, col, time-1, 0.);
fIndexesMaxima->AddIndexTBin(row,col,time);
+ SetPadStatus(status[2], ipos);
padStatus.SetData(row, col, time, ipos);
}
}
else { // wrong maximum pad
if ((signalL >= sigThresh) || (signalR >= sigThresh)) {
// Maximum found, mark the position by a negative signal
- digitsOut->SetData(row,col,time,-maxThresh);
- fIndexesMaxima->AddIndexTBin(row,col,time);
- padStatus.SetData(row, col, time, ipos);
+ digitsOut->SetData(row,col,time,-maxThresh);
+ fIndexesMaxima->AddIndexTBin(row,col,time);
+ SetPadStatus(status[1], ipos);
+ padStatus.SetData(row, col, time, ipos);
}
}
-
}
// The index to the first cluster of a given ROC
Char_t clusterTimeBin = ((Char_t) clusterRCT[2]);
Int_t n = RecPoints()->GetEntriesFast();
- AliTRDcluster *cluster = new((*RecPoints())[n]) AliTRDcluster(idet
- ,clusterCharge
- ,clusterPos
- ,clusterSig
- ,0x0
- ,((Char_t) nPadCount)
- ,signals
- ,((UChar_t) col)
- ,((UChar_t) row)
- ,((UChar_t) time)
- ,clusterTimeBin
- ,clusterPosCol
- ,volid);
+ AliTRDcluster *cluster = new((*RecPoints())[n]) AliTRDcluster(
+ idet,
+ clusterCharge, clusterPos, clusterSig,
+ 0x0,
+ ((Char_t) nPadCount),
+ signals,
+ ((UChar_t) col), ((UChar_t) row), ((UChar_t) time),
+ clusterTimeBin, clusterPosCol,
+ volid);
cluster->SetInChamber(!out);
- UChar_t maskPosition = padStatus.GetData(row, col, time);
+ UChar_t maskPosition = GetCorruption(padStatus.GetData(row, col, time));
+ UChar_t padstatus = GetPadStatus(padStatus.GetData(row, col, time));
if (maskPosition) {
cluster->SetPadMaskedPosition(maskPosition);
- if (maskPosition & AliTRDcluster::kMaskedLeft) {
- cluster->SetPadMaskedStatus(status[0]);
- }
- else if (maskPosition & AliTRDcluster::kMaskedCenter) {
- cluster->SetPadMaskedStatus(status[1]);
- }
- else {
- cluster->SetPadMaskedStatus(status[2]);
- }
+ cluster->SetPadMaskedStatus(padstatus);
}
// Temporarily store the row, column and time bin of the center pad