]> 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 ac712e6589dd629617d6c9ce664c990194d01a69..f80734ea341ca54566fafe452c6b83e30069b2c2 100644 (file)
@@ -42,14 +42,17 @@ AliMUONBusStruct::AliMUONBusStruct()
      fTotalLength(0),
      fLength(0),
      fBusPatchId(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()
@@ -64,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;
@@ -90,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
@@ -102,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
   //
-  fDataKey     = event.fDataKey;
-  fTotalLength = event.fTotalLength;
-  fLength      = event.fLength;
-  fBusPatchId  = event.fBusPatchId;
-  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];
 }
@@ -161,7 +165,7 @@ void AliMUONBusStruct::Clear(Option_t *)
   // clear
   // delete the allocated memory 
   //
-
+  AliInfo("here");
   delete[] fData;
 }
 //___________________________________________
@@ -182,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;