* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
+
+/* $Id$ */
#include "AliMUONBusStruct.h"
#include "AliLog.h"
/// 12 bits for charge)
///
-
+/// \cond CLASSIMP
ClassImp(AliMUONBusStruct)
+/// \endcond
- const Int_t AliMUONBusStruct::fgkHeaderLength = 4;
+const Int_t AliMUONBusStruct::fgkHeaderLength = 4;
+const UInt_t AliMUONBusStruct::fgkDefaultDataKey = 0xB000000B;
//___________________________________________
AliMUONBusStruct::AliMUONBusStruct()
: TObject(),
+ fDataKey(0),
fTotalLength(0),
fLength(0),
fBusPatchId(0),
- fTriggerWord(0),
- fBufSize(1024),
+ fBufSize(43*64),
+ /* assuming 43 manus max per bustpatch.
+ Anyway fData is resized where needed (though it makes it slower) */
+ fData(new UInt_t[fBufSize]),
fDspId(0),
fBlkId(0)
{
//
// ctor
//
- fData = new UInt_t[fBufSize];
+
}
//___________________________________________
AliMUONBusStruct::~AliMUONBusStruct()
void AliMUONBusStruct::SetAlloc(Int_t size)
{
//
- // Allocate size per default 1024;
- // return if size < 1024
+ // Allocate size
+ // return if size < fBufSize
//
if (size < fBufSize)
return;
// In case of resizing the vector
// the most simplest way to do it
//
+ AliInfo("reallocating");
if (size == 0)
fBufSize *= 2;
else
}
//___________________________________________
AliMUONBusStruct::
-AliMUONBusStruct(const AliMUONBusStruct& event): TObject(event)
+AliMUONBusStruct(const AliMUONBusStruct& event)
+ : TObject(event),
+ fDataKey(event.fDataKey),
+ fTotalLength(event.fTotalLength),
+ fLength(event.fLength),
+ fBusPatchId(event.fBusPatchId),
+ fBufSize(event.fBufSize),
+ fData(new UInt_t[event.fBufSize]),
+ fDspId(event.fDspId),
+ fBlkId(event.fBlkId)
{
//
// copy ctor
//
- fTotalLength = event.fTotalLength;
- fLength = event.fLength;
- fBusPatchId = event.fBusPatchId;
- fTriggerWord = event.fTriggerWord;
- fBufSize = event.fBufSize;
-
- fBlkId = event.fBlkId;
- fDspId = event.fDspId;
- fData = new UInt_t[event.fBufSize];
for (int i = 0; i < event.fBufSize; i++)
fData[i] = event.fData[i];
}
// assignment operator
//
if (this == &event) return *this;
+ fDataKey = event.fDataKey;
fTotalLength = event.fTotalLength;
fLength = event.fLength;
fBusPatchId = event.fBusPatchId;
- fTriggerWord = event.fTriggerWord;
fBufSize = event.fBufSize;
fBlkId = event.fBlkId;
// clear
// delete the allocated memory
//
-
+ AliInfo("here");
delete[] fData;
}
//___________________________________________
//
// get parity
//
- if ( n>=0 && n<fLength ) return (Char_t)(fData[n] >> 29) & 0x7;
+ if ( n>=0 && n<fLength ) return (Char_t)(fData[n] >> 31) & 0x1;
AliError("Index outside limits.");
return 0;