]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONBusStruct.cxx
- Adding the array of slat segmentation and GetLayerSegmentation(..) method
[u/mrichter/AliRoot.git] / MUON / AliMUONBusStruct.cxx
index 2794c1e81dd3c20244eb9c25e9ee1f3a02512b7a..f80734ea341ca54566fafe452c6b83e30069b2c2 100644 (file)
 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()
@@ -63,8 +67,8 @@ 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;
@@ -89,6 +93,7 @@ void AliMUONBusStruct::ResizeData(Int_t size)
   // In case of resizing the vector
   // the most simplest way to do it
   //
+  AliInfo("reallocating");
   if (size == 0)
     fBufSize *= 2;
   else
@@ -101,21 +106,21 @@ void AliMUONBusStruct::ResizeData(Int_t size)
 }
 //___________________________________________
 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];
 }
@@ -127,10 +132,10 @@ AliMUONBusStruct::operator=(const AliMUONBusStruct& event)
   // 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;
@@ -160,7 +165,7 @@ void AliMUONBusStruct::Clear(Option_t *)
   // clear
   // delete the allocated memory 
   //
-
+  AliInfo("here");
   delete[] fData;
 }
 //___________________________________________
@@ -181,7 +186,7 @@ Char_t AliMUONBusStruct::GetParity(Int_t n) const
   //
   // 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;