}
+//_____________________________________________________________________________
+UChar_t AliTRDclusterizer::GetStatus(Short_t &signal)
+{
+ UChar_t status = 0;
+ // check if pad is masked
+ if(signal>0 && TESTBIT(signal, 10)){
+ CLRBIT(signal, 10);
+ for(int ibit=0; ibit<4; ibit++){
+ if(TESTBIT(signal, 11+ibit)){
+ SETBIT(status, ibit);
+ CLRBIT(signal, 11+ibit);
+ }
+ }
+ }
+ return status;
+}
+
//_____________________________________________________________________________
Bool_t AliTRDclusterizer::MakeClusters(Int_t det)
{
UShort_t volid = AliGeomManager::LayerToVolUID(ilayer,imodule);
Int_t nColMax = digitsIn->GetNcol();
+ Int_t nRowMax = digitsIn->GetNrow();
Int_t nTimeTotal = digitsIn->GetNtime();
// Detector wise calibration object for the gain factors
// Calibration value for chamber wise gain factor
Float_t calGainFactorDetValue = calGainFactorDet->GetValue(idet);
- // Calibration object with the pad status information
- AliTRDCalSingleChamberStatus *calPadStatusROC = calibration->GetPadStatusROC(idet);
-
Int_t nClusters = 0;
- AliTRDdataArrayF *digitsOut = new AliTRDdataArrayF(digitsIn->GetNrow()
- ,digitsIn->GetNcol()
- ,digitsIn->GetNtime());
+ AliTRDdataArrayF *digitsOut = new AliTRDdataArrayF(nRowMax, nColMax, nTimeTotal);
+ AliTRDdataArrayS padStatus(nRowMax, nColMax, nTimeTotal);
ResetHelperIndexes(indexesIn);
Int_t time = 0;
Int_t iPad = 0;
+ UChar_t status[3], ipos;
+ Short_t signal;
fIndexesOut->ResetCounters();
- while (fIndexesOut->NextRCTbinIndex(row, col, time))
- {
-
- Float_t signalM = TMath::Abs(digitsOut->GetDataUnchecked(row,col,time));
-
- // Look for the maximum
- if (signalM >= maxThresh)
- {
-
- if (col + 1 >= nColMax || col-1 < 0)
- continue;
-
- Float_t signalL = TMath::Abs(digitsOut->GetDataUnchecked(row,col+1,time));
- Float_t signalR = TMath::Abs(digitsOut->GetDataUnchecked(row,col-1,time));
-
- if ((TMath::Abs(signalL) <= signalM) &&
- (TMath::Abs(signalR) < signalM))
- {
- if ((TMath::Abs(signalL) >= sigThresh) ||
- (TMath::Abs(signalR) >= sigThresh))
- {
- // Maximum found, mark the position by a negative signal
- digitsOut->SetDataUnchecked(row,col,time,-signalM);
- fIndexesMaxima->AddIndexTBin(row,col,time);
+ while (fIndexesOut->NextRCTbinIndex(row, col, time)){
+ Float_t signalM = TMath::Abs(digitsOut->GetDataUnchecked(row,col,time));
+ signal = digitsIn->GetDataUnchecked(row,col,time);
+ status[1] = GetStatus(signal);
+ ipos = status[1] ? 2 : 0;
+
+ // Look for the maximum
+ if (signalM >= maxThresh) {
+ if (col + 1 >= nColMax || col-1 < 0) continue;
+
+ Float_t signalL = TMath::Abs(digitsOut->GetDataUnchecked(row,col+1,time));
+ signal = digitsIn->GetDataUnchecked(row,col+1,time);
+ status[0] = GetStatus(signal);
+ ipos += status[0] ? 1 : 0;
+
+ Float_t signalR = TMath::Abs(digitsOut->GetDataUnchecked(row,col-1,time));
+ signal = digitsIn->GetDataUnchecked(row,col-1,time);
+ status[2] = GetStatus(signal);
+ ipos += status[0] ? 4 : 0;
+
+ // reject candidates with more than 1 problematic pad
+ if(ipos == 3 || ipos > 4) continue;
+
+ if(!status[1]){ // good central pad
+ if(!ipos){ // all pads are OK
+ if ((signalL <= signalM) && (signalR < signalM)) {
+ if ((signalL >= sigThresh) || (signalR >= sigThresh)) {
+ // Maximum found, mark the position by a negative signal
+ digitsOut->SetDataUnchecked(row,col,time,-signalM);
+ fIndexesMaxima->AddIndexTBin(row,col,time);
+ padStatus.SetDataUnchecked(row, col, time, ipos);
+ }
+ }
+ } else { // one of the neighbouring pads are bad
+ if(status[0] && signalR < signalM && signalR >= sigThresh){
+ digitsOut->SetDataUnchecked(row,col,time,-signalM);
+ digitsOut->SetDataUnchecked(row, col, time+1, 0.);
+ fIndexesMaxima->AddIndexTBin(row,col,time);
+ padStatus.SetDataUnchecked(row, col, time, ipos);
+ } else if(status[2] && signalL <= signalM && signalL >= sigThresh){
+ digitsOut->SetDataUnchecked(row,col,time,-signalM);
+ digitsOut->SetDataUnchecked(row, col, time-1, 0.);
+ fIndexesMaxima->AddIndexTBin(row,col,time);
+ padStatus.SetDataUnchecked(row, col, time, ipos);
+ }
+ }
+ } else { // wrong maximum pad
+ if ((signalL >= sigThresh) || (signalR >= sigThresh)) {
+ // Maximum found, mark the position by a negative signal
+ digitsOut->SetDataUnchecked(row,col,time,-maxThresh);
+ fIndexesMaxima->AddIndexTBin(row,col,time);
+ padStatus.SetDataUnchecked(row, col, time, ipos);
+ }
+ }
}
- }
-
}
-
- }
// The index to the first cluster of a given ROC
Int_t firstClusterROC = -1;
// Store the amplitudes of the pads in the cluster for later analysis
// and check whether one of these pads is masked in the database
Short_t signals[7] = { 0, 0, 0, 0, 0, 0, 0 };
- Bool_t hasMasked = kFALSE;
for (Int_t jPad = col-3; jPad <= col+3; jPad++)
{
if ((jPad < 0) ||
continue;
}
signals[jPad-col+3] = TMath::Nint(TMath::Abs(digitsOut->GetDataUnchecked(row,jPad,time)));
- if (calPadStatusROC->IsMasked(jPad,row)) {
- hasMasked = kTRUE;
- }
}
// Transform the local cluster coordinates into calibrated
// space point positions defined in the local tracking system.
// Here the calibration for T0, Vdrift and ExB is applied as well.
- Double_t clusterXYZ[6];
- clusterXYZ[0] = clusterPosCol;
- clusterXYZ[1] = clusterSignal[0];
- clusterXYZ[2] = clusterSignal[1];
- clusterXYZ[3] = clusterSignal[2];
- clusterXYZ[4] = 0.0;
- clusterXYZ[5] = 0.0;
- Int_t clusterRCT[3];
- clusterRCT[0] = row;
- clusterRCT[1] = col;
- clusterRCT[2] = 0;
+ Double_t clusterXYZ[6];
+ clusterXYZ[0] = clusterPosCol;
+ clusterXYZ[1] = clusterSignal[0];
+ clusterXYZ[2] = clusterSignal[1];
+ clusterXYZ[3] = clusterSignal[2];
+ clusterXYZ[4] = 0.0;
+ clusterXYZ[5] = 0.0;
+ Int_t clusterRCT[3];
+ clusterRCT[0] = row;
+ clusterRCT[1] = col;
+ clusterRCT[2] = 0;
Bool_t out = kTRUE;
if (fTransform->Transform(clusterXYZ, clusterRCT, ((UInt_t) time), out, 0)) {
,clusterPosCol
,volid);
cluster->SetInChamber(!out);
- cluster->SetMaskedPad(hasMasked);
-
+ if(padStatus.GetDataUnchecked(row, col, time)){
+ cluster->SetMaskedPad(kTRUE);
+ //cluster->SetPadMasked(center/side);
+ //cluster->SetPadMaskedStatus(status);
+ }
+
// Temporarily store the row, column and time bin of the center pad
// Used to later on assign the track indices
cluster->SetLabel( row,0);
-/**************************************************************************
+#/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
#include "AliTRDSignalIndex.h"
#include "AliTRDReconstructor.h"
#include "AliTRDrecoParam.h"
+#include "AliTRDcalibDB.h"
+#include "Cal/AliTRDCalPadStatus.h"
#include "AliLog.h"
#include "AliRawReader.h"
// Return value is the detector number
//
+ AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
AliTRDdataArrayS *digits = 0;
AliTRDdataArrayI *track0 = 0;
AliTRDdataArrayI *track1 = 0;
// Add a container for the digits of this detector
digits = (AliTRDdataArrayS *) digitsManager->GetDigits(det);
+
if (digitsManager->UsesDictionaries())
{
track0 = (AliTRDdataArrayI *) digitsManager->GetDictionary(det,0);
if (indexes->IsAllocated() == kFALSE)
indexes->Allocate(rowMax, colMax, ntbins);
}
-
+
+ Char_t padStatus = cal->GetPadStatus(det, GetCol(), GetRow());
+
// ntimebins data are ready to read
for (it = 0; it < GetNumberOfTimeBins(); it++)
{
if ((GetSignals()[it] - adcBaseline) > 0)
{
- digits->SetDataUnchecked(GetRow(), GetCol(), it, GetSignals()[it] - adcBaseline);
+ Short_t sigvalue = GetSignals()[it] - adcBaseline;
+ // Masking Pads in the signal
+ // Coding:
+ // Any Corruption: Bit 10 set 1
+ // Noisy: Bit 11: 0, Bit 12: 0
+ // Not Connected: Bit 11: 1, Bit 12: 0
+ // Bridged: Bit 11: 0, Bit 12: 1 resp. Bit 11: 1, Bit 12: 1
+ switch(padStatus)
+ {
+ case AliTRDCalPadStatus::kMasked:
+ SETBIT(sigvalue, 10);
+ CLRBIT(sigvalue, 11);
+ CLRBIT(sigvalue, 12);
+ break;
+ case AliTRDCalPadStatus::kNotConnected:
+ SETBIT(sigvalue, 10);
+ SETBIT(sigvalue, 11);
+ CLRBIT(sigvalue, 12);
+ break;
+ case AliTRDCalPadStatus::kPadBridgedLeft:
+ SETBIT(sigvalue, 10);
+ CLRBIT(sigvalue, 11);
+ SETBIT(sigvalue, 12);
+ break;
+ case AliTRDCalPadStatus::kPadBridgedRight:
+ SETBIT(sigvalue, 10);
+ SETBIT(sigvalue, 11);
+ SETBIT(sigvalue, 12);
+ default:
+ // No corruption
+ CLRBIT(sigvalue, 10);
+ CLRBIT(sigvalue, 11);
+ CLRBIT(sigvalue, 12);
+ }
+ digits->SetDataUnchecked(GetRow(), GetCol(), it, sigvalue);
indexes->AddIndexTBin(GetRow(), GetCol(), it);
if (digitsManager->UsesDictionaries())