#include "AliTRDdataArrayF.h"
#include "AliTRDdataArrayI.h"
#include "AliTRDdataArrayS.h"
+#include "AliTRDdataArrayDigits.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDrawData.h"
#include "AliTRDcalibDB.h"
for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++)
{
- AliTRDdataArrayS *digitsIn = (AliTRDdataArrayS *) fDigitsManager->GetDigits(i);
+ AliTRDdataArrayDigits *digitsIn = (AliTRDdataArrayDigits*) fDigitsManager->GetDigits(i);
// This is to take care of switched off super modules
if (!digitsIn->HasData())
{
// Get the digits
// digits should be expanded beforehand!
// digitsIn->Expand();
- AliTRDdataArrayS *digitsIn = (AliTRDdataArrayS *) fDigitsManager->GetDigits(det);
+ AliTRDdataArrayDigits *digitsIn = (AliTRDdataArrayDigits *) fDigitsManager->GetDigits(det);
// This is to take care of switched off super modules
if (!digitsIn->HasData())
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);
+ status[1] = digitsIn->GetPadStatus(row, col, time);
ipos = status[1] ? 2 : 0;
// Look for the maximum
Float_t signalL = TMath::Abs(digitsOut->GetDataUnchecked(row,col+1,time));
signal = digitsIn->GetDataUnchecked(row,col+1,time);
- status[0] = GetStatus(signal);
+ status[0] = digitsIn->GetPadStatus(row,col+1,time);
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);
+ status[2] = digitsIn->GetPadStatus(row, col-1, time);
ipos += status[0] ? 4 : 0;
// reject candidates with more than 1 problematic pad
}
//_____________________________________________________________________________
-void AliTRDclusterizer::TailCancelation(AliTRDdataArrayS *digitsIn
+void AliTRDclusterizer::TailCancelation(AliTRDdataArrayDigits *digitsIn
, AliTRDdataArrayF *digitsOut
, AliTRDSignalIndex *indexesIn
, AliTRDSignalIndex *indexesOut
class AliTRD;
class AliTRDcluster;
class AliTRDdataArrayS;
+class AliTRDdataArrayDigits;
class AliTRDdataArrayF;
class AliTRDdigitsManager;
class AliTRDSignalIndex;
void DeConvExp(Double_t *source, Double_t *target
, Int_t nTimeTotal, Int_t nexp);
- void TailCancelation(AliTRDdataArrayS *digitsIn
+ void TailCancelation(AliTRDdataArrayDigits *digitsIn
, AliTRDdataArrayF *digitsOut
, AliTRDSignalIndex *indexesIn
, AliTRDSignalIndex *indexesOut
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id: AliTRDdataArrayDigits.cxx,v 1.17 2006/08/28 14:37:05 cblume Exp $ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Container for TRD signals type of short taking pad masking into account //
+// //
+// Author: //
+// Markus Fasel (markus.fasel@web.de) //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include <TROOT.h>
+
+#include "AliLog.h"
+#include "AliTRDarrayS.h"
+#include "Cal/AliTRDCalPadStatus.h"
+
+#include "AliTRDdataArrayDigits.h"
+
+ClassImp(AliTRDdataArrayDigits)
+
+//_____________________________________________________________________________
+AliTRDdataArrayDigits::AliTRDdataArrayDigits(Int_t nrow, Int_t ncol, Int_t ntime)
+ :AliTRDdataArrayS(nrow, ncol, ntime)
+{
+ //
+ // Constructor
+ //
+}
+
+//_____________________________________________________________________________
+Short_t AliTRDdataArrayDigits::GetDataUnchecked(Int_t row, Int_t col, Int_t time) const
+{
+ //
+ // Get the pad status without boundary checking
+ // (taking pad maskng into account)
+ //
+ Short_t value = GetDataFast(GetIdx1Unchecked(row,col),time);
+ // Be aware of Manipulations introduced by pad masking in the RawReader
+ // Only output the manipulated Value
+ CLRBIT(value, 10);
+ CLRBIT(value, 11);
+ CLRBIT(value, 12);
+ return value;
+}
+
+//_____________________________________________________________________________
+Short_t AliTRDdataArrayDigits::GetData(Int_t row, Int_t col, Int_t time) const
+{
+ //
+ // Get the pad signal
+ // (taking pad masking into account)
+ if ((row >= 0) && (col >= 0) && (time >= 0)) {
+ Int_t idx1 = GetIdx1(row,col);
+ if ((idx1 >= 0) && (time < fNdim2)) {
+ Short_t value = 0;
+ if (fBufType == 0)
+ {
+ value = GetDataFast(idx1,time);
+ }
+ if (fBufType == 1)
+ {
+ value = GetData1(idx1,time);
+ }
+ // Awareness of the bit masking
+ CLRBIT(value, 10);
+ CLRBIT(value, 11);
+ CLRBIT(value, 12);
+ return value;
+ }
+ else {
+ if (idx1 >= 0) {
+ AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
+ ,time,fNdim2,this));
+ }
+ }
+ }
+
+ return -1;
+}
+
+
+//_____________________________________________________________________________
+Int_t AliTRDdataArrayDigits::GetOverThreshold(Short_t threshold)
+{
+ //
+ // Returns the number of entries over threshold
+ // (taking pad masking into account)
+ //
+
+ if ((fElements == 0) || (fElements->GetSize() <= 0))
+ return 0;
+
+ Int_t over = 0;
+ Short_t value = 0;
+
+ for (Bool_t cont = First(); cont == kTRUE; cont = Next()) {
+ if ((fCurrentIdx1 < 0) || (fCurrentIdx1 >= fNdim1)) continue;
+ if ((fCurrentIdx2 < 0) || (fCurrentIdx2 >= fNdim2)) continue;
+ value = fElements->At(fCurrentIndex);
+ CLRBIT(value, 10);
+ CLRBIT(value, 11);
+ CLRBIT(value, 12);
+ if (value > threshold) over++;
+ }
+
+ return over;
+
+}
+
+//_____________________________________________________________________________
+UChar_t AliTRDdataArrayDigits::GetPadStatus(Int_t row, Int_t col, Int_t time) const
+{
+ //
+ // Returns the pad status stored in the pad signal
+ //
+ // Output is a UChar_t value
+ // Status Codes:
+ // Noisy Masking: 2
+ // Bridged Left Masking 8
+ // Bridged Right Masking 8
+ // Not Connected Masking 32
+ //
+ UChar_t padstatus = 0;
+ Short_t signal = GetDataFast(GetIdx1Unchecked(row,col),time);
+ if(signal > 0 && TESTBIT(signal, 10)){
+ if(TESTBIT(signal, 11))
+ if(TESTBIT(signal, 12))
+ padstatus = AliTRDCalPadStatus::kPadBridgedRight;
+ else
+ padstatus = AliTRDCalPadStatus::kNotConnected;
+ else
+ if(TESTBIT(signal, 12))
+ padstatus = AliTRDCalPadStatus::kPadBridgedLeft;
+ else
+ padstatus = AliTRDCalPadStatus::kMasked;
+ }
+ return padstatus;
+}
+
+//_____________________________________________________________________________
+void AliTRDdataArrayDigits::SetPadStatus(Int_t row, Int_t col, Int_t time, UChar_t status)
+{
+ //
+ // Setting the pad status into the signal using the Bits 10 to 14
+ // (currently used: 10 to 12)
+ //
+ // Input codes (Unsigned char):
+ // Noisy Masking: 2
+ // Bridged Left Masking 8
+ // Bridged Right Masking 8
+ // Not Connected Masking 32
+ //
+ // Status codes: Any masking: Bit 10(1)
+ // Noisy masking: Bit 11(0), Bit 12(0)
+ // No Connection masking: Bit 11(1), Bit 12(0)
+ // Bridged Left masking: Bit 11(0), Bit 12(1)
+ // Bridged Right masking: Bit 11(1), Bit 12(1)
+ //
+ Short_t signal = GetDataFast(GetIdx1Unchecked(col, row), time);
+ // only set the Pad Status if the signal is > 0
+ if(signal > 0){
+ switch(status)
+ {
+ case AliTRDCalPadStatus::kMasked:
+ SETBIT(signal, 10);
+ CLRBIT(signal, 11);
+ CLRBIT(signal, 12);
+ break;
+ case AliTRDCalPadStatus::kNotConnected:
+ SETBIT(signal, 10);
+ SETBIT(signal, 11);
+ CLRBIT(signal, 12);
+ break;
+ case AliTRDCalPadStatus::kPadBridgedLeft:
+ SETBIT(signal, 10);
+ CLRBIT(signal, 11);
+ SETBIT(signal, 12);
+ break;
+ case AliTRDCalPadStatus::kPadBridgedRight:
+ SETBIT(signal, 10);
+ SETBIT(signal, 11);
+ SETBIT(signal, 12);
+ default:
+ CLRBIT(signal, 10);
+ CLRBIT(signal, 11);
+ CLRBIT(signal, 12);
+ }
+ SetDataUnchecked(row, col, time, signal);
+ }
+}
+
+//_____________________________________________________________________________
+Bool_t AliTRDdataArrayDigits::IsPadCorrupted(Int_t row, Int_t col, Int_t time)
+{
+ //
+ // Checks if the pad has any masking as corrupted (Bit 10 in signal set)
+ //
+ Short_t signal = GetDataFast(GetIdx1Unchecked(row, col), time);
+ return (signal > 0 && TESTBIT(signal, 10)) ? kTRUE : kFALSE;
+}
+
--- /dev/null
+#ifndef ALITRDDATAARRAYDIGITS_H
+#define ALITRDDATAARRAYDIGITS_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTRDdataArrayDigits.h,v Exp $ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Container for TRD signals type of short taking pad masking into account //
+// //
+// Author: //
+// Markus Fasel (markus.fasel@web.de) //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliTRDdataArrayS.h"
+
+class AliTRDdataArrayDigits : public AliTRDdataArrayS
+{
+
+ public:
+
+ AliTRDdataArrayDigits(){};
+ AliTRDdataArrayDigits(Int_t nrow, Int_t ncol, Int_t ntime);
+ virtual ~AliTRDdataArrayDigits(){};
+
+ virtual Short_t GetDataUnchecked(Int_t row, Int_t col, Int_t time) const;
+ virtual Short_t GetData(Int_t row, Int_t col, Int_t time) const;
+ virtual Int_t GetOverThreshold(Short_t threshold);
+ UChar_t GetPadStatus(Int_t row, Int_t col, Int_t time) const;
+ void SetPadStatus(Int_t col, Int_t row, Int_t time, UChar_t status);
+ Bool_t IsPadCorrupted(Int_t row, Int_t col, Int_t time);
+
+ ClassDef(AliTRDdataArrayDigits, 1) // Container for TRD signals type of short taking pad masking into account
+};
+#endif
virtual void SetThreshold(Short_t threshold) { fThreshold = threshold; };
virtual Short_t GetData(Int_t row, Int_t col, Int_t time) const;
- Short_t GetDataUnchecked(Int_t row, Int_t col, Int_t time) const
+ virtual Short_t GetDataUnchecked(Int_t row, Int_t col, Int_t time) const
{ return GetDataFast(GetIdx1Unchecked(row,col),time); };
virtual Short_t GetThreshold() const { return fThreshold; };
};
#endif
-
-
#include "AliTRDdigitsManager.h"
#include "AliTRDdataArrayS.h"
#include "AliTRDdataArrayI.h"
+#include "AliTRDdataArrayDigits.h"
#include "AliTRDSignalIndex.h"
#include "AliTRDReconstructor.h"
#include "AliTRDrecoParam.h"
//
AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- AliTRDdataArrayS *digits = 0;
+ AliTRDdataArrayDigits *digits = 0;
AliTRDdataArrayI *track0 = 0;
AliTRDdataArrayI *track1 = 0;
AliTRDdataArrayI *track2 = 0;
}
// Add a container for the digits of this detector
- digits = (AliTRDdataArrayS *) digitsManager->GetDigits(det);
+ digits = (AliTRDdataArrayDigits *) digitsManager->GetDigits(det);
if (digitsManager->UsesDictionaries())
{
{
if ((GetSignals()[it] - adcBaseline) > 0)
{
- 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);
-
+ digits->SetDataUnchecked(GetRow(), GetCol(), it, GetSignals()[it] - adcBaseline);
+ digits->SetPadStatus(GetRow(), GetCol(), it, padStatus);
+
indexes->AddIndexTBin(GetRow(), GetCol(), it);
if (digitsManager->UsesDictionaries())
{
#pragma link C++ class AliTRDdataArray+;
#pragma link C++ class AliTRDdataArrayI+;
#pragma link C++ class AliTRDdataArrayS+;
+#pragma link C++ class AliTRDdataArrayDigits+;
#pragma link C++ class AliTRDdataArrayF+;
#pragma link C++ class AliTRDSignalIndex+;
AliTRDdataArrayI.cxx \
AliTRDdataArrayS.cxx \
AliTRDdataArrayF.cxx \
+ AliTRDdataArrayDigits.cxx \
AliTRDsegmentArray.cxx \
AliTRDSignalIndex.cxx \
AliTRDgeometry.cxx \