ioArray->AddLast(c);
}
fClusterTree->Fill();
+ ioArray->Clear();
} else {
-
- Int_t detOld = -1;
+ Int_t detOld = -1, nw(0);
for (Int_t i = 0; i < nRecPoints; i++) {
AliTRDcluster *c = (AliTRDcluster *) RecPoints()->UncheckedAt(i);
if(c->GetDetector() != detOld){
+ nw += ioArray->GetEntriesFast();
fClusterTree->Fill();
ioArray->Clear();
detOld = c->GetDetector();
}
ioArray->AddLast(c);
}
+ if(ioArray->GetEntriesFast()){
+ nw += ioArray->GetEntriesFast();
+ fClusterTree->Fill();
+ ioArray->Clear();
+ }
+ AliDebug(2, Form("Clusters FOUND[%d] WRITTEN[%d] STATUS[%s]", nRecPoints, nw, nw==nRecPoints?"OK":"FAILED"));
}
delete ioArray;
return kTRUE;
-
}
//_____________________________________________________________________________
fDigitsManager->RemoveDictionaries(i);
fDigitsManager->ClearIndexes(i);
}
+ fReconstructor->SetDigitsParam(fDigitsManager->GetDigitsParam());
if(fReconstructor->IsWritingClusters()) WriteClusters(-1);
else
fRawStream->SetReader(rawReader);
- if(fReconstructor->IsHLT())
+ if(fReconstructor->IsHLT()){
fRawStream->SetSharedPadReadout(kFALSE);
+ fRawStream->SetNoErrorWarning();
+ }
- AliInfo(Form("Stream version: %s", fRawStream->IsA()->GetName()));
+ AliDebug(1,Form("Stream version: %s", fRawStream->IsA()->GetName()));
Int_t det = 0;
while ((det = fRawStream->NextChamber(fDigitsManager,fTrackletContainer)) >= 0){
if (!fReconstructor->IsWritingTracklets()) continue;
if (*(fTrackletContainer[0]) > 0 || *(fTrackletContainer[1]) > 0) WriteTracklets(det);
}
+ fReconstructor->SetDigitsParam(fDigitsManager->GetDigitsParam());
if (fTrackletContainer){
delete [] fTrackletContainer[0];
if(!TestBit(knewDM)){
delete fDigitsManager;
fDigitsManager = NULL;
+ delete fRawStream;
+ fRawStream = NULL;
}
AliInfo(Form("Number of found clusters : %d", fNoOfClusters));
return kFALSE;
}
+ AliDebug(2, Form("Det[%d] @ Sec[%d] Stk[%d] Ly[%d]", fDet, isector, istack, fLayer));
+
// TRD space point transformation
fTransform->SetDetector(det);
//Int_t nRowMax = fDigits->GetNrow();
fTimeTotal = fDigits->GetNtime();
+ // Check consistency between OCDB and raw data
+ Int_t nTimeOCDB = calibration->GetNumberOfTimeBinsDCS();
+ if ((nTimeOCDB > -1) &&
+ (fTimeTotal != nTimeOCDB)) {
+ AliError(Form("Number of timebins does not match OCDB value (RAW[%d] OCDB[%d])"
+ ,fTimeTotal,calibration->GetNumberOfTimeBinsDCS()));
+ }
+
// Detector wise calibration object for the gain factors
const AliTRDCalDet *calGainFactorDet = calibration->GetGainFactorDet();
// Calibration object with pad wise values for the gain factors
if(!(status[0] | status[1] | status[2])) {//all pads are good
if ((Signals[2] <= Signals[1]) && (Signals[0] < Signals[1])) {
if ((Signals[2] >= fSigThresh) || (Signals[0] >= fSigThresh)) {
+ if(Signals[0]<0)Signals[0]=0;
+ if(Signals[2]<0)Signals[2]=0;
Float_t noiseSumThresh = fMinLeftRightCutSigma
* fCalNoiseDetValue
* fCalNoiseROC->GetValue(Max.col, Max.row);
}
}
} else { // at least one of the pads is bad, and reject candidates with more than 1 problematic pad
+ if(Signals[0]<0)Signals[0]=0;
+ if(Signals[2]<0)Signals[2]=0;
if (status[2] && (!(status[0] || status[1])) && Signals[1] > Signals[0] && Signals[0] >= fSigThresh) {
Signals[2]=0;
SetPadStatus(status[2], padStatus);
Double_t *inADC = new Double_t[fTimeTotal]; // ADC data before tail cancellation
Double_t *outADC = new Double_t[fTimeTotal]; // ADC data after tail cancellation
- fIndexes->ResetCounters();
TTreeSRedirector *fDebugStream = fReconstructor->GetDebugStream(AliTRDrecoParam::kClusterizer);
+ Bool_t debugStreaming = fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kClusterizer) > 7 && fReconstructor->IsDebugStreaming();
while(fIndexes->NextRCIndex(iRow, iCol))
{
Bool_t corrupted = kFALSE;
+ if (fCalPadStatusROC->GetStatus(iCol, iRow)) corrupted = kTRUE;
+
+ // Save data into the temporary processing array and substract the baseline,
+ // since DeConvExp does not expect a baseline
for (iTime = 0; iTime < fTimeTotal; iTime++)
- {
- // Apply gain gain factor
- inADC[iTime] = fDigits->GetData(iRow,iCol,iTime);
- if (fCalPadStatusROC->GetStatus(iCol, iRow)) corrupted = kTRUE;
- outADC[iTime] = inADC[iTime];
- if(fReconstructor->GetRecoParam()->GetStreamLevel(AliTRDrecoParam::kClusterizer) > 7 && fReconstructor->IsDebugStreaming()){
- (*fDebugStream) << "TailCancellation"
- << "col=" << iCol
- << "row=" << iRow
- << "time=" << iTime
- << "inADC=" << inADC[iTime]
- << "outADC=" << outADC[iTime]
- << "corrupted=" << corrupted
- << "\n";
- }
- }
+ inADC[iTime] = fDigits->GetData(iRow,iCol,iTime)-fBaseline;
+
+ if(debugStreaming){
+ for (iTime = 0; iTime < fTimeTotal; iTime++)
+ (*fDebugStream) << "TailCancellation"
+ << "col=" << iCol
+ << "row=" << iRow
+ << "time=" << iTime
+ << "inADC=" << inADC[iTime]
+ << "outADC=" << outADC[iTime]
+ << "corrupted=" << corrupted
+ << "\n";
+ }
+
if (!corrupted)
{
// Apply the tail cancelation via the digital filter
// (only for non-coorupted pads)
DeConvExp(&inADC[0],&outADC[0],fTimeTotal,fReconstructor->GetRecoParam() ->GetTCnexp());
}
+ else memcpy(&outADC[0],&inADC[0],fTimeTotal*sizeof(inADC[0]));
- for(iTime = 0; iTime < fTimeTotal; iTime++)//while (fIndexes->NextTbinIndex(iTime))
- {
- // Store the amplitude of the digit if above threshold
- if (outADC[iTime] > 0)
- fDigits->SetData(iRow,iCol,iTime,TMath::Nint(outADC[iTime]));
- else
- fDigits->SetData(iRow,iCol,iTime,0);
- } // while itime
-
+ // Save tailcancalled data and add the baseline
+ for(iTime = 0; iTime < fTimeTotal; iTime++)
+ fDigits->SetData(iRow,iCol,iTime,(Short_t)(outADC[iTime] + fBaseline + 0.5));
+
} // while irow icol
delete [] inADC;