return fEvent->GetHeader()->Get("GdcId");
}
+UInt_t AliRawReaderRoot::GetTimestamp() const
+{
+ if (!fEvent) return 0;
+ return fEvent->GetHeader()->Get("Timestamp");
+}
Int_t AliRawReaderRoot::GetEquipmentSize() const
{
return fEquipment->GetEquipmentHeader()->HeaderSize();
}
+// _________________________________________________________________________
+UInt_t AliRawReaderRoot::SwapWord(UInt_t x) const
+{
+ // Swap the endianess of the integer value 'x'
+
+ return (((x & 0x000000ffU) << 24) | ((x & 0x0000ff00U) << 8) |
+ ((x & 0x00ff0000U) >> 8) | ((x & 0xff000000U) >> 24));
+}
+
+void AliRawReaderRoot::SwapData(const void* inbuf, const void* outbuf, UInt_t size) {
+ // The method swaps the contents of the
+ // raw-data event header
+ UInt_t intCount = size/sizeof(UInt_t);
+
+ UInt_t* buf = (UInt_t*) inbuf; // temporary integers buffer
+ for (UInt_t i=0; i<intCount; i++, buf++) {
+ UInt_t value = SwapWord(*buf);
+ memcpy((UInt_t*)outbuf+i, &value, sizeof(UInt_t));
+ }
+}
+// _________________________________________________________________________
Bool_t AliRawReaderRoot::ReadHeader()
{
// "read" the data header
fHeader = (AliRawDataHeader*) fPosition;
+#ifndef R__BYTESWAP
+ SwapData((void*) fHeader, (void*) fHeaderSwapped, sizeof(AliRawDataHeader));
+ fHeader=fHeaderSwapped;
+#endif
if ((fPosition + fHeader->fSize) != fEnd) {
Warning("ReadHeader",
"Equipment %d : raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
{
// go to the next event in the root file
- if (!fFile) return kFALSE;
+ if (!fBranch) return kFALSE;
do {
delete fEvent;
{
// go back to the beginning of the root file
- if (!fFile) return kFALSE;
+ if (!fBranch) return kFALSE;
fEventIndex = -1;
delete fEvent;