#include "AliTRDcalibDB.h"
#include "AliTRDtransform.h"
#include "AliTRDSignalIndex.h"
-#include "AliTRDrawStreamBase.h"
#include "AliTRDrawStream.h"
#include "AliTRDfeeParam.h"
#include "AliTRDtrackletWord.h"
}
if(!fRawStream)
- fRawStream = AliTRDrawStreamBase::GetRawStream(rawReader);
+ fRawStream = new AliTRDrawStream(rawReader);
else
fRawStream->SetReader(rawReader);
if(fReconstructor->IsHLT()){
- if(fRawStream->InheritsFrom(AliTRDrawStream::Class()))
- ((AliTRDrawStream*)fRawStream)->DisableErrorStorage();
- else{
- fRawStream->SetSharedPadReadout(kFALSE);
- fRawStream->SetNoErrorWarning();
- }
+ ((AliTRDrawStream*)fRawStream)->DisableErrorStorage();
}
AliDebug(1,Form("Stream version: %s", fRawStream->IsA()->GetName()));
SetBit(kGAUS, recoParam->UseGAUS());
// Apply the gain and the tail cancelation via digital filter
- if(recoParam->UseTailCancelation()) TailCancelation(recoParam);
+ // Use the configuration from the DCS to find out whether online
+ // tail cancellation was applied
+ if(!calibration->HasOnlineTailCancellation()) TailCancelation(recoParam);
MaxStruct curr, last;
Int_t nMaximas = 0, nCorrupted = 0;
// Gives back the padStatus and the signals of the center pad and the two neighbouring pads.
//
+ Float_t tmp(0.), kMaxShortVal(32767.); // protect against data overflow due to wrong gain calibration
Float_t gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col,Max.row);
- Signals[1] = (Short_t)((fDigits->GetData(Max.row, Max.col, Max.time) - fBaseline) / gain + 0.5f);
+ tmp = (fDigits->GetData(Max.row, Max.col, Max.time) - fBaseline) / gain + 0.5f;
+ Signals[1] = (Short_t)TMath::Min(tmp, kMaxShortVal);
if(Signals[1] <= fMaxThresh) return kFALSE;
if(Max.col < 1 || Max.col + 1 >= fColMax) return kFALSE;
,fCalPadStatusROC->GetStatus(Max.col+1, Max.row)
};
- gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col-1,Max.row);
- Signals[0] = (Short_t)((fDigits->GetData(Max.row, Max.col-1, Max.time) - fBaseline) / gain + 0.5f);
- gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col+1,Max.row);
- Signals[2] = (Short_t)((fDigits->GetData(Max.row, Max.col+1, Max.time) - fBaseline) / gain + 0.5f);
+ Short_t signal(0);
+ if((signal = fDigits->GetData(Max.row, Max.col-1, Max.time))){
+ gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col-1,Max.row);
+ tmp = (signal - fBaseline) / gain + 0.5f;
+ Signals[0] = (Short_t)TMath::Min(tmp, kMaxShortVal);
+ } else Signals[0] = 0;
+ if((signal = fDigits->GetData(Max.row, Max.col+1, Max.time))){
+ gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col+1,Max.row);
+ tmp = (signal - fBaseline) / gain + 0.5f;
+ Signals[2] = (Short_t)TMath::Min(tmp, kMaxShortVal);
+ } else Signals[2] = 0;
if(!(status[0] | status[1] | status[2])) {//all pads are good
if ((Signals[2] <= Signals[1]) && (Signals[0] < Signals[1])) {
//_____________________________________________________________________________
void AliTRDclusterizer::CalcAdditionalInfo(const MaxStruct &Max, Short_t *const signals, Int_t &nPadCount)
{
+// Calculate number of pads/cluster and
+// ADC signals at position 0, 1, 5 and 6
+
+ Float_t tmp(0.), kMaxShortVal(32767.); // protect against data overflow due to wrong gain calibration
+ Float_t gain(1.); Short_t signal(0);
+ // Store the amplitudes of the pads in the cluster for later analysis
+ // and check whether one of these pads is masked in the database
+ signals[3]=Max.signals[1];
+ Int_t ipad(1), jpad(0);
// Look to the right
- Int_t ii = 1;
- while (fDigits->GetData(Max.row, Max.col-ii, Max.time) >= fSigThresh) {
+ while((jpad = Max.col-ipad)){
+ if(!(signal = fDigits->GetData(Max.row, jpad, Max.time))) break; // empty digit !
+ gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(jpad, Max.row);
+ tmp = (signal - fBaseline) / gain + 0.5f;
+ signal = (Short_t)TMath::Min(tmp, kMaxShortVal);
+ if(signal<fSigThresh) break; // signal under threshold
nPadCount++;
- ii++;
- if (Max.col < ii) break;
+ if(ipad<=3) signals[3 - ipad] = signal;
+ ipad++;
}
+ ipad=1;
// Look to the left
- ii = 1;
- while (fDigits->GetData(Max.row, Max.col+ii, Max.time) >= fSigThresh) {
+ while((jpad = Max.col+ipad)<fColMax){
+ if(!(signal = fDigits->GetData(Max.row, jpad, Max.time))) break; // empty digit !
+ gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(jpad, Max.row);
+ tmp = (signal - fBaseline) / gain + 0.5f;
+ signal = (Short_t)TMath::Min(tmp, kMaxShortVal);
+ if(signal<fSigThresh) break; // signal under threshold
nPadCount++;
- ii++;
- if (Max.col+ii >= fColMax) break;
+ if(ipad<=3) signals[3 + ipad] = signal;
+ ipad++;
}
- // Store the amplitudes of the pads in the cluster for later analysis
- // and check whether one of these pads is masked in the database
- signals[2]=Max.signals[0];
- signals[3]=Max.signals[1];
- signals[4]=Max.signals[2];
- Float_t gain;
- for(Int_t i = 0; i<2; i++)
- {
- if(Max.col+i >= 3){
- gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col-3+i,Max.row);
- signals[i] = (Short_t)((fDigits->GetData(Max.row, Max.col-3+i, Max.time) - fBaseline) / gain + 0.5f);
- }
- if(Max.col+3-i < fColMax){
- gain = fCalGainFactorDetValue * fCalGainFactorROC->GetValue(Max.col+3-i,Max.row);
- signals[6-i] = (Short_t)((fDigits->GetData(Max.row, Max.col+3-i, Max.time) - fBaseline) / gain + 0.5f);
- }
- }
- /*for (Int_t jPad = Max.Col-3; jPad <= Max.Col+3; jPad++) {
- if ((jPad >= 0) && (jPad < fColMax))
- signals[jPad-Max.Col+3] = TMath::Nint(fDigits->GetData(Max.Row,jPad,Max.Time));
- }*/
+ AliDebug(4, Form("Signals[%3d %3d %3d %3d %3d %3d %3d] Npads[%d]."
+ , signals[0], signals[1], signals[2], signals[3], signals[4], signals[5], signals[6], nPadCount));
}
//_____________________________________________________________________________
// Applies the tail cancelation
//
+ Int_t nexp = recoParam->GetTCnexp();
+ if(!nexp) return;
+
Int_t iRow = 0;
Int_t iCol = 0;
Int_t iTime = 0;
TTreeSRedirector *fDebugStream = fReconstructor->GetDebugStream(AliTRDrecoParam::kClusterizer);
Bool_t debugStreaming = recoParam->GetStreamLevel(AliTRDrecoParam::kClusterizer) > 7 && fReconstructor->IsDebugStreaming();
- Int_t nexp = recoParam->GetTCnexp();
while(fIndexes->NextRCIndex(iRow, iCol))
{
// if corrupted then don't make the tail cancallation