#include "AliTRDfeeParam.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDdataArrayI.h"
+#include "AliTRDdataArrayS.h"
#include "AliTRDSignalIndex.h"
ClassImp(AliTRDRawStreamV2)
//_____________________________________________________________________________
AliTRDRawStreamV2::AliTRDRawStreamV2()
- :TObject()
+ :AliTRDrawStreamBase()
+// :TObject()
,fGeo(NULL)
,fSig()
,fADC(0)
//_____________________________________________________________________________
AliTRDRawStreamV2::AliTRDRawStreamV2(AliRawReader *rawReader)
- :TObject()
+ :AliTRDrawStreamBase(rawReader)
+// :TObject()
,fGeo(NULL)
,fADC(0)
,fTB(0)
//_____________________________________________________________________________
AliTRDRawStreamV2::AliTRDRawStreamV2(const AliTRDRawStreamV2& stream)
- :TObject(stream)
+ :AliTRDrawStreamBase(stream)
+// :TObject()
,fGeo(NULL)
,fSig()
,fADC(-1)
}
//____________________________________________________________________________
-Int_t AliTRDRawStreamV2::Init()
+Bool_t AliTRDRawStreamV2::Init()
{
//
// Initialization
if (!AliTRDcalibDB::Instance()) {
AliError("Could not get calibration object");
- return 0;
+ return kFALSE;
}
if (!fGeo) {
return kTRUE;
}
+//____________________________________________________________________________
+void AliTRDRawStreamV2::SwapOnEndian()
+{
+ //
+ // Check the endian and swap if needed
+ //
+
+ int itemp = 1;
+ char* ptemp = (char*) &itemp;
+ if (ptemp[0] != 1)
+ {
+ // need to swap...
+ // assume we are at the begining of the buffer!
+ //AliDebug(5, "Swapping.");
+ UInt_t *pbegin = (UInt_t*)fPos;
+ UInt_t iutmp = 0;
+ for (UInt_t i = 0; i < fBufSize / fgkSizeWord; i++)
+ {
+ fDataWord = pbegin + i;
+ iutmp = (((*fDataWord & 0x000000ffU) << 24) | ((*fDataWord & 0x0000ff00U) << 8) |
+ ((*fDataWord & 0x00ff0000U) >> 8) | ((*fDataWord & 0xff000000U) >> 24));
+ // here we override the value in the buffer!
+ *fDataWord = iutmp;
+ }
+ fDataWord = pbegin;
+ }
+}
//____________________________________________________________________________
Int_t AliTRDRawStreamV2::NextData()
{
fBufSize = fRawReader->GetDataSize();
fCountBytes = 0;
fDataWord = (UInt_t*)fPos;
+ SwapOnEndian();
ChangeStatus(kNextSM);
fWordCtr = 0;
return kNextSM;
}
//____________________________________________________________________________
-Int_t AliTRDRawStreamV2::NextChamber(AliTRDdigitsManager *man)
+Int_t AliTRDRawStreamV2::NextChamber(AliTRDdigitsManager *man, UInt_t** /*trackletContainer*/)
{
//
// Fills single chamber digit array
// Return value is the detector number
//
- AliTRDdataArrayI *digits = 0;
+ AliTRDdataArrayS *digits = 0;
AliTRDdataArrayI *track0 = 0;
AliTRDdataArrayI *track1 = 0;
AliTRDdataArrayI *track2 = 0;
// AliDebug(4, Form("???? New DET ???? %d last %d", fDET, fLastDET));
// allocate stuff for the new det
//man->ResetArrays();
- digits = man->GetDigits(fDET);
- track0 = man->GetDictionary(fDET,0);
- track1 = man->GetDictionary(fDET,1);
- track2 = man->GetDictionary(fDET,2);
+ digits = (AliTRDdataArrayS *) man->GetDigits(fDET);
+ track0 = (AliTRDdataArrayI *) man->GetDictionary(fDET,0);
+ track1 = (AliTRDdataArrayI *) man->GetDictionary(fDET,1);
+ track2 = (AliTRDdataArrayI *) man->GetDictionary(fDET,2);
// Allocate memory space for the digits buffer
if (digits->GetNtime() == 0)